mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
vendor files
This commit is contained in:
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/README.md
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/README.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md)
|
32
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-busybox-rc.yaml
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-busybox-rc.yaml
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
# This mounts the nfs volume claim into /mnt and continuously
|
||||
# overwrites /mnt/index.html with the time and hostname of the pod.
|
||||
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: nfs-busybox
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
name: nfs-busybox
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: nfs-busybox
|
||||
spec:
|
||||
containers:
|
||||
- image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- 'while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done'
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: busybox
|
||||
volumeMounts:
|
||||
# name must match the volume name below
|
||||
- name: nfs
|
||||
mountPath: "/mnt"
|
||||
volumes:
|
||||
- name: nfs
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs
|
25
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/Dockerfile
generated
vendored
Normal file
25
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/Dockerfile
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM centos
|
||||
RUN yum -y install /usr/bin/ps nfs-utils && yum clean all
|
||||
RUN mkdir -p /exports
|
||||
ADD run_nfs.sh /usr/local/bin/
|
||||
ADD index.html /tmp/index.html
|
||||
RUN chmod 644 /tmp/index.html
|
||||
|
||||
# expose mountd 20048/tcp and nfsd 2049/tcp and rpcbind 111/tcp
|
||||
EXPOSE 2049/tcp 20048/tcp 111/tcp 111/udp
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"]
|
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/README.md
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/README.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-data/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-data/README.md)
|
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/index.html
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/index.html
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
Hello world!
|
72
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/run_nfs.sh
generated
vendored
Executable file
72
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-data/run_nfs.sh
generated
vendored
Executable file
@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
function start()
|
||||
{
|
||||
|
||||
# prepare /etc/exports
|
||||
for i in "$@"; do
|
||||
# fsid=0: needed for NFSv4
|
||||
echo "$i *(rw,fsid=0,insecure,no_root_squash)" >> /etc/exports
|
||||
# move index.html to here
|
||||
/bin/cp /tmp/index.html $i/
|
||||
chmod 644 $i/index.html
|
||||
echo "Serving $i"
|
||||
done
|
||||
|
||||
# start rpcbind if it is not started yet
|
||||
/usr/sbin/rpcinfo 127.0.0.1 > /dev/null; s=$?
|
||||
if [ $s -ne 0 ]; then
|
||||
echo "Starting rpcbind"
|
||||
/usr/sbin/rpcbind -w
|
||||
fi
|
||||
|
||||
mount -t nfsd nfds /proc/fs/nfsd
|
||||
|
||||
# -N 4.x: disable NFSv4
|
||||
# -V 3: enable NFSv3
|
||||
/usr/sbin/rpc.mountd -N 2 -V 3 -N 4 -N 4.1
|
||||
|
||||
/usr/sbin/exportfs -r
|
||||
# -G 10 to reduce grace time to 10 seconds (the lowest allowed)
|
||||
/usr/sbin/rpc.nfsd -G 10 -N 2 -V 3 -N 4 -N 4.1 2
|
||||
/usr/sbin/rpc.statd --no-notify
|
||||
echo "NFS started"
|
||||
}
|
||||
|
||||
function stop()
|
||||
{
|
||||
echo "Stopping NFS"
|
||||
|
||||
/usr/sbin/rpc.nfsd 0
|
||||
/usr/sbin/exportfs -au
|
||||
/usr/sbin/exportfs -f
|
||||
|
||||
kill $( pidof rpc.mountd )
|
||||
umount /proc/fs/nfsd
|
||||
echo > /etc/exports
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
trap stop TERM
|
||||
|
||||
start "$@"
|
||||
|
||||
# Ugly hack to do nothing and wait for SIGTERM
|
||||
while true; do
|
||||
sleep 5
|
||||
done
|
BIN
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pv.png
generated
vendored
Normal file
BIN
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pv.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
13
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pv.yaml
generated
vendored
Normal file
13
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pv.yaml
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: nfs
|
||||
spec:
|
||||
capacity:
|
||||
storage: 1Mi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
nfs:
|
||||
# FIXME: use the right IP
|
||||
server: 10.244.1.4
|
||||
path: "/exports"
|
10
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pvc.yaml
generated
vendored
Normal file
10
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-pvc.yaml
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Mi
|
32
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-server-rc.yaml
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-server-rc.yaml
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: nfs-server
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
role: nfs-server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
role: nfs-server
|
||||
spec:
|
||||
containers:
|
||||
- name: nfs-server
|
||||
image: gcr.io/google-samples/nfs-server:1.1
|
||||
ports:
|
||||
- name: nfs
|
||||
containerPort: 2049
|
||||
- name: mountd
|
||||
containerPort: 20048
|
||||
- name: rpcbind
|
||||
containerPort: 111
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- mountPath: /exports
|
||||
name: mypvc
|
||||
volumes:
|
||||
- name: mypvc
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs-pv-provisioning-demo
|
14
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-server-service.yaml
generated
vendored
Normal file
14
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-server-service.yaml
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-server
|
||||
spec:
|
||||
ports:
|
||||
- name: nfs
|
||||
port: 2049
|
||||
- name: mountd
|
||||
port: 20048
|
||||
- name: rpcbind
|
||||
port: 111
|
||||
selector:
|
||||
role: nfs-server
|
30
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-web-rc.yaml
generated
vendored
Normal file
30
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-web-rc.yaml
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# This pod mounts the nfs volume claim into /usr/share/nginx/html and
|
||||
# serves a simple web page.
|
||||
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: nfs-web
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
role: web-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
role: web-frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: nginx
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
volumeMounts:
|
||||
# name must match the volume name below
|
||||
- name: nfs
|
||||
mountPath: "/usr/share/nginx/html"
|
||||
volumes:
|
||||
- name: nfs
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs
|
9
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-web-service.yaml
generated
vendored
Normal file
9
vendor/k8s.io/kubernetes/examples/volumes/nfs/nfs-web-service.yaml
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-web
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
role: web-frontend
|
11
vendor/k8s.io/kubernetes/examples/volumes/nfs/provisioner/nfs-server-gce-pv.yaml
generated
vendored
Normal file
11
vendor/k8s.io/kubernetes/examples/volumes/nfs/provisioner/nfs-server-gce-pv.yaml
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: nfs-pv-provisioning-demo
|
||||
labels:
|
||||
demo: nfs-pv-provisioning
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi
|
Reference in New Issue
Block a user