2019-11-01 07:59:24 +00:00
|
|
|
# This YAML file contains CSI Controller Plugin Sidecars
|
|
|
|
# external-attacher, external-provisioner, external-snapshotter
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: Deployment
|
|
|
|
apiVersion: apps/v1
|
|
|
|
metadata:
|
|
|
|
name: csi-cinder-controllerplugin
|
|
|
|
namespace: kube-system
|
|
|
|
spec:
|
|
|
|
replicas: {{ cinder_csi_controller_replicas }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: csi-cinder-controllerplugin
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: csi-cinder-controllerplugin
|
|
|
|
spec:
|
|
|
|
serviceAccount: csi-cinder-controller-sa
|
|
|
|
containers:
|
|
|
|
- name: csi-attacher
|
2020-03-25 20:10:25 +00:00
|
|
|
image: {{ csi_attacher_image_repo }}:{{ csi_attacher_image_tag }}
|
2019-11-01 07:59:24 +00:00
|
|
|
args:
|
|
|
|
- "--v=5"
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2020-03-03 14:33:38 +00:00
|
|
|
{% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
|
|
|
|
- --leader-election
|
|
|
|
- --leader-election-type=leases
|
|
|
|
- --leader-election-namespace=kube-system
|
|
|
|
{% endif %}
|
2019-11-01 07:59:24 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
|
|
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
|
|
|
imagePullPolicy: "IfNotPresent"
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /var/lib/csi/sockets/pluginproxy/
|
|
|
|
- name: csi-provisioner
|
2020-03-25 20:10:25 +00:00
|
|
|
image: {{ csi_provisioner_image_repo }}:{{ csi_provisioner_image_tag }}
|
2019-11-01 07:59:24 +00:00
|
|
|
args:
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2020-02-26 13:12:25 +00:00
|
|
|
{% if cinder_topology is defined and cinder_topology %}
|
|
|
|
- --feature-gates=Topology=true
|
2020-03-03 14:33:38 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
|
|
|
|
- --enable-leader-election
|
|
|
|
- --leader-election-type=leases
|
|
|
|
- --leader-election-namespace=kube-system
|
2020-02-26 13:12:25 +00:00
|
|
|
{% endif %}
|
2019-11-01 07:59:24 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
|
|
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
|
|
|
imagePullPolicy: "IfNotPresent"
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /var/lib/csi/sockets/pluginproxy/
|
|
|
|
- name: csi-snapshotter
|
2020-03-25 20:10:25 +00:00
|
|
|
image: {{ csi_snapshotter_image_repo }}:{{ csi_snapshotter_image_tag }}
|
2019-11-01 07:59:24 +00:00
|
|
|
args:
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2020-03-03 14:33:38 +00:00
|
|
|
{% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
|
|
|
|
- --leader-election
|
|
|
|
- --leader-election-namespace=kube-system
|
|
|
|
{% endif %}
|
2019-11-01 07:59:24 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
|
|
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
2020-02-17 10:13:30 +00:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2019-11-01 07:59:24 +00:00
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /var/lib/csi/sockets/pluginproxy/
|
|
|
|
name: socket-dir
|
|
|
|
- name: csi-resizer
|
2020-03-25 20:10:25 +00:00
|
|
|
image: {{ csi_resizer_image_repo }}:{{ csi_resizer_image_tag }}
|
2019-11-01 07:59:24 +00:00
|
|
|
args:
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2020-03-03 14:33:38 +00:00
|
|
|
{% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
|
|
|
|
- --leader-election
|
|
|
|
- --leader-election-namespace=kube-system
|
|
|
|
{% endif %}
|
2019-11-01 07:59:24 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
|
|
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
|
|
|
imagePullPolicy: "IfNotPresent"
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /var/lib/csi/sockets/pluginproxy/
|
|
|
|
- name: cinder-csi-plugin
|
2020-02-17 11:47:29 +00:00
|
|
|
image: {{ cinder_csi_plugin_image_repo }}:{{ cinder_csi_plugin_image_tag }}
|
2019-11-01 07:59:24 +00:00
|
|
|
args :
|
|
|
|
- /bin/cinder-csi-plugin
|
|
|
|
- "--nodeid=$(NODE_ID)"
|
|
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
|
|
- "--cloud-config=$(CLOUD_CONFIG)"
|
|
|
|
- "--cluster=$(CLUSTER_NAME)"
|
|
|
|
env:
|
|
|
|
- name: NODE_ID
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
|
|
|
- name: CSI_ENDPOINT
|
|
|
|
value: unix://csi/csi.sock
|
|
|
|
- name: CLOUD_CONFIG
|
|
|
|
value: /etc/config/cloud.conf
|
|
|
|
- name: CLUSTER_NAME
|
|
|
|
value: kubernetes
|
|
|
|
imagePullPolicy: "IfNotPresent"
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /csi
|
|
|
|
- name: secret-cinderplugin
|
|
|
|
mountPath: /etc/config
|
|
|
|
readOnly: true
|
2020-02-17 11:47:29 +00:00
|
|
|
- name: ca-certs
|
|
|
|
mountPath: /etc/ssl/certs
|
|
|
|
readOnly: true
|
2020-02-17 09:49:28 +00:00
|
|
|
{% if cinder_cacert is defined and cinder_cacert != "" %}
|
2019-11-01 07:59:24 +00:00
|
|
|
- name: cinder-cacert
|
|
|
|
mountPath: {{ kube_config_dir }}/cinder-cacert.pem
|
|
|
|
readOnly: true
|
|
|
|
{% endif %}
|
|
|
|
volumes:
|
|
|
|
- name: socket-dir
|
|
|
|
emptyDir:
|
|
|
|
- name: secret-cinderplugin
|
|
|
|
secret:
|
|
|
|
secretName: cloud-config
|
2020-02-17 11:47:29 +00:00
|
|
|
- name: ca-certs
|
|
|
|
hostPath:
|
|
|
|
path: /etc/ssl/certs
|
|
|
|
type: DirectoryOrCreate
|
2020-02-17 09:49:28 +00:00
|
|
|
{% if cinder_cacert is defined and cinder_cacert != "" %}
|
2019-11-01 07:59:24 +00:00
|
|
|
- name: cinder-cacert
|
|
|
|
hostPath:
|
|
|
|
path: {{ kube_config_dir }}/cinder-cacert.pem
|
|
|
|
type: FileOrCreate
|
|
|
|
{% endif %}
|