Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openstack-cinder-csi helm chart for multi cloud support #2681

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion charts/cinder-csi-plugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v1.31.0
description: Cinder CSI Chart for OpenStack
name: openstack-cinder-csi
version: 2.31.0
version: 2.31.3
home: https://github.com/kubernetes/cloud-provider-openstack
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ spec:
{{- tpl . $ | trim | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.csi.plugin.controllerPlugin.extraArgs }}
{{- with .Values.csi.plugin.controllerPlugin.extraArgs }}
{{- tpl . $ | trim | nindent 12 }}
{{- end }}
{{- end }}
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
Expand Down
18 changes: 6 additions & 12 deletions charts/cinder-csi-plugin/templates/controllerplugin-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
# Secret permission is optional.
# Enable it if your driver needs secret.
# For example, `csi.storage.k8s.io/snapshotter-secret-name` is set in VolumeSnapshotClass.
# See https://kubernetes-csi.github.io/docs/secrets-and-credentials.html for more details.
# - apiGroups: [""]
# resources: ["secrets"]
# verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
Expand All @@ -116,6 +109,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
{{- with .Values.csi.snapshotter.extraRbac }}
{{- toYaml . | nindent 2 }}
{{- end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -135,11 +131,6 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-resizer-role
rules:
# The following rule should be uncommented for plugins that require secrets
# for provisioning.
# - apiGroups: [""]
# resources: ["secrets"]
# verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "patch"]
Expand All @@ -158,6 +149,9 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
{{- with .Values.csi.resizer.extraRbac }}
{{- toYaml . | nindent 2 }}
{{- end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
5 changes: 5 additions & 0 deletions charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ spec:
{{- tpl . $ | trim | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.csi.plugin.nodePlugin.extraArgs }}
{{- with .Values.csi.plugin.nodePlugin.extraArgs }}
{{- tpl . $ | trim | nindent 12 }}
{{- end }}
{{- end }}
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
Expand Down
16 changes: 16 additions & 0 deletions charts/cinder-csi-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ csi:
resources: {}
extraArgs: {}
extraEnv: []
# Secret permission is optional.
# Enable it if your driver needs secret.
# For example, `csi.storage.k8s.io/snapshotter-secret-name` is set in VolumeSnapshotClass.
# See https://kubernetes-csi.github.io/docs/secrets-and-credentials.html for more details.
extraRbac: {}
# - apiGroups: [""]
# resources: ["secrets"]
# verbs: ["get", "list"]
resizer:
image:
repository: registry.k8s.io/sig-storage/csi-resizer
Expand All @@ -38,6 +46,12 @@ csi:
resources: {}
extraArgs: {}
extraEnv: []
# The following rule should be uncommented for plugins that require secrets
# for provisioning.
extraRbac: {}
# - apiGroups: [""]
# resources: ["secrets"]
# verbs: ["get", "list", "watch"]
livenessprobe:
image:
repository: registry.k8s.io/sig-storage/livenessprobe
Expand Down Expand Up @@ -88,6 +102,7 @@ csi:
tolerations:
- operator: Exists
kubeletDir: /var/lib/kubelet
extraArgs: {}
# Allow for specifying internal IP addresses for multiple hostnames
# hostAliases:
# - ip: "10.0.0.1"
Expand Down Expand Up @@ -122,6 +137,7 @@ csi:
affinity: {}
nodeSelector: {}
tolerations: []
extraArgs: {}
# Allow for specifying internal IP addresses for multiple hostnames
# hostAliases:
# - ip: "10.0.0.1"
Expand Down
36 changes: 36 additions & 0 deletions docs/cinder-csi-plugin/multi-region-clouds.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,39 @@ spec:
...
```

### When using the cinder-csi-plugin helmchart

When runing the cinder-csi-plugin with multi-region, you need to specify different `extraArgs` on the `cinder-csi-plugin` containers of the deployment and the daemonset.

When using the helmchart, you need to set the different `extraArgs` on `plugin.nodePlugin.extraArgs` and `plugin.controllerPlugin.extraArgs`.

If you set the extraArgs in `plugin.extraArgs`, the same `extraArgs` will end up on both the `cinder-csi-plugin` container of both the deployment and the daemonset.

You will still need to manually create your additionnal daemonsets for your additionnal regions.

```yaml
nodePlugin:
extraArgs: |-
- --cloud-name=region-one
- --additional-topology
- topology.kubernetes.io/region=region-one
controllerPlugin:
extraArgs: |-
- --cloud-name=region-one
- --cloud-name=region-two
```

In addition, if you use the `resizer` and the `snapshotter`, you will need them to be able to read the secrets you defined in the storage class' annotations in order to determine which cloud to address. You will need to add some `extraRbac` in YAML format, like this:

```yaml
snapshotter:
extraRbac:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
resizer:
extraRbac:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
```