Commit ce963392 by wangtingwei

add test pod yaml

1 parent feac941e
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: kfs-client-provisioner
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: kfs-client-provisioner
spec:
serviceAccountName: kfs-client-provisioner
containers:
- name: kfs-client-provisioner
image: hb.seetatech.com/wangtingwei/nfs-client-provisioner:latest
volumeMounts:
- name: kfs-client-root
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: kfs-test
- name: NFS_SERVER
value: 10.12.1.26
- name: NFS_PATH
value: /share-b3207587-5e17-439c-8e15-da5f1f1aca46
volumes:
- name: kfs-client-root
nfs:
server: 10.12.1.26
path: /share-b3207587-5e17-439c-8e15-da5f1f1aca46
kind: ServiceAccount
apiVersion: v1
metadata:
name: kfs-client-provisioner
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kfs-client-provisioner-runner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: run-kfs-client-provisioner
subjects:
- kind: ServiceAccount
name: kfs-client-provisioner
namespace: default
roleRef:
kind: ClusterRole
name: kfs-client-provisioner-runner
apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-kfs-client-provisioner
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-kfs-client-provisioner
subjects:
- kind: ServiceAccount
name: kfs-client-provisioner
# replace with namespace where provisioner is deployed
namespace: default
roleRef:
kind: Role
name: leader-locking-kfs-client-provisioner
apiGroup: rbac.authorization.k8s.io
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-kfs-storage
provisioner: kfs-test #这个名字需要和deployment的PROVISIONER_NAME名字一致
#reclaimPolicy: Retain #默认为delete
mountOptions:
- nfsvers=3
kind: Pod
apiVersion: v1
metadata:
name: test-pod
namespace: test
spec:
containers:
- name: test-pod
image: nginx
volumeMounts:
- name: nfs-pvc
mountPath: "/mnt"
restartPolicy: "Always"
volumes:
- name: nfs-pvc
persistentVolumeClaim:
claimName: test-claim
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim
namespace: test
annotations:
volume.beta.kubernetes.io/storage-class: "managed-nfs-storage"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Mi
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!