csi-mock-driver.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. kind: StatefulSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: csi-mockplugin
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: csi-mockplugin
  9. replicas: 1
  10. template:
  11. metadata:
  12. labels:
  13. app: csi-mockplugin
  14. spec:
  15. serviceAccountName: csi-mock
  16. containers:
  17. - name: csi-provisioner
  18. image: quay.io/k8scsi/csi-provisioner:v1.5.0
  19. args:
  20. - "--csi-address=$(ADDRESS)"
  21. - "--connection-timeout=15s"
  22. env:
  23. - name: ADDRESS
  24. value: /csi/csi.sock
  25. volumeMounts:
  26. - mountPath: /csi
  27. name: socket-dir
  28. - name: driver-registrar
  29. image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
  30. args:
  31. - --v=5
  32. - --csi-address=/csi/csi.sock
  33. - --kubelet-registration-path=/var/lib/kubelet/plugins/csi-mock/csi.sock
  34. env:
  35. - name: KUBE_NODE_NAME
  36. valueFrom:
  37. fieldRef:
  38. apiVersion: v1
  39. fieldPath: spec.nodeName
  40. securityContext:
  41. privileged: true
  42. volumeMounts:
  43. - mountPath: /csi
  44. name: socket-dir
  45. - mountPath: /registration
  46. name: registration-dir
  47. - name: mock
  48. image: quay.io/k8scsi/mock-driver:v2.1.0
  49. args:
  50. - "--name=mock.storage.k8s.io"
  51. - "--permissive-target-path" # because of https://github.com/kubernetes/kubernetes/issues/75535
  52. env:
  53. - name: CSI_ENDPOINT
  54. value: /csi/csi.sock
  55. - name: KUBE_NODE_NAME
  56. valueFrom:
  57. fieldRef:
  58. apiVersion: v1
  59. fieldPath: spec.nodeName
  60. securityContext:
  61. privileged: true
  62. volumeMounts:
  63. - mountPath: /csi
  64. name: socket-dir
  65. - mountPath: /var/lib/kubelet/pods
  66. mountPropagation: Bidirectional
  67. name: mountpoint-dir
  68. volumes:
  69. - hostPath:
  70. path: /var/lib/kubelet/plugins/csi-mock
  71. type: DirectoryOrCreate
  72. name: socket-dir
  73. - hostPath:
  74. path: /var/lib/kubelet/pods
  75. type: DirectoryOrCreate
  76. name: mountpoint-dir
  77. - hostPath:
  78. path: /var/lib/kubelet/plugins_registry
  79. type: Directory
  80. name: registration-dir