Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
174 changes: 174 additions & 0 deletions content/kubevirt/kubevirt-csi-driver/controller-infra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: kubevirt-csi-controller
# namespace: kubevirt-csi-driver
labels:
app: kubevirt-csi-driver
spec:
replicas: 1
selector:
matchLabels:
app: kubevirt-csi-driver
template:
metadata:
labels:
app: kubevirt-csi-driver
spec:
enableServiceLinks: false
serviceAccount: kubevirt-csi
priorityClassName: system-cluster-critical
nodeSelector:
node-role.kubernetes.io/control-plane: ""
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/master
operator: Exists
effect: "NoSchedule"
containers:
- name: csi-driver
imagePullPolicy: Always
image: quay.io/kubevirt/kubevirt-csi-driver:latest
args:
- "--endpoint=$(CSI_ENDPOINT)"
- "--infra-cluster-namespace=$(INFRACLUSTER_NAMESPACE)"
- "--infra-cluster-labels=$(INFRACLUSTER_LABELS)"
- "--tenant-cluster-kubeconfig=/var/run/secrets/tenantcluster/value"
- "--run-node-service=false"
- "--run-controller-service=true"
- "--v=5"
ports:
- name: healthz
containerPort: 10301
protocol: TCP
env:
- name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: INFRACLUSTER_NAMESPACE
valueFrom:
configMapKeyRef:
name: driver-config
key: infraClusterNamespace
- name: INFRACLUSTER_LABELS
valueFrom:
configMapKeyRef:
name: driver-config
key: infraClusterLabels
- name: INFRA_STORAGE_CLASS_ENFORCEMENT
valueFrom:
configMapKeyRef:
name: driver-config
key: infraStorageClassEnforcement
optional: true
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
resources:
requests:
memory: 50Mi
cpu: 10m
- name: csi-provisioner
image: quay.io/openshift/origin-csi-external-provisioner:latest
args:
- "--csi-address=$(ADDRESS)"
- "--default-fstype=ext4"
- "--kubeconfig=/var/run/secrets/tenantcluster/value"
- "--v=5"
- "--timeout=3m"
- "--retry-interval-max=1m"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
- name: csi-attacher
image: quay.io/openshift/origin-csi-external-attacher:latest
args:
- "--csi-address=$(ADDRESS)"
- "--kubeconfig=/var/run/secrets/tenantcluster/value"
- "--v=5"
- "--timeout=3m"
- "--retry-interval-max=1m"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
resources:
requests:
memory: 50Mi
cpu: 10m
- name: csi-liveness-probe
image: quay.io/openshift/origin-csi-livenessprobe:latest
args:
- "--csi-address=/csi/csi.sock"
- "--probe-timeout=3s"
- "--health-port=10301"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
resources:
requests:
memory: 50Mi
cpu: 10m
- name: csi-snapshotter
args:
- "--v=5"

Check failure on line 131 in content/kubevirt/kubevirt-csi-driver/controller-infra.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

131:11 [indentation] wrong indentation: expected 12 but found 10
- "--csi-address=/csi/csi.sock"
- "--kubeconfig=/var/run/secrets/tenantcluster/value"
- "--timeout=3m"
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1
imagePullPolicy: IfNotPresent
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /csi

Check failure on line 140 in content/kubevirt/kubevirt-csi-driver/controller-infra.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

140:11 [indentation] wrong indentation: expected 12 but found 10
name: socket-dir
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
resources:
requests:
memory: 20Mi
cpu: 10m
- name: csi-resizer
image: registry.k8s.io/sig-storage/csi-resizer:v1.13.1
args:
- "-csi-address=/csi/csi.sock"
- "-kubeconfig=/var/run/secrets/tenantcluster/value"
- "-v=5"
- "-timeout=3m"
- '-handle-volume-inuse-error=false'
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: tenantcluster
mountPath: "/var/run/secrets/tenantcluster"
resources:
requests:
cpu: 10m
memory: 20Mi
securityContext:
capabilities:
drop:
- ALL
volumes:
- name: socket-dir
emptyDir: {}
- name: tenantcluster
secret:
secretName: kvcluster-kubeconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubevirt-csi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kubevirt-csi
rules:
- apiGroups: ["cdi.kubevirt.io"]

Check failure on line 11 in content/kubevirt/kubevirt-csi-driver/infra-cluster-serviceaccount.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

11:1 [indentation] wrong indentation: expected 2 but found 0
resources: ["datavolumes"]
verbs: ["get", "create", "delete"]
- apiGroups: ["kubevirt.io"]
resources: ["virtualmachineinstances"]
verbs: ["list", "get"]
- apiGroups: ["kubevirt.io"]
resources: ["virtualmachines"]
verbs: ["list", "get", "watch"]
- apiGroups: ["subresources.kubevirt.io"]
resources:
- "virtualmachines/addvolume"
- "virtualmachines/removevolume"
verbs: ["update"]
- apiGroups: ["subresources.kubevirt.io"]
resources: ["virtualmachineinstances/addvolume", "virtualmachineinstances/removevolume"]
verbs: ["update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubevirt-csi
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubevirt-csi
subjects:
- kind: ServiceAccount

Check failure on line 44 in content/kubevirt/kubevirt-csi-driver/infra-cluster-serviceaccount.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

44:1 [indentation] wrong indentation: expected 2 but found 0
name: kubevirt-csi
Loading