Remove hostnetwork from plugin in order to support nfs servers via K8s service dns name, and clean up examples

Change-Id: Id16bd5478413a4a626add9b5fe473cda7ada06ce
This commit is contained in:
Michelle Au 2020-07-28 17:45:20 -07:00
parent 1bb6a868c1
commit b039aa07c6
2 changed files with 9 additions and 11 deletions

View File

@ -14,7 +14,6 @@ spec:
app: csi-nodeplugin-nfsplugin
spec:
serviceAccount: csi-nodeplugin
hostNetwork: true
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2

View File

@ -5,6 +5,9 @@ metadata:
labels:
name: data-nfsplugin
spec:
claimRef:
name: data-nfsplugin
namespace: default
accessModes:
- ReadWriteMany
capacity:
@ -12,7 +15,9 @@ spec:
csi:
driver: nfs.csi.k8s.io
volumeHandle: data-id
volumeAttributes:
volumeAttributes:
# The nfs server could be a K8s service
# server: nfs-server.default.svc.cluster.local
server: 127.0.0.1
share: /export
---
@ -26,28 +31,22 @@ spec:
resources:
requests:
storage: 100Gi
selector:
matchExpressions:
- key: name
operator: In
values: ["data-nfsplugin"]
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
name: nginx
spec:
containers:
- image: maersk/nginx
imagePullPolicy: Always
name: nginx
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /var/www
name: data-nfsplugin
name: data-nfsplugin
volumes:
- name: data-nfsplugin
persistentVolumeClaim:
claimName: data-nfsplugin
claimName: data-nfsplugin