Manifest Installation
If you prefer not to use Helm, you can apply the individual YAML manifests directly. The manifests below are the rendered output of the Helm chart with default values.
The same manifests, rendered with default values, are published as a single file. To apply them directly:
kubectl apply -f https://get.flexfs.io/v1.9.x/k8s/csi.yamlTo use non-default values, render the manifests yourself from the published chart instead. Download and extract it (see Download the chart), then:
helm template flexfs-csi-driver ./flexfs-csi-driver --namespace kube-system > flexfs-csi-manifests.yamlPass --set flags (for example --set kubeletDir=/var/snap/microk8s/common/var/lib/kubelet) to helm template exactly as you would for helm install.
Apply all manifests
Section titled “Apply all manifests”Apply the following six resources in order. All resources are created in the kube-system namespace except the cluster-scoped objects (CSIDriver, ClusterRole, ClusterRoleBinding).
1. CSIDriver
Section titled “1. CSIDriver”apiVersion: storage.k8s.io/v1kind: CSIDrivermetadata: name: csi.flexfs.iospec: attachRequired: false fsGroupPolicy: None2. ServiceAccount
Section titled “2. ServiceAccount”apiVersion: v1kind: ServiceAccountmetadata: name: flexfs-csi-controller namespace: kube-system3. ClusterRole
Section titled “3. ClusterRole”apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata: name: flexfs-csi-controllerrules: - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: ["storage.k8s.io"] resources: ["csinodes"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["events"] verbs: ["create", "list", "patch", "update", "watch"] - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "patch", "update", "watch"] - apiGroups: [""] resources: ["persistentvolumeclaims/status"] verbs: ["patch", "update"] - apiGroups: [""] resources: ["persistentvolumes"] verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "list"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["get", "list", "watch"]4. ClusterRoleBinding
Section titled “4. ClusterRoleBinding”apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: flexfs-csi-controllersubjects: - kind: ServiceAccount name: flexfs-csi-controller namespace: kube-systemroleRef: kind: ClusterRole name: flexfs-csi-controller apiGroup: rbac.authorization.k8s.io5. Controller Deployment
Section titled “5. Controller Deployment”apiVersion: apps/v1kind: Deploymentmetadata: name: flexfs-csi-controller namespace: kube-systemspec: replicas: 2 selector: matchLabels: app: flexfs-csi-controller template: metadata: labels: app: flexfs-csi-controller spec: serviceAccountName: flexfs-csi-controller priorityClassName: system-cluster-critical tolerations: - key: CriticalAddonsOnly operator: Exists nodeSelector: kubernetes.io/os: linux containers: - name: flexfs-csi-driver image: flexfs/csi-driver-1.9:latest imagePullPolicy: Always volumeMounts: - name: driver-dir mountPath: /csi - name: csi-provisioner image: registry.k8s.io/sig-storage/csi-provisioner:v3.6.4 args: - "--csi-address=/csi/csi.sock" - "--leader-election=true" - "--leader-election-namespace=$(POD_NAMESPACE)" env: - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace volumeMounts: - name: driver-dir mountPath: /csi - name: csi-resizer image: registry.k8s.io/sig-storage/csi-resizer:v1.10.1 args: - "--csi-address=/csi/csi.sock" - "--leader-election=true" - "--leader-election-namespace=$(POD_NAMESPACE)" env: - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace volumeMounts: - name: driver-dir mountPath: /csi volumes: - name: driver-dir emptyDir: {}6. Node DaemonSet
Section titled “6. Node DaemonSet”apiVersion: apps/v1kind: DaemonSetmetadata: name: flexfs-csi-node namespace: kube-systemspec: updateStrategy: type: OnDelete selector: matchLabels: app: flexfs-csi-node template: metadata: labels: app: flexfs-csi-node spec: priorityClassName: system-node-critical nodeSelector: kubernetes.io/os: linux containers: - name: flexfs-csi-driver image: flexfs/csi-driver-1.9:latest imagePullPolicy: Always args: - "--kubeletDir=/var/lib/kubelet" securityContext: privileged: true volumeMounts: - name: driver-dir mountPath: /csi - name: kubelet-dir mountPath: /var/lib/kubelet mountPropagation: Bidirectional - name: csi-node-driver-registrar image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.1 args: - "--csi-address=/csi/csi.sock" - "--kubelet-registration-path=/var/lib/kubelet/plugins/csi.flexfs.io/csi.sock" volumeMounts: - name: driver-dir mountPath: /csi - name: registration-dir mountPath: /registration tolerations: - operator: Exists volumes: - name: driver-dir hostPath: path: /var/lib/kubelet/plugins/csi.flexfs.io type: DirectoryOrCreate - name: kubelet-dir hostPath: path: /var/lib/kubelet type: Directory - name: registration-dir hostPath: path: /var/lib/kubelet/plugins_registry type: DirectoryApplying everything at once
Section titled “Applying everything at once”Save all six manifests into a single file (separated by ---) or a directory, then apply:
kubectl apply -f flexfs-csi-manifests.yamlOr if using a directory:
kubectl apply -f ./flexfs-csi-manifests/Upgrading
Section titled “Upgrading”Follow the Helm upgrade procedure, which applies to manifest installations as well, with these commands in place of its chart upgrade in Step 2:
kubectl -n kube-system delete statefulset flexfs-csi-controller --ignore-not-foundkubectl apply -f https://get.flexfs.io/v1.9.x/k8s/csi.yamlThe first command removes the controller StatefulSet that installations earlier than v1.8.56 use. kubectl apply does not remove it, and leaving it in place runs two controllers side by side. If you render your own manifests, apply those in place of the published file.
Everything else in the procedure is unchanged: set the node DaemonSet to OnDelete beforehand, restart the node plugin one node at a time, and verify.
Verifying the installation
Section titled “Verifying the installation”# Check that the CSIDriver is registeredkubectl get csidriver csi.flexfs.io
# Check controller podskubectl get pods -n kube-system -l app=flexfs-csi-controller
# Check node pods (one per node)kubectl get pods -n kube-system -l app=flexfs-csi-nodeRemoving the driver
Section titled “Removing the driver”kubectl delete -f flexfs-csi-manifests.yaml