Update CSI driver to latest for Hetzner

This commit is contained in:
Ciprian Hacman 2022-08-25 19:39:26 +03:00
parent 325f5e8987
commit c7afa8a9fc
1 changed files with 17 additions and 56 deletions

View File

@ -1,4 +1,4 @@
# Pulled and modified from: https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.6.0/deploy/kubernetes/hcloud-csi.yml # Pulled and modified from: https://raw.githubusercontent.com/hetznercloud/csi-driver/main/deploy/kubernetes/hcloud-csi.yml
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@ -22,13 +22,13 @@ volumeBindingMode: WaitForFirstConsumer
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: hcloud-csi name: hcloud-csi-controller
namespace: kube-system namespace: kube-system
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
name: hcloud-csi name: hcloud-csi-controller
rules: rules:
- apiGroups: - apiGroups:
- "" - ""
@ -164,14 +164,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: hcloud-csi name: hcloud-csi-controller
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
name: hcloud-csi name: hcloud-csi-controller
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: hcloud-csi name: hcloud-csi-controller
namespace: kube-system namespace: kube-system
--- ---
apiVersion: v1 apiVersion: v1
@ -205,7 +205,7 @@ spec:
app: hcloud-csi app: hcloud-csi
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: Deployment
metadata: metadata:
name: hcloud-csi-controller name: hcloud-csi-controller
namespace: kube-system namespace: kube-system
@ -214,7 +214,6 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: hcloud-csi-controller app: hcloud-csi-controller
serviceName: hcloud-csi-controller
template: template:
metadata: metadata:
labels: labels:
@ -223,23 +222,11 @@ spec:
containers: containers:
- image: k8s.gcr.io/sig-storage/csi-attacher:v3.2.1 - image: k8s.gcr.io/sig-storage/csi-attacher:v3.2.1
name: csi-attacher name: csi-attacher
securityContext:
allowPrivilegeEscalation: true
capabilities:
add:
- SYS_ADMIN
privileged: true
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: socket-dir name: socket-dir
- image: k8s.gcr.io/sig-storage/csi-resizer:v1.2.0 - image: k8s.gcr.io/sig-storage/csi-resizer:v1.2.0
name: csi-resizer name: csi-resizer
securityContext:
allowPrivilegeEscalation: true
capabilities:
add:
- SYS_ADMIN
privileged: true
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: socket-dir name: socket-dir
@ -248,16 +235,12 @@ spec:
- --default-fstype=ext4 - --default-fstype=ext4
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.2 image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.2
name: csi-provisioner name: csi-provisioner
securityContext:
allowPrivilegeEscalation: true
capabilities:
add:
- SYS_ADMIN
privileged: true
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: socket-dir name: socket-dir
- env: - command:
- /bin/hcloud-csi-driver-controller
env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix:///run/csi/socket value: unix:///run/csi/socket
- name: METRICS_ENDPOINT - name: METRICS_ENDPOINT
@ -274,7 +257,7 @@ spec:
secretKeyRef: secretKeyRef:
key: token key: token
name: hcloud-csi name: hcloud-csi
image: hetznercloud/hcloud-csi-driver:1.6.0 image: hetznercloud/hcloud-csi-driver:latest
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
failureThreshold: 5 failureThreshold: 5
@ -291,12 +274,6 @@ spec:
- containerPort: 9808 - containerPort: 9808
name: healthz name: healthz
protocol: TCP protocol: TCP
securityContext:
allowPrivilegeEscalation: true
capabilities:
add:
- SYS_ADMIN
privileged: true
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: socket-dir name: socket-dir
@ -306,7 +283,7 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: socket-dir name: socket-dir
serviceAccount: hcloud-csi serviceAccountName: hcloud-csi-controller
volumes: volumes:
- emptyDir: {} - emptyDir: {}
name: socket-dir name: socket-dir
@ -339,39 +316,23 @@ spec:
containers: containers:
- args: - args:
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi.hetzner.cloud/socket - --kubelet-registration-path=/var/lib/kubelet/plugins/csi.hetzner.cloud/socket
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.2.0 image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.2.0
name: csi-node-driver-registrar name: csi-node-driver-registrar
securityContext:
privileged: true
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: plugin-dir name: plugin-dir
- mountPath: /registration - mountPath: /registration
name: registration-dir name: registration-dir
- env: - command:
- /bin/hcloud-csi-driver-node
env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix:///run/csi/socket value: unix:///run/csi/socket
- name: METRICS_ENDPOINT - name: METRICS_ENDPOINT
value: 0.0.0.0:9189 value: 0.0.0.0:9189
- name: ENABLE_METRICS - name: ENABLE_METRICS
value: "true" value: "true"
- name: HCLOUD_TOKEN image: hetznercloud/hcloud-csi-driver:latest
valueFrom:
secretKeyRef:
key: token
name: hcloud-csi
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
image: hetznercloud/hcloud-csi-driver:1.6.0
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
failureThreshold: 5 failureThreshold: 5
@ -404,7 +365,6 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /run/csi - mountPath: /run/csi
name: plugin-dir name: plugin-dir
serviceAccount: hcloud-csi
tolerations: tolerations:
- effect: NoExecute - effect: NoExecute
operator: Exists operator: Exists
@ -436,6 +396,7 @@ metadata:
name: csi.hetzner.cloud name: csi.hetzner.cloud
spec: spec:
attachRequired: true attachRequired: true
fsGroupPolicy: File
podInfoOnMount: true podInfoOnMount: true
volumeLifecycleModes: volumeLifecycleModes:
- Persistent - Persistent