From d4e632e572bcd62c3b04336924187cafcba1ad65 Mon Sep 17 00:00:00 2001 From: Jun Eeo Date: Wed, 26 Apr 2023 19:02:02 +0100 Subject: [PATCH 1/5] cleanup upstream chart folder --- .../charts/openstack-cinder-csi/.helmignore | 22 --- .../charts/openstack-cinder-csi/Chart.yaml | 10 - .../charts/openstack-cinder-csi/README.md | 21 --- .../openstack-cinder-csi/templates/NOTES.txt | 1 - .../templates/_helpers.tpl | 103 ----------- .../templates/cinder-csi-driver.yaml | 10 - .../controllerplugin-deployment.yaml | 155 ---------------- .../templates/controllerplugin-rbac.yaml | 174 ------------------ .../templates/custom_storageclass.yaml | 3 - .../templates/nodeplugin-daemonset.yaml | 129 ------------- .../templates/nodeplugin-rbac.yaml | 28 --- .../templates/secret.yaml | 10 - .../templates/storageclass.yaml | 25 --- .../charts/openstack-cinder-csi/values.yaml | 150 --------------- .../Chart.yaml | 14 -- .../README.md | 35 ---- .../templates/_helpers.tpl | 84 --------- .../templates/clusterrole.yaml | 93 ---------- .../templates/clusterrolebinding-sm.yaml | 14 -- .../templates/clusterrolebinding.yaml | 12 -- .../templates/daemonset.yaml | 95 ---------- .../templates/secret.yaml | 9 - .../templates/service-sm.yaml | 15 -- .../templates/serviceaccount.yaml | 4 - .../templates/servicemonitor.yaml | 20 -- .../values.yaml | 115 ------------ 26 files changed, 1351 deletions(-) delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/.helmignore delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/Chart.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/README.md delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/NOTES.txt delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/_helpers.tpl delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/cinder-csi-driver.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-deployment.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-rbac.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/custom_storageclass.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-daemonset.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-rbac.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/secret.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/storageclass.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/values.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/Chart.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/README.md delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/_helpers.tpl delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/daemonset.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/secret.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/service-sm.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml delete mode 100644 helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/values.yaml diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/.helmignore b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/.helmignore deleted file mode 100644 index 50af0317..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/Chart.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/Chart.yaml deleted file mode 100644 index 59bbe612..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -appVersion: v1.24.6 -description: Cinder CSI Chart for OpenStack -name: openstack-cinder-csi -version: 2.2.0 -home: https://github.com/kubernetes/cloud-provider-openstack -icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png -maintainers: - - name: brtknr - email: brtknr@bath.edu diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/README.md b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/README.md deleted file mode 100644 index c90dfcf1..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Cinder CSI volume provisioner - -Deploys a Cinder csi provisioner to your cluster, with the appropriate storageClass. - -## How To install -- Enable deployment of storageclasses using `storageClass.enabled` -- Tag the retain or delete class as default class using `storageClass.delete.isDefault` in your value yaml -- Set `storageClass..allowVolumeExpansion` to `true` or `false` - -First add the repo: - - helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack - helm repo update - -If you are using Helm v3: - - helm install cinder-csi cpo/openstack-cinder-csi - -If you are using Helm v2: - - helm install --name cinder-csi cpo/openstack-cinder-csi diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/NOTES.txt b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/NOTES.txt deleted file mode 100644 index 2ed02ae6..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ -Use the following storageClass csi-cinder-sc-retain and csi-cinder-sc-delete only for RWO volumes. \ No newline at end of file diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/_helpers.tpl b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/_helpers.tpl deleted file mode 100644 index a40643c2..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/_helpers.tpl +++ /dev/null @@ -1,103 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "cinder-csi.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "cinder-csi.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "cinder-csi.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "cinder-csi.labels" -}} -app.kubernetes.io/name: {{ include "cinder-csi.name" . }} -helm.sh/chart: {{ include "cinder-csi.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - - -{{/* -Create the name of the service account to use -*/}} -{{- define "cinder-csi.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "cinder-csi.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Create unified labels for cinder-csi components -*/}} -{{- define "cinder-csi.common.matchLabels" -}} -app: {{ template "cinder-csi.name" . }} -release: {{ .Release.Name }} -{{- end -}} - -{{- define "cinder-csi.common.metaLabels" -}} -chart: {{ template "cinder-csi.chart" . }} -heritage: {{ .Release.Service }} -{{- if .Values.extraLabels }} -{{ toYaml .Values.extraLabels -}} -{{- end }} -{{- end -}} - -{{- define "cinder-csi.controllerplugin.matchLabels" -}} -component: controllerplugin -{{ include "cinder-csi.common.matchLabels" . }} -{{- end -}} - -{{- define "cinder-csi.controllerplugin.labels" -}} -{{ include "cinder-csi.controllerplugin.matchLabels" . }} -{{ include "cinder-csi.common.metaLabels" . }} -{{- end -}} - -{{- define "cinder-csi.nodeplugin.matchLabels" -}} -component: nodeplugin -{{ include "cinder-csi.common.matchLabels" . }} -{{- end -}} - -{{- define "cinder-csi.nodeplugin.labels" -}} -{{ include "cinder-csi.nodeplugin.matchLabels" . }} -{{ include "cinder-csi.common.metaLabels" . }} -{{- end -}} - -{{- define "cinder-csi.snapshot-controller.matchLabels" -}} -component: snapshot-controller -{{ include "cinder-csi.common.matchLabels" . }} -{{- end -}} - -{{- define "cinder-csi.snapshot-controller.labels" -}} -{{ include "cinder-csi.snapshot-controller.matchLabels" . }} -{{ include "cinder-csi.common.metaLabels" . }} -{{- end -}} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/cinder-csi-driver.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/cinder-csi-driver.yaml deleted file mode 100644 index 5b681e4c..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/cinder-csi-driver.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: CSIDriver -metadata: - name: cinder.csi.openstack.org -spec: - attachRequired: true - podInfoOnMount: true - volumeLifecycleModes: - - Persistent - - Ephemeral diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-deployment.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-deployment.yaml deleted file mode 100644 index 63a51add..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-deployment.yaml +++ /dev/null @@ -1,155 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: {{ include "cinder-csi.name" . }}-controllerplugin - namespace: {{ .Release.Namespace }} - labels: - {{- include "cinder-csi.controllerplugin.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.csi.plugin.controllerPlugin.replicas }} - strategy: - type: {{ .Values.csi.plugin.controllerPlugin.strategy.type }} -{{- if eq .Values.csi.plugin.controllerPlugin.strategy.type "RollingUpdate" }} - rollingUpdate: - maxUnavailable: {{ .Values.csi.plugin.controllerPlugin.strategy.rollingUpdate.maxUnavailable }} - maxSurge: {{ .Values.csi.plugin.controllerPlugin.strategy.rollingUpdate.maxSurge }} -{{- end }} - selector: - matchLabels: - {{- include "cinder-csi.controllerplugin.matchLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "cinder-csi.controllerplugin.labels" . | nindent 8 }} - spec: - serviceAccount: csi-cinder-controller-sa - containers: - - name: csi-attacher - image: "{{ .Values.csi.attacher.image.repository }}:{{ .Values.csi.attacher.image.tag }}" - imagePullPolicy: {{ .Values.csi.attacher.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - - "--timeout={{ .Values.timeout }}" - - "--leader-election=true" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - resources: {{ toYaml .Values.csi.attacher.resources | nindent 12 }} - - name: csi-provisioner - image: "{{ .Values.csi.provisioner.image.repository }}:{{ .Values.csi.provisioner.image.tag }}" - imagePullPolicy: {{ .Values.csi.provisioner.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - - "--timeout={{ .Values.timeout }}" - - "--leader-election=true" - - "--default-fstype=ext4" - - "--feature-gates=Topology={{ .Values.csi.provisioner.topology }}" - - "--extra-create-metadata" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - resources: {{ toYaml .Values.csi.provisioner.resources | nindent 12 }} - - name: csi-snapshotter - image: "{{ .Values.csi.snapshotter.image.repository }}:{{ .Values.csi.snapshotter.image.tag }}" - imagePullPolicy: {{ .Values.csi.snapshotter.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - - "--timeout={{ .Values.timeout }}" - - "--leader-election=true" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - resources: {{ toYaml .Values.csi.snapshotter.resources | nindent 12 }} - - name: csi-resizer - image: "{{ .Values.csi.resizer.image.repository }}:{{ .Values.csi.resizer.image.tag }}" - imagePullPolicy: {{ .Values.csi.resizer.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - - "--timeout={{ .Values.timeout }}" - - "--handle-volume-inuse-error=false" - - "--leader-election=true" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - resources: {{ toYaml .Values.csi.resizer.resources | nindent 12 }} - - name: liveness-probe - image: "{{ .Values.csi.livenessprobe.image.repository }}:{{ .Values.csi.livenessprobe.image.tag }}" - imagePullPolicy: {{ .Values.csi.livenessprobe.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - resources: {{ toYaml .Values.csi.livenessprobe.resources | nindent 12 }} - - name: cinder-csi-plugin - image: "{{ .Values.csi.plugin.image.repository }}:{{ .Values.csi.plugin.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.csi.plugin.image.pullPolicy }} - args: - - /bin/cinder-csi-plugin - - "-v={{ .Values.logVerbosityLevel }}" - - "--endpoint=$(CSI_ENDPOINT)" - - "--cloud-config=$(CLOUD_CONFIG)" - - "--cluster=$(CLUSTER_NAME)" - env: - - name: CSI_ENDPOINT - value: unix://csi/csi.sock - - name: CLOUD_CONFIG - value: /etc/kubernetes/{{ .Values.secret.filename }} - - name: CLUSTER_NAME - value: "{{ .Values.clusterID }}" - ports: - - containerPort: 9808 - name: healthz - protocol: TCP - # The probe - livenessProbe: - failureThreshold: {{ .Values.csi.livenessprobe.failureThreshold }} - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: {{ .Values.csi.livenessprobe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.csi.livenessprobe.timeoutSeconds }} - periodSeconds: {{ .Values.csi.livenessprobe.periodSeconds }} - volumeMounts: - - name: socket-dir - mountPath: /csi - {{- .Values.csi.plugin.volumeMounts | toYaml | trimSuffix "\n" | nindent 12 }} - resources: {{ toYaml .Values.csi.plugin.resources | nindent 12 }} - volumes: - - name: socket-dir - emptyDir: - - name: cloud-config - {{- if .Values.secret.enabled }} - secret: - secretName: {{ .Values.secret.name }} - {{- else }} - hostPath: - path: /etc/kubernetes - {{- end }} - {{ .Values.csi.plugin.volumes | toYaml | trimSuffix "\n" | nindent 8 }} - affinity: {{ toYaml .Values.csi.plugin.controllerPlugin.affinity | nindent 8 }} - nodeSelector: {{ toYaml .Values.csi.plugin.controllerPlugin.nodeSelector | nindent 8 }} - tolerations: {{ toYaml .Values.csi.plugin.controllerPlugin.tolerations | nindent 8 }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName }} - {{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-rbac.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-rbac.yaml deleted file mode 100644 index e8d7a909..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/controllerplugin-rbac.yaml +++ /dev/null @@ -1,174 +0,0 @@ -# This YAML file contains RBAC API objects, -# which are necessary to run csi controller plugin - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: csi-cinder-controller-sa - namespace: {{ .Release.Namespace }} ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-attacher-role -rules: - - apiGroups: [""] - resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["csinodes"] - verbs: ["get", "list", "watch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["storage.k8s.io"] - resources: ["volumeattachments/status"] - verbs: ["patch"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["get", "watch", "list", "delete", "update", "create"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-attacher-binding -subjects: - - kind: ServiceAccount - name: csi-cinder-controller-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: csi-attacher-role - apiGroup: rbac.authorization.k8s.io ---- -# external Provisioner -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-provisioner-role -rules: - - apiGroups: [""] - resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete"] - - apiGroups: [""] - resources: ["persistentvolumeclaims"] - verbs: ["get", "list", "watch", "update"] - - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses"] - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: ["nodes"] - verbs: ["get", "list", "watch"] - - apiGroups: ["storage.k8s.io"] - resources: ["csinodes"] - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: ["events"] - verbs: ["list", "watch", "create", "update", "patch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots"] - verbs: ["get", "list"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents"] - verbs: ["get", "list"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["get", "watch", "list", "delete", "update", "create"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-provisioner-binding -subjects: - - kind: ServiceAccount - name: csi-cinder-controller-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: csi-provisioner-role - apiGroup: rbac.authorization.k8s.io - ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-snapshotter-role -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"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents"] - verbs: ["create", "get", "list", "watch", "update", "delete", "patch"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshotcontents/status"] - verbs: ["update", "patch"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["get", "watch", "list", "delete", "update", "create"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-snapshotter-binding -subjects: - - kind: ServiceAccount - name: csi-cinder-controller-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: csi-snapshotter-role - apiGroup: rbac.authorization.k8s.io ---- -kind: ClusterRole -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"] - - apiGroups: [""] - resources: ["persistentvolumeclaims"] - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: ["pods"] - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: ["persistentvolumeclaims/status"] - verbs: ["patch"] - - apiGroups: [""] - resources: ["events"] - verbs: ["list", "watch", "create", "update", "patch"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["get", "watch", "list", "delete", "update", "create"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-resizer-binding -subjects: - - kind: ServiceAccount - name: csi-cinder-controller-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: csi-resizer-role - apiGroup: rbac.authorization.k8s.io ---- diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/custom_storageclass.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/custom_storageclass.yaml deleted file mode 100644 index 267c731a..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/custom_storageclass.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- if .Values.storageClass.custom -}} -{{ .Values.storageClass.custom }} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-daemonset.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-daemonset.yaml deleted file mode 100644 index 6bf2b30f..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-daemonset.yaml +++ /dev/null @@ -1,129 +0,0 @@ -kind: DaemonSet -apiVersion: apps/v1 -metadata: - name: {{ include "cinder-csi.name" . }}-nodeplugin - namespace: {{ .Release.Namespace }} - labels: - {{- include "cinder-csi.nodeplugin.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - {{- include "cinder-csi.nodeplugin.matchLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "cinder-csi.nodeplugin.labels" . | nindent 8 }} - spec: - serviceAccount: csi-cinder-node-sa - hostNetwork: true - containers: - - name: node-driver-registrar - image: "{{ .Values.csi.nodeDriverRegistrar.image.repository }}:{{ .Values.csi.nodeDriverRegistrar.image.tag }}" - imagePullPolicy: {{ .Values.csi.nodeDriverRegistrar.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - "--csi-address=$(ADDRESS)" - - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" - env: - - name: ADDRESS - value: /csi/csi.sock - - name: DRIVER_REG_SOCK_PATH - value: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins/cinder.csi.openstack.org/csi.sock - - name: KUBE_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - name: socket-dir - mountPath: /csi - - name: registration-dir - mountPath: /registration - resources: {{ toYaml .Values.csi.nodeDriverRegistrar.resources | nindent 12 }} - - name: liveness-probe - image: "{{ .Values.csi.livenessprobe.image.repository }}:{{ .Values.csi.livenessprobe.image.tag }}" - imagePullPolicy: {{ .Values.csi.livenessprobe.image.pullPolicy }} - args: - - "-v={{ .Values.logVerbosityLevel }}" - - --csi-address=/csi/csi.sock - volumeMounts: - - name: socket-dir - mountPath: /csi - resources: {{ toYaml .Values.csi.livenessprobe.resources | nindent 12 }} - - name: cinder-csi-plugin - securityContext: - privileged: true - capabilities: - add: ["SYS_ADMIN"] - allowPrivilegeEscalation: true - image: "{{ .Values.csi.plugin.image.repository }}:{{ .Values.csi.plugin.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.csi.plugin.image.pullPolicy }} - args: - - /bin/cinder-csi-plugin - - "-v={{ .Values.logVerbosityLevel }}" - - "--endpoint=$(CSI_ENDPOINT)" - - "--cloud-config=$(CLOUD_CONFIG)" - env: - - name: CSI_ENDPOINT - value: unix://csi/csi.sock - - name: CLOUD_CONFIG - value: /etc/kubernetes/{{ .Values.secret.filename }} - ports: - - containerPort: 9808 - name: healthz - protocol: TCP - # The probe - livenessProbe: - failureThreshold: {{ .Values.csi.livenessprobe.failureThreshold }} - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: {{ .Values.csi.livenessprobe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.csi.livenessprobe.timeoutSeconds }} - periodSeconds: {{ .Values.csi.livenessprobe.periodSeconds }} - volumeMounts: - - name: socket-dir - mountPath: /csi - - name: kubelet-dir - mountPath: {{ .Values.csi.plugin.nodePlugin.kubeletDir }} - mountPropagation: "Bidirectional" - - name: pods-probe-dir - mountPath: /dev - mountPropagation: "HostToContainer" - {{- .Values.csi.plugin.volumeMounts | toYaml | trimSuffix "\n" | nindent 12 }} - resources: {{ toYaml .Values.csi.plugin.resources | nindent 12 }} - volumes: - - name: socket-dir - hostPath: - path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins/cinder.csi.openstack.org - type: DirectoryOrCreate - - name: registration-dir - hostPath: - path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins_registry/ - type: Directory - - name: kubelet-dir - hostPath: - path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }} - type: Directory - # - name: pods-cloud-data - # hostPath: - # path: /var/lib/cloud/data - # type: Directory - - name: pods-probe-dir - hostPath: - path: /dev - type: Directory - - name: cloud-config - {{- if .Values.secret.enabled }} - secret: - secretName: {{ .Values.secret.name }} - {{- else }} - hostPath: - path: /etc/kubernetes - {{- end }} - {{ .Values.csi.plugin.volumes | toYaml | trimSuffix "\n" | nindent 8 }} - affinity: {{ toYaml .Values.csi.plugin.nodePlugin.affinity | nindent 8 }} - nodeSelector: {{ toYaml .Values.csi.plugin.nodePlugin.nodeSelector | nindent 8 }} - tolerations: {{ toYaml .Values.csi.plugin.nodePlugin.tolerations | nindent 8 }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName }} - {{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-rbac.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-rbac.yaml deleted file mode 100644 index 894a8df2..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/nodeplugin-rbac.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: csi-cinder-node-sa - namespace: {{ .Release.Namespace }} ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-nodeplugin-role -rules: - - apiGroups: [""] - resources: ["events"] - verbs: ["get", "list", "watch", "create", "update", "patch"] - ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: csi-nodeplugin-binding -subjects: - - kind: ServiceAccount - name: csi-cinder-node-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: csi-nodeplugin-role - apiGroup: rbac.authorization.k8s.io diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/secret.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/secret.yaml deleted file mode 100644 index b11ef856..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{{- if .Values.secret.create }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Values.secret.name }} - namespace: {{ .Release.Namespace }} -type: Opaque -stringData: - {{ .Values.secret.data | toYaml | trimSuffix "\n" | nindent 2 }} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/storageclass.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/storageclass.yaml deleted file mode 100644 index 704c3003..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/templates/storageclass.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{- if .Values.storageClass.enabled }} -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: csi-cinder-sc-delete - {{- if .Values.storageClass.delete.isDefault }} - annotations: - storageclass.kubernetes.io/is-default-class: "true" - {{- end }} -provisioner: cinder.csi.openstack.org -reclaimPolicy: Delete -allowVolumeExpansion: {{ .Values.storageClass.delete.allowVolumeExpansion }} ---- -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: csi-cinder-sc-retain - {{- if .Values.storageClass.retain.isDefault }} - annotations: - storageclass.kubernetes.io/is-default-class: "true" - {{- end }} -provisioner: cinder.csi.openstack.org -reclaimPolicy: Retain -allowVolumeExpansion: {{ .Values.storageClass.retain.allowVolumeExpansion }} -{{- end }} \ No newline at end of file diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/values.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/values.yaml deleted file mode 100644 index 0e95decf..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/values.yaml +++ /dev/null @@ -1,150 +0,0 @@ -extraLabels: {} - -nameOverride: "" -fullnameOverride: "" -timeout: 3m - -csi: - attacher: - image: - repository: k8s.gcr.io/sig-storage/csi-attacher - tag: v3.4.0 - pullPolicy: IfNotPresent - resources: {} - provisioner: - topology: "true" - image: - repository: k8s.gcr.io/sig-storage/csi-provisioner - tag: v3.1.0 - pullPolicy: IfNotPresent - resources: {} - snapshotter: - image: - repository: k8s.gcr.io/sig-storage/csi-snapshotter - tag: v5.0.1 - pullPolicy: IfNotPresent - resources: {} - resizer: - image: - repository: k8s.gcr.io/sig-storage/csi-resizer - tag: v1.4.0 - pullPolicy: IfNotPresent - resources: {} - livenessprobe: - image: - repository: k8s.gcr.io/sig-storage/livenessprobe - tag: v2.6.0 - pullPolicy: IfNotPresent - failureThreshold: 5 - initialDelaySeconds: 10 - timeoutSeconds: 10 - periodSeconds: 60 - resources: {} - nodeDriverRegistrar: - image: - repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar - tag: v2.5.0 - pullPolicy: IfNotPresent - resources: {} - plugin: - image: - repository: docker.io/k8scloudprovider/cinder-csi-plugin - pullPolicy: IfNotPresent - tag: # defaults to .Chart.AppVersion - volumes: - - name: cacert - hostPath: - path: /etc/cacert - volumeMounts: - - name: cacert - mountPath: /etc/cacert - readOnly: true - - name: cloud-config - mountPath: /etc/kubernetes - readOnly: true - nodePlugin: - affinity: {} - nodeSelector: {} - tolerations: - - operator: Exists - kubeletDir: /var/lib/kubelet - controllerPlugin: - replicas: 1 - strategy: - # RollingUpdate strategy replaces old pods with new ones gradually, - # without incurring downtime. - type: RollingUpdate - rollingUpdate: - # maxUnavailable is the maximum number of pods that can be - # unavailable during the update process. - maxUnavailable: 0 - # maxSurge is the maximum number of pods that can be - # created over the desired number of pods. - maxSurge: 1 - affinity: {} - nodeSelector: {} - tolerations: [] - resources: {} - snapshotController: - enabled: false - image: - repository: k8s.gcr.io/sig-storage/snapshot-controller - tag: v5.0.1 - resources: {} - affinity: {} - nodeSelector: {} - tolerations: [] - -# Log verbosity level. -# See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md -# for description of individual verbosity levels. -logVerbosityLevel: 2 - -secret: - enabled: false - create: false - filename: cloud.conf -# name: cinder-csi-cloud-config -# data: -# cloud.conf: |- -# [Global] -# auth-url=http://openstack-control-plane -# user-id=user-id -# password=password -# trust-id=trust-id -# region=RegionOne -# ca-file=/etc/cacert/ca-bundle.crt - -storageClass: - enabled: true - delete: - isDefault: false - allowVolumeExpansion: true - retain: - isDefault: false - allowVolumeExpansion: true -# any kind of custom StorageClasses -# custom: |- -# --- -# apiVersion: snapshot.storage.k8s.io/v1beta1 -# kind: VolumeSnapshotClass -# metadata: -# name: csi-cinder-snapclass -# driver: cinder.csi.openstack.org -# deletionPolicy: Delete -# --- -# apiVersion: storage.k8s.io/v1 -# kind: StorageClass -# metadata: -# name: sas -# provisioner: cinder.csi.openstack.org -# volumeBindingMode: WaitForFirstConsumer -# allowVolumeExpansion: true -# parameters: -# type: SAS - -# You may set ID of the cluster where openstack-cinder-csi is deployed. This value will be appended -# to volume metadata in newly provisioned volumes as `cinder.csi.openstack.org/cluster=`. -clusterID: "kubernetes" - -priorityClassName: "" diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/Chart.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/Chart.yaml deleted file mode 100644 index 7eeb15a1..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/Chart.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -appVersion: v1.24.6 -description: Openstack Cloud Controller Manager Helm Chart -icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png -home: https://github.com/kubernetes/cloud-provider-openstack -name: openstack-cloud-controller-manager -version: 1.3.0 -maintainers: - - name: morremeyer - email: kubernetes@maurice-meyer.de - url: https://maurice-meyer.de - - name: eumel8 - email: f.kloeker@telekom.de - url: https://www.telekom.com diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/README.md b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/README.md deleted file mode 100644 index 25fb4a91..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# openstack-cloud-controller-manager - -Deploys the OpenStack Cloud Controller Manager to your cluster. - -Default configuration values are the same as the CCM itself. - -## How To install - -You need to configure an `openstack-ccm.yaml` values file with at least: - -- `cloudConfig.global.auth-url` with the Keystone URL -- Authentication - - with password: `cloudConfig.global.username` and `cloudconfig.global.password` - - with application credentials: (`cloudConfig.global.application-credential-id` or `cloudConfig.global.application-credential-name`) and `cloudConfig.global.application-credential-secret` -- Load balancing - - `cloudConfig.loadbalancer.floating-network-id` **or** - - `cloudConfig.loadbalancer.floating-subnet-id` **or** - - `cloudConfig.loadbalancer.floating-subnet` - -If you want to enable health checks for your Load Balancers (optional), set `cloudConfig.loadbalancer.create-monitor: true`. - -Then run: - -``` -helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack -helm repo update -helm install openstack-ccm cpo/openstack-cloud-controller-manager --values openstack-ccm.yaml -``` - -## Unsupported configurations - -- The chart does not support the mounting of custom `clouds.yaml` files. Therefore, the following config values in the `[Global]` section won’t have any effect: - - `use-clouds` - - `clouds-file` - - `cloud` diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/_helpers.tpl b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/_helpers.tpl deleted file mode 100644 index 098dc0b3..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/_helpers.tpl +++ /dev/null @@ -1,84 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "occm.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "occm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels and app labels -*/}} -{{- define "occm.labels" -}} -app.kubernetes.io/name: {{ include "occm.name" . }} -helm.sh/chart: {{ include "occm.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{- define "occm.common.matchLabels" -}} -app: {{ template "occm.name" . }} -release: {{ .Release.Name }} -{{- end -}} - -{{- define "occm.common.metaLabels" -}} -chart: {{ template "occm.chart" . }} -heritage: {{ .Release.Service }} -{{- end -}} - -{{- define "occm.controllermanager.matchLabels" -}} -component: controllermanager -{{ include "occm.common.matchLabels" . }} -{{- end -}} - -{{- define "occm.controllermanager.labels" -}} -{{ include "occm.controllermanager.matchLabels" . }} -{{ include "occm.common.metaLabels" . }} -{{- end -}} - -{{/* -Create cloud-config makro. -*/}} -{{- define "cloudConfig" -}} -[Global] -{{- range $key, $value := .Values.cloudConfig.global }} -{{ $key }} = {{ $value | quote }} -{{- end }} - -[Networking] -{{- range $key, $value := .Values.cloudConfig.networking }} -{{ $key }} = {{ $value | quote }} -{{- end }} - -[LoadBalancer] -{{- range $key, $value := .Values.cloudConfig.loadBalancer }} -{{ $key }} = {{ $value | quote }} -{{- end }} - -[BlockStorage] -{{- range $key, $value := .Values.cloudConfig.blockStorage }} -{{ $key }} = {{ $value | quote }} -{{- end }} - -[Metadata] -{{- range $key, $value := .Values.cloudConfig.metadata }} -{{ $key }} = {{ $value | quote }} -{{- end }} -{{- end }} - - -{{/* -Generate string of enabled controllers. Might have a trailing comma (,) which needs to be trimmed. -*/}} -{{- define "occm.enabledControllers" }} -{{- range .Values.enabledControllers -}}{{ . }},{{- end -}} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml deleted file mode 100644 index cb0a8e90..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: system:openstack-cloud-controller-manager -rules: -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - create - - update -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - update -- apiGroups: - - "" - resources: - - nodes - verbs: - - '*' -- apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch -- apiGroups: - - "" - resources: - - services - verbs: - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - services/status - verbs: - - patch -- apiGroups: - - "" - resources: - - serviceaccounts/token - verbs: - - create -- apiGroups: - - "" - resources: - - serviceaccounts - verbs: - - create - - get -- apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - '*' -- apiGroups: - - "" - resources: - - endpoints - verbs: - - create - - get - - list - - watch - - update -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - secrets - verbs: - - list - - get - - watch diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml deleted file mode 100644 index 0d0362c2..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.serviceMonitor.enabled }} -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: system:{{ include "occm.name" . }}:auth-delegate -subjects: -- kind: User - name: system:serviceaccount:{{ .Release.Namespace }}:{{ include "occm.name" . }} - apiGroup: rbac.authorization.k8s.io -roleRef: - kind: ClusterRole - name: system:auth-delegator - apiGroup: rbac.authorization.k8s.io -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml deleted file mode 100644 index 666e7365..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: system:openstack-cloud-controller-manager -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:openstack-cloud-controller-manager -subjects: -- kind: ServiceAccount - name: openstack-cloud-controller-manager - namespace: {{ .Release.Namespace | quote }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/daemonset.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/daemonset.yaml deleted file mode 100644 index d88ca134..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/daemonset.yaml +++ /dev/null @@ -1,95 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: {{ include "occm.name" . }} - labels: - {{- include "occm.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - {{- include "occm.controllermanager.matchLabels" . | nindent 6 }} - updateStrategy: - type: RollingUpdate - template: - metadata: - annotations: - checksum/config: {{ include "cloudConfig" . | sha256sum }} - labels: - {{- include "occm.controllermanager.labels" . | nindent 8 }} - spec: - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: openstack-cloud-controller-manager - containers: - - name: openstack-cloud-controller-manager - image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" - args: - - /bin/openstack-cloud-controller-manager - - --v={{ .Values.logVerbosityLevel }} - - --cloud-config=$(CLOUD_CONFIG) - - --cluster-name=$(CLUSTER_NAME) - - --cloud-provider=openstack - - --use-service-account-credentials=true - - --controllers={{- trimAll "," (include "occm.enabledControllers" . ) -}} - {{- if .Values.serviceMonitor.enabled }} - - --bind-address=0.0.0.0 - {{- else }} - - --bind-address=127.0.0.1 - {{- end }} - {{- if .Values.controllerExtraArgs }} - {{- with .Values.controllerExtraArgs }} - {{- tpl . $ | trim | nindent 12 }} - {{- end }} - {{- end }} - {{- if .Values.serviceMonitor.enabled }} - ports: - - containerPort: 10258 - hostPort: 10258 - name: http - protocol: TCP - {{- end }} - volumeMounts: - - mountPath: /etc/config - name: cloud-config-volume - readOnly: true - {{- if .Values.extraVolumeMounts }} - {{- toYaml .Values.extraVolumeMounts | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe }} - livenessProbe: - {{- toYaml .Values.livenessProbe | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe }} - readinessProbe: - {{- toYaml .Values.readinessProbe | nindent 12 }} - {{- end }} - {{- if .Values.resources }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - env: - - name: CLOUD_CONFIG - value: /etc/config/cloud.conf - - name: CLUSTER_NAME - value: {{ .Values.cluster.name }} - {{- if .Values.extraInitContainers }} - initContainers: {{ toYaml .Values.extraInitContainers | nindent 6 }} - {{- end }} - hostNetwork: true - volumes: - - name: cloud-config-volume - secret: - secretName: {{ .Values.secret.name }} - {{- if .Values.extraVolumes }} - {{ toYaml .Values.extraVolumes | nindent 6 }} - {{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/secret.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/secret.yaml deleted file mode 100644 index afe517dd..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -{{- if .Values.secret.create }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Values.secret.name | default "cloud-config" }} -type: Opaque -data: - cloud.conf: {{ include "cloudConfig" . | b64enc }} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/service-sm.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/service-sm.yaml deleted file mode 100644 index 0dbcf0e9..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/service-sm.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.serviceMonitor.enabled }} -apiVersion: v1 -kind: Service -metadata: - labels: - {{- include "occm.labels" . | nindent 4 }} - name: {{ include "occm.name" . }} -spec: - ports: - - name: http - port: 10258 - protocol: TCP - selector: - {{- include "occm.controllermanager.matchLabels" . | nindent 4 }} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml deleted file mode 100644 index ce80e2ed..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: openstack-cloud-controller-manager diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml deleted file mode 100644 index e9ebaa6e..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - {{- include "occm.labels" . | nindent 4 }} - name: {{ include "occm.name" . }} -spec: - endpoints: - - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - interval: 30s - port: http - scheme: https - tlsConfig: - insecureSkipVerify: true - jobLabel: component - selector: - matchLabels: - {{- include "occm.controllermanager.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/values.yaml b/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/values.yaml deleted file mode 100644 index b48d7f0e..00000000 --- a/helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/values.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Values OpenStack Cloud Controller Manager Helm Chart -# -# Define deployment mode for the controller and provide cloud credentials in cloudConfig at the end of the file -# -# Image repository name and tag -image: - repository: docker.io/k8scloudprovider/openstack-cloud-controller-manager - tag: "" - -# Additional containers which are run before the app containers are started. -extraInitContainers: [] -# - name: wait -# image: busybox -# command: ['sh', '-c', 'echo waiting for 10 seconds; sleep 10;'] - -# Set resources for Kubernetes daemonset -resources: {} -# resources: -# requests: -# cpu: 200m - -# Set livenessProbe for Kubernetes daemonset. Used the same port for servicemonitor metrics -livenessProbe: {} -# livenessProbe: -# httpGet: -# path: /metrics -# port: 10258 - -# Set readinessProbe in the same way like livenessProbe -readinessProbe: {} - -# Set nodeSelector where the controller shut run, i.e. controlplane nodes -nodeSelector: [] -# nodeSelector: -# node-role.kubernetes.io/controlplane: "true" - -# Set tolerations for nodes where the controller should run, i.e. node should uninitialized, controlplane... -tolerations: [] -# tolerations: -# - key: node.cloudprovider.kubernetes.io/uninitialized -# value: "true" -# effect: NoSchedule -# - key: node-role.kubernetes.io/controlplane -# value: "true" -# effect: NoSchedule -# - key: node-role.kubernetes.io/etcd -# value: "true" -# effect: NoExecute - -# Set security settings for the controller pods -# For all available options, see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#podsecuritycontext-v1-core -podSecurityContext: - runAsUser: 1001 - -# List of controllers should be enabled. -# Use '*' to enable all controllers. -# Prefix a controller with '-' to disable it. -enabledControllers: - - cloud-node - - cloud-node-lifecycle - - route - - service - -# Any extra arguments for openstack-cloud-controller-manager -controllerExtraArgs: {} -# controllerExtraArgs: |- -# - --cluster-name=my-cluster - -# Create a service monitor for Prometheus Operator -serviceMonitor: {} -# serviceMonitor: -# enabled: true - -# Create a secret resource cloud-config (or other name) to store credentials and settings from cloudConfig -# You can also provide your own secret (not created by the Helm chart), in this case set create to false -# and adjust the name of the secret as necessary -secret: - create: true - name: cloud-config - -# Log verbosity level. -# See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md -# for description of individual verbosity levels. -logVerbosityLevel: 2 - -# Specify settings with the same key as the CCM config: https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md#config-openstack-cloud-controller-manager -cloudConfig: - global: - networking: - loadBalancer: - blockStorage: - metadata: - -# The following three volumes are required to use all OCCM controllers, -# but might not be needed if you just use a specific controller -# Additional volumes that should be available to the pods: -extraVolumes: - - name: flexvolume-dir - hostPath: - path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec - - name: k8s-certs - hostPath: - path: /etc/kubernetes/pki -# Where the additional volumes should be mounted into the pods: -extraVolumeMounts: - - name: flexvolume-dir - mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec - readOnly: true - - name: k8s-certs - mountPath: /etc/kubernetes/pki - readOnly: true - -# cluster name that used for created cluster -cluster: - name: kubernetes From 6c0a27d0cc6e4bf0d650bf31a39ccbf67281cbbf Mon Sep 17 00:00:00 2001 From: Jun Eeo Date: Wed, 26 Apr 2023 19:03:38 +0100 Subject: [PATCH 2/5] Squashed 'helm/cloud-provider-openstack-app/charts/openstack-cinder-csi/' content from commit 7718e23c git-subtree-dir: helm/cloud-provider-openstack-app/charts/openstack-cinder-csi git-subtree-split: 7718e23c1e3dec2a96df676961856bacef4ee957 --- .helmignore | 22 +++ Chart.yaml | 10 ++ README.md | 21 +++ templates/NOTES.txt | 1 + templates/_helpers.tpl | 103 +++++++++++ templates/cinder-csi-driver.yaml | 10 ++ templates/controllerplugin-deployment.yaml | 190 +++++++++++++++++++++ templates/controllerplugin-rbac.yaml | 174 +++++++++++++++++++ templates/custom_storageclass.yaml | 3 + templates/nodeplugin-daemonset.yaml | 148 ++++++++++++++++ templates/nodeplugin-rbac.yaml | 28 +++ templates/secret.yaml | 10 ++ templates/storageclass.yaml | 25 +++ values.yaml | 151 ++++++++++++++++ 14 files changed, 896 insertions(+) create mode 100644 .helmignore create mode 100644 Chart.yaml create mode 100644 README.md create mode 100644 templates/NOTES.txt create mode 100644 templates/_helpers.tpl create mode 100644 templates/cinder-csi-driver.yaml create mode 100644 templates/controllerplugin-deployment.yaml create mode 100644 templates/controllerplugin-rbac.yaml create mode 100644 templates/custom_storageclass.yaml create mode 100644 templates/nodeplugin-daemonset.yaml create mode 100644 templates/nodeplugin-rbac.yaml create mode 100644 templates/secret.yaml create mode 100644 templates/storageclass.yaml create mode 100644 values.yaml diff --git a/.helmignore b/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 00000000..879beb86 --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +appVersion: v1.27.1 +description: Cinder CSI Chart for OpenStack +name: openstack-cinder-csi +version: 2.27.1 +home: https://github.com/kubernetes/cloud-provider-openstack +icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png +maintainers: + - name: brtknr + email: brtknr@bath.edu diff --git a/README.md b/README.md new file mode 100644 index 00000000..c90dfcf1 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Cinder CSI volume provisioner + +Deploys a Cinder csi provisioner to your cluster, with the appropriate storageClass. + +## How To install +- Enable deployment of storageclasses using `storageClass.enabled` +- Tag the retain or delete class as default class using `storageClass.delete.isDefault` in your value yaml +- Set `storageClass..allowVolumeExpansion` to `true` or `false` + +First add the repo: + + helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack + helm repo update + +If you are using Helm v3: + + helm install cinder-csi cpo/openstack-cinder-csi + +If you are using Helm v2: + + helm install --name cinder-csi cpo/openstack-cinder-csi diff --git a/templates/NOTES.txt b/templates/NOTES.txt new file mode 100644 index 00000000..2ed02ae6 --- /dev/null +++ b/templates/NOTES.txt @@ -0,0 +1 @@ +Use the following storageClass csi-cinder-sc-retain and csi-cinder-sc-delete only for RWO volumes. \ No newline at end of file diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl new file mode 100644 index 00000000..a40643c2 --- /dev/null +++ b/templates/_helpers.tpl @@ -0,0 +1,103 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "cinder-csi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "cinder-csi.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "cinder-csi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "cinder-csi.labels" -}} +app.kubernetes.io/name: {{ include "cinder-csi.name" . }} +helm.sh/chart: {{ include "cinder-csi.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + + +{{/* +Create the name of the service account to use +*/}} +{{- define "cinder-csi.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "cinder-csi.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create unified labels for cinder-csi components +*/}} +{{- define "cinder-csi.common.matchLabels" -}} +app: {{ template "cinder-csi.name" . }} +release: {{ .Release.Name }} +{{- end -}} + +{{- define "cinder-csi.common.metaLabels" -}} +chart: {{ template "cinder-csi.chart" . }} +heritage: {{ .Release.Service }} +{{- if .Values.extraLabels }} +{{ toYaml .Values.extraLabels -}} +{{- end }} +{{- end -}} + +{{- define "cinder-csi.controllerplugin.matchLabels" -}} +component: controllerplugin +{{ include "cinder-csi.common.matchLabels" . }} +{{- end -}} + +{{- define "cinder-csi.controllerplugin.labels" -}} +{{ include "cinder-csi.controllerplugin.matchLabels" . }} +{{ include "cinder-csi.common.metaLabels" . }} +{{- end -}} + +{{- define "cinder-csi.nodeplugin.matchLabels" -}} +component: nodeplugin +{{ include "cinder-csi.common.matchLabels" . }} +{{- end -}} + +{{- define "cinder-csi.nodeplugin.labels" -}} +{{ include "cinder-csi.nodeplugin.matchLabels" . }} +{{ include "cinder-csi.common.metaLabels" . }} +{{- end -}} + +{{- define "cinder-csi.snapshot-controller.matchLabels" -}} +component: snapshot-controller +{{ include "cinder-csi.common.matchLabels" . }} +{{- end -}} + +{{- define "cinder-csi.snapshot-controller.labels" -}} +{{ include "cinder-csi.snapshot-controller.matchLabels" . }} +{{ include "cinder-csi.common.metaLabels" . }} +{{- end -}} diff --git a/templates/cinder-csi-driver.yaml b/templates/cinder-csi-driver.yaml new file mode 100644 index 00000000..5b681e4c --- /dev/null +++ b/templates/cinder-csi-driver.yaml @@ -0,0 +1,10 @@ +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + name: cinder.csi.openstack.org +spec: + attachRequired: true + podInfoOnMount: true + volumeLifecycleModes: + - Persistent + - Ephemeral diff --git a/templates/controllerplugin-deployment.yaml b/templates/controllerplugin-deployment.yaml new file mode 100644 index 00000000..4934320d --- /dev/null +++ b/templates/controllerplugin-deployment.yaml @@ -0,0 +1,190 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: {{ include "cinder-csi.name" . }}-controllerplugin + namespace: {{ .Release.Namespace }} + labels: + {{- include "cinder-csi.controllerplugin.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.csi.plugin.controllerPlugin.replicas }} + strategy: + type: {{ .Values.csi.plugin.controllerPlugin.strategy.type }} +{{- if eq .Values.csi.plugin.controllerPlugin.strategy.type "RollingUpdate" }} + rollingUpdate: + maxUnavailable: {{ .Values.csi.plugin.controllerPlugin.strategy.rollingUpdate.maxUnavailable }} + maxSurge: {{ .Values.csi.plugin.controllerPlugin.strategy.rollingUpdate.maxSurge }} +{{- end }} + selector: + matchLabels: + {{- include "cinder-csi.controllerplugin.matchLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "cinder-csi.controllerplugin.labels" . | nindent 8 }} + spec: + serviceAccount: csi-cinder-controller-sa + containers: + - name: csi-attacher + image: "{{ .Values.csi.attacher.image.repository }}:{{ .Values.csi.attacher.image.tag }}" + imagePullPolicy: {{ .Values.csi.attacher.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + - "--timeout={{ .Values.timeout }}" + - "--leader-election=true" + - "--default-fstype=ext4" + {{- if .Values.csi.attacher.extraArgs }} + {{- with .Values.csi.attacher.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + resources: {{ toYaml .Values.csi.attacher.resources | nindent 12 }} + - name: csi-provisioner + image: "{{ .Values.csi.provisioner.image.repository }}:{{ .Values.csi.provisioner.image.tag }}" + imagePullPolicy: {{ .Values.csi.provisioner.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + - "--timeout={{ .Values.timeout }}" + - "--leader-election=true" + - "--default-fstype=ext4" + - "--feature-gates=Topology={{ .Values.csi.provisioner.topology }}" + - "--extra-create-metadata" + {{- if .Values.csi.provisioner.extraArgs }} + {{- with .Values.csi.provisioner.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + resources: {{ toYaml .Values.csi.provisioner.resources | nindent 12 }} + - name: csi-snapshotter + image: "{{ .Values.csi.snapshotter.image.repository }}:{{ .Values.csi.snapshotter.image.tag }}" + imagePullPolicy: {{ .Values.csi.snapshotter.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + - "--timeout={{ .Values.timeout }}" + - "--leader-election=true" + {{- if .Values.csi.snapshotter.extraArgs }} + {{- with .Values.csi.snapshotter.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + volumeMounts: + - mountPath: /var/lib/csi/sockets/pluginproxy/ + name: socket-dir + resources: {{ toYaml .Values.csi.snapshotter.resources | nindent 12 }} + - name: csi-resizer + image: "{{ .Values.csi.resizer.image.repository }}:{{ .Values.csi.resizer.image.tag }}" + imagePullPolicy: {{ .Values.csi.resizer.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + - "--timeout={{ .Values.timeout }}" + - "--handle-volume-inuse-error=false" + - "--leader-election=true" + {{- if .Values.csi.resizer.extraArgs }} + {{- with .Values.csi.resizer.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + resources: {{ toYaml .Values.csi.resizer.resources | nindent 12 }} + - name: liveness-probe + image: "{{ .Values.csi.livenessprobe.image.repository }}:{{ .Values.csi.livenessprobe.image.tag }}" + imagePullPolicy: {{ .Values.csi.livenessprobe.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + {{- if .Values.csi.livenessprobe.extraArgs }} + {{- with .Values.csi.livenessprobe.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + volumeMounts: + - mountPath: /var/lib/csi/sockets/pluginproxy/ + name: socket-dir + resources: {{ toYaml .Values.csi.livenessprobe.resources | nindent 12 }} + - name: cinder-csi-plugin + image: "{{ .Values.csi.plugin.image.repository }}:{{ .Values.csi.plugin.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.csi.plugin.image.pullPolicy }} + args: + - /bin/cinder-csi-plugin + - "-v={{ .Values.logVerbosityLevel }}" + - "--endpoint=$(CSI_ENDPOINT)" + - "--cloud-config=$(CLOUD_CONFIG)" + - "--cluster=$(CLUSTER_NAME)" + {{- if .Values.csi.plugin.extraArgs }} + {{- with .Values.csi.plugin.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: CSI_ENDPOINT + value: unix://csi/csi.sock + - name: CLOUD_CONFIG + value: /etc/kubernetes/{{ .Values.secret.filename }} + - name: CLUSTER_NAME + value: "{{ .Values.clusterID }}" + ports: + - containerPort: 9808 + name: healthz + protocol: TCP + # The probe + livenessProbe: + failureThreshold: {{ .Values.csi.livenessprobe.failureThreshold }} + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: {{ .Values.csi.livenessprobe.initialDelaySeconds }} + timeoutSeconds: {{ .Values.csi.livenessprobe.timeoutSeconds }} + periodSeconds: {{ .Values.csi.livenessprobe.periodSeconds }} + volumeMounts: + - name: socket-dir + mountPath: /csi + {{- .Values.csi.plugin.volumeMounts | toYaml | trimSuffix "\n" | nindent 12 }} + resources: {{ toYaml .Values.csi.plugin.resources | nindent 12 }} + volumes: + - name: socket-dir + emptyDir: + - name: cloud-config + {{- if .Values.secret.enabled }} + secret: + secretName: {{ .Values.secret.name }} + {{- else }} + hostPath: + path: /etc/kubernetes + {{- end }} + {{ .Values.csi.plugin.volumes | toYaml | trimSuffix "\n" | nindent 8 }} + affinity: {{ toYaml .Values.csi.plugin.controllerPlugin.affinity | nindent 8 }} + nodeSelector: {{ toYaml .Values.csi.plugin.controllerPlugin.nodeSelector | nindent 8 }} + tolerations: {{ toYaml .Values.csi.plugin.controllerPlugin.tolerations | nindent 8 }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/templates/controllerplugin-rbac.yaml b/templates/controllerplugin-rbac.yaml new file mode 100644 index 00000000..e8d7a909 --- /dev/null +++ b/templates/controllerplugin-rbac.yaml @@ -0,0 +1,174 @@ +# This YAML file contains RBAC API objects, +# which are necessary to run csi controller plugin + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: csi-cinder-controller-sa + namespace: {{ .Release.Namespace }} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-attacher-role +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "patch"] + - apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch", "patch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments/status"] + verbs: ["patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-attacher-binding +subjects: + - kind: ServiceAccount + name: csi-cinder-controller-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: csi-attacher-role + apiGroup: rbac.authorization.k8s.io +--- +# external Provisioner +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-provisioner-role +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "delete"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["get", "list"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-provisioner-binding +subjects: + - kind: ServiceAccount + name: csi-cinder-controller-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: csi-provisioner-role + apiGroup: rbac.authorization.k8s.io + +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-snapshotter-role +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"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["create", "get", "list", "watch", "update", "delete", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents/status"] + verbs: ["update", "patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-snapshotter-binding +subjects: + - kind: ServiceAccount + name: csi-cinder-controller-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: csi-snapshotter-role + apiGroup: rbac.authorization.k8s.io +--- +kind: ClusterRole +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"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["patch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-resizer-binding +subjects: + - kind: ServiceAccount + name: csi-cinder-controller-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: csi-resizer-role + apiGroup: rbac.authorization.k8s.io +--- diff --git a/templates/custom_storageclass.yaml b/templates/custom_storageclass.yaml new file mode 100644 index 00000000..267c731a --- /dev/null +++ b/templates/custom_storageclass.yaml @@ -0,0 +1,3 @@ +{{- if .Values.storageClass.custom -}} +{{ .Values.storageClass.custom }} +{{- end }} diff --git a/templates/nodeplugin-daemonset.yaml b/templates/nodeplugin-daemonset.yaml new file mode 100644 index 00000000..f2f42a79 --- /dev/null +++ b/templates/nodeplugin-daemonset.yaml @@ -0,0 +1,148 @@ +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: {{ include "cinder-csi.name" . }}-nodeplugin + namespace: {{ .Release.Namespace }} + labels: + {{- include "cinder-csi.nodeplugin.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "cinder-csi.nodeplugin.matchLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "cinder-csi.nodeplugin.labels" . | nindent 8 }} + spec: + serviceAccount: csi-cinder-node-sa + hostNetwork: true + containers: + - name: node-driver-registrar + image: "{{ .Values.csi.nodeDriverRegistrar.image.repository }}:{{ .Values.csi.nodeDriverRegistrar.image.tag }}" + imagePullPolicy: {{ .Values.csi.nodeDriverRegistrar.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - "--csi-address=$(ADDRESS)" + - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" + {{- if .Values.csi.nodeDriverRegistrar.extraArgs }} + {{- with .Values.csi.nodeDriverRegistrar.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: ADDRESS + value: /csi/csi.sock + - name: DRIVER_REG_SOCK_PATH + value: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins/cinder.csi.openstack.org/csi.sock + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: registration-dir + mountPath: /registration + resources: {{ toYaml .Values.csi.nodeDriverRegistrar.resources | nindent 12 }} + - name: liveness-probe + image: "{{ .Values.csi.livenessprobe.image.repository }}:{{ .Values.csi.livenessprobe.image.tag }}" + imagePullPolicy: {{ .Values.csi.livenessprobe.image.pullPolicy }} + args: + - "-v={{ .Values.logVerbosityLevel }}" + - --csi-address=/csi/csi.sock + {{- if .Values.csi.livenessprobe.extraArgs }} + {{- with .Values.csi.livenessprobe.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + volumeMounts: + - name: socket-dir + mountPath: /csi + resources: {{ toYaml .Values.csi.livenessprobe.resources | nindent 12 }} + - name: cinder-csi-plugin + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true + image: "{{ .Values.csi.plugin.image.repository }}:{{ .Values.csi.plugin.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.csi.plugin.image.pullPolicy }} + args: + - /bin/cinder-csi-plugin + - "-v={{ .Values.logVerbosityLevel }}" + - "--endpoint=$(CSI_ENDPOINT)" + - "--cloud-config=$(CLOUD_CONFIG)" + {{- if .Values.csi.plugin.extraArgs }} + {{- with .Values.csi.plugin.extraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + env: + - name: CSI_ENDPOINT + value: unix://csi/csi.sock + - name: CLOUD_CONFIG + value: /etc/kubernetes/{{ .Values.secret.filename }} + ports: + - containerPort: 9808 + name: healthz + protocol: TCP + # The probe + livenessProbe: + failureThreshold: {{ .Values.csi.livenessprobe.failureThreshold }} + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: {{ .Values.csi.livenessprobe.initialDelaySeconds }} + timeoutSeconds: {{ .Values.csi.livenessprobe.timeoutSeconds }} + periodSeconds: {{ .Values.csi.livenessprobe.periodSeconds }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: kubelet-dir + mountPath: {{ .Values.csi.plugin.nodePlugin.kubeletDir }} + mountPropagation: "Bidirectional" + - name: pods-probe-dir + mountPath: /dev + mountPropagation: "HostToContainer" + {{- .Values.csi.plugin.volumeMounts | toYaml | trimSuffix "\n" | nindent 12 }} + resources: {{ toYaml .Values.csi.plugin.resources | nindent 12 }} + volumes: + - name: socket-dir + hostPath: + path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins/cinder.csi.openstack.org + type: DirectoryOrCreate + - name: registration-dir + hostPath: + path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }}/plugins_registry/ + type: Directory + - name: kubelet-dir + hostPath: + path: {{ .Values.csi.plugin.nodePlugin.kubeletDir }} + type: Directory + # - name: pods-cloud-data + # hostPath: + # path: /var/lib/cloud/data + # type: Directory + - name: pods-probe-dir + hostPath: + path: /dev + type: Directory + - name: cloud-config + {{- if .Values.secret.enabled }} + secret: + secretName: {{ .Values.secret.name }} + {{- else }} + hostPath: + path: /etc/kubernetes + {{- end }} + {{ .Values.csi.plugin.volumes | toYaml | trimSuffix "\n" | nindent 8 }} + affinity: {{ toYaml .Values.csi.plugin.nodePlugin.affinity | nindent 8 }} + nodeSelector: {{ toYaml .Values.csi.plugin.nodePlugin.nodeSelector | nindent 8 }} + tolerations: {{ toYaml .Values.csi.plugin.nodePlugin.tolerations | nindent 8 }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/templates/nodeplugin-rbac.yaml b/templates/nodeplugin-rbac.yaml new file mode 100644 index 00000000..894a8df2 --- /dev/null +++ b/templates/nodeplugin-rbac.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: csi-cinder-node-sa + namespace: {{ .Release.Namespace }} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-nodeplugin-role +rules: + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "list", "watch", "create", "update", "patch"] + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: csi-nodeplugin-binding +subjects: + - kind: ServiceAccount + name: csi-cinder-node-sa + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: csi-nodeplugin-role + apiGroup: rbac.authorization.k8s.io diff --git a/templates/secret.yaml b/templates/secret.yaml new file mode 100644 index 00000000..b11ef856 --- /dev/null +++ b/templates/secret.yaml @@ -0,0 +1,10 @@ +{{- if .Values.secret.create }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.secret.name }} + namespace: {{ .Release.Namespace }} +type: Opaque +stringData: + {{ .Values.secret.data | toYaml | trimSuffix "\n" | nindent 2 }} +{{- end }} diff --git a/templates/storageclass.yaml b/templates/storageclass.yaml new file mode 100644 index 00000000..704c3003 --- /dev/null +++ b/templates/storageclass.yaml @@ -0,0 +1,25 @@ +{{- if .Values.storageClass.enabled }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: csi-cinder-sc-delete + {{- if .Values.storageClass.delete.isDefault }} + annotations: + storageclass.kubernetes.io/is-default-class: "true" + {{- end }} +provisioner: cinder.csi.openstack.org +reclaimPolicy: Delete +allowVolumeExpansion: {{ .Values.storageClass.delete.allowVolumeExpansion }} +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: csi-cinder-sc-retain + {{- if .Values.storageClass.retain.isDefault }} + annotations: + storageclass.kubernetes.io/is-default-class: "true" + {{- end }} +provisioner: cinder.csi.openstack.org +reclaimPolicy: Retain +allowVolumeExpansion: {{ .Values.storageClass.retain.allowVolumeExpansion }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml new file mode 100644 index 00000000..0f995429 --- /dev/null +++ b/values.yaml @@ -0,0 +1,151 @@ +extraLabels: {} + +nameOverride: "" +fullnameOverride: "" +timeout: 3m + +csi: + attacher: + image: + repository: registry.k8s.io/sig-storage/csi-attacher + tag: v4.2.0 + pullPolicy: IfNotPresent + resources: {} + extraArgs: {} + provisioner: + topology: "true" + image: + repository: registry.k8s.io/sig-storage/csi-provisioner + tag: v3.4.1 + pullPolicy: IfNotPresent + resources: {} + extraArgs: {} + snapshotter: + image: + repository: registry.k8s.io/sig-storage/csi-snapshotter + tag: v6.2.1 + pullPolicy: IfNotPresent + resources: {} + extraArgs: {} + resizer: + image: + repository: registry.k8s.io/sig-storage/csi-resizer + tag: v1.7.0 + pullPolicy: IfNotPresent + resources: {} + extraArgs: {} + livenessprobe: + image: + repository: registry.k8s.io/sig-storage/livenessprobe + tag: v2.9.0 + pullPolicy: IfNotPresent + failureThreshold: 5 + initialDelaySeconds: 10 + timeoutSeconds: 10 + periodSeconds: 60 + resources: {} + extraArgs: {} + nodeDriverRegistrar: + image: + repository: registry.k8s.io/sig-storage/csi-node-driver-registrar + tag: v2.6.2 + pullPolicy: IfNotPresent + resources: {} + extraArgs: {} + plugin: + image: + repository: registry.k8s.io/provider-os/cinder-csi-plugin + pullPolicy: IfNotPresent + tag: # defaults to .Chart.AppVersion + volumes: + - name: cacert + hostPath: + path: /etc/cacert + volumeMounts: + - name: cacert + mountPath: /etc/cacert + readOnly: true + - name: cloud-config + mountPath: /etc/kubernetes + readOnly: true + nodePlugin: + affinity: {} + nodeSelector: {} + tolerations: + - operator: Exists + kubeletDir: /var/lib/kubelet + controllerPlugin: + replicas: 1 + strategy: + # RollingUpdate strategy replaces old pods with new ones gradually, + # without incurring downtime. + type: RollingUpdate + rollingUpdate: + # maxUnavailable is the maximum number of pods that can be + # unavailable during the update process. + maxUnavailable: 0 + # maxSurge is the maximum number of pods that can be + # created over the desired number of pods. + maxSurge: 1 + affinity: {} + nodeSelector: {} + tolerations: [] + resources: {} + extraArgs: {} + +# Log verbosity level. +# See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md +# for description of individual verbosity levels. +logVerbosityLevel: 2 + +secret: + enabled: false + create: false + filename: cloud.conf +# name: cinder-csi-cloud-config +# data: +# cloud.conf: |- +# [Global] +# auth-url=http://openstack-control-plane +# user-id=user-id +# password=password +# trust-id=trust-id +# region=RegionOne +# ca-file=/etc/cacert/ca-bundle.crt + +storageClass: + enabled: true + delete: + isDefault: false + allowVolumeExpansion: true + retain: + isDefault: false + allowVolumeExpansion: true +# any kind of custom StorageClasses +# custom: |- +# --- +# apiVersion: storage.k8s.io/v1 +# kind: StorageClass +# metadata: +# name: sas +# provisioner: cinder.csi.openstack.org +# volumeBindingMode: WaitForFirstConsumer +# allowVolumeExpansion: true +# parameters: +# type: SAS +# --- +# apiVersion: snapshot.storage.k8s.io/v1 +# kind: VolumeSnapshotClass +# metadata: +# name: csi-cinder-snapclass +# driver: cinder.csi.openstack.org +# deletionPolicy: Delete + +# You may set ID of the cluster where openstack-cinder-csi is deployed. This value will be appended +# to volume metadata in newly provisioned volumes as `cinder.csi.openstack.org/cluster=`. +clusterID: "kubernetes" + +priorityClassName: "" + +imagePullSecrets: [] +# - name: my-imagepull-secret From edb44a5edbf368943fb3450f88c1334cb4161656 Mon Sep 17 00:00:00 2001 From: Jun Eeo Date: Wed, 26 Apr 2023 19:05:00 +0100 Subject: [PATCH 3/5] Squashed 'helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager/' content from commit d2ec4743 git-subtree-dir: helm/cloud-provider-openstack-app/charts/openstack-cloud-controller-manager git-subtree-split: d2ec4743f1d4e8d64447f5e4329bc42f791093bc --- Chart.yaml | 11 +++ README.md | 35 ++++++++ templates/_helpers.tpl | 84 ++++++++++++++++++ templates/clusterrole.yaml | 97 +++++++++++++++++++++ templates/clusterrolebinding-sm.yaml | 18 ++++ templates/clusterrolebinding.yaml | 16 ++++ templates/daemonset.yaml | 104 +++++++++++++++++++++++ templates/secret.yaml | 19 +++++ templates/service-sm.yaml | 20 +++++ templates/serviceaccount.yaml | 9 ++ templates/servicemonitor.yaml | 25 ++++++ values.yaml | 122 +++++++++++++++++++++++++++ 12 files changed, 560 insertions(+) create mode 100644 Chart.yaml create mode 100644 README.md create mode 100644 templates/_helpers.tpl create mode 100644 templates/clusterrole.yaml create mode 100644 templates/clusterrolebinding-sm.yaml create mode 100644 templates/clusterrolebinding.yaml create mode 100644 templates/daemonset.yaml create mode 100644 templates/secret.yaml create mode 100644 templates/service-sm.yaml create mode 100644 templates/serviceaccount.yaml create mode 100644 templates/servicemonitor.yaml create mode 100644 values.yaml diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 00000000..91c54ccc --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +appVersion: v1.27.1 +description: Openstack Cloud Controller Manager Helm Chart +icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png +home: https://github.com/kubernetes/cloud-provider-openstack +name: openstack-cloud-controller-manager +version: 2.27.1 +maintainers: + - name: eumel8 + email: f.kloeker@telekom.de + url: https://www.telekom.com diff --git a/README.md b/README.md new file mode 100644 index 00000000..25fb4a91 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# openstack-cloud-controller-manager + +Deploys the OpenStack Cloud Controller Manager to your cluster. + +Default configuration values are the same as the CCM itself. + +## How To install + +You need to configure an `openstack-ccm.yaml` values file with at least: + +- `cloudConfig.global.auth-url` with the Keystone URL +- Authentication + - with password: `cloudConfig.global.username` and `cloudconfig.global.password` + - with application credentials: (`cloudConfig.global.application-credential-id` or `cloudConfig.global.application-credential-name`) and `cloudConfig.global.application-credential-secret` +- Load balancing + - `cloudConfig.loadbalancer.floating-network-id` **or** + - `cloudConfig.loadbalancer.floating-subnet-id` **or** + - `cloudConfig.loadbalancer.floating-subnet` + +If you want to enable health checks for your Load Balancers (optional), set `cloudConfig.loadbalancer.create-monitor: true`. + +Then run: + +``` +helm repo add cpo https://kubernetes.github.io/cloud-provider-openstack +helm repo update +helm install openstack-ccm cpo/openstack-cloud-controller-manager --values openstack-ccm.yaml +``` + +## Unsupported configurations + +- The chart does not support the mounting of custom `clouds.yaml` files. Therefore, the following config values in the `[Global]` section won’t have any effect: + - `use-clouds` + - `clouds-file` + - `cloud` diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl new file mode 100644 index 00000000..098dc0b3 --- /dev/null +++ b/templates/_helpers.tpl @@ -0,0 +1,84 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "occm.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "occm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels and app labels +*/}} +{{- define "occm.labels" -}} +app.kubernetes.io/name: {{ include "occm.name" . }} +helm.sh/chart: {{ include "occm.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{- define "occm.common.matchLabels" -}} +app: {{ template "occm.name" . }} +release: {{ .Release.Name }} +{{- end -}} + +{{- define "occm.common.metaLabels" -}} +chart: {{ template "occm.chart" . }} +heritage: {{ .Release.Service }} +{{- end -}} + +{{- define "occm.controllermanager.matchLabels" -}} +component: controllermanager +{{ include "occm.common.matchLabels" . }} +{{- end -}} + +{{- define "occm.controllermanager.labels" -}} +{{ include "occm.controllermanager.matchLabels" . }} +{{ include "occm.common.metaLabels" . }} +{{- end -}} + +{{/* +Create cloud-config makro. +*/}} +{{- define "cloudConfig" -}} +[Global] +{{- range $key, $value := .Values.cloudConfig.global }} +{{ $key }} = {{ $value | quote }} +{{- end }} + +[Networking] +{{- range $key, $value := .Values.cloudConfig.networking }} +{{ $key }} = {{ $value | quote }} +{{- end }} + +[LoadBalancer] +{{- range $key, $value := .Values.cloudConfig.loadBalancer }} +{{ $key }} = {{ $value | quote }} +{{- end }} + +[BlockStorage] +{{- range $key, $value := .Values.cloudConfig.blockStorage }} +{{ $key }} = {{ $value | quote }} +{{- end }} + +[Metadata] +{{- range $key, $value := .Values.cloudConfig.metadata }} +{{ $key }} = {{ $value | quote }} +{{- end }} +{{- end }} + + +{{/* +Generate string of enabled controllers. Might have a trailing comma (,) which needs to be trimmed. +*/}} +{{- define "occm.enabledControllers" }} +{{- range .Values.enabledControllers -}}{{ . }},{{- end -}} +{{- end }} diff --git a/templates/clusterrole.yaml b/templates/clusterrole.yaml new file mode 100644 index 00000000..7eee6c4e --- /dev/null +++ b/templates/clusterrole.yaml @@ -0,0 +1,97 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: system:openstack-cloud-controller-manager + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +rules: +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - create + - update +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + - update +- apiGroups: + - "" + resources: + - nodes + verbs: + - '*' +- apiGroups: + - "" + resources: + - nodes/status + verbs: + - patch +- apiGroups: + - "" + resources: + - services + verbs: + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - services/status + verbs: + - patch +- apiGroups: + - "" + resources: + - serviceaccounts/token + verbs: + - create +- apiGroups: + - "" + resources: + - serviceaccounts + verbs: + - create + - get +- apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - '*' +- apiGroups: + - "" + resources: + - endpoints + verbs: + - create + - get + - list + - watch + - update +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - list + - get + - watch diff --git a/templates/clusterrolebinding-sm.yaml b/templates/clusterrolebinding-sm.yaml new file mode 100644 index 00000000..88d9aedf --- /dev/null +++ b/templates/clusterrolebinding-sm.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: system:{{ include "occm.name" . }}:auth-delegate + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +subjects: +- kind: User + name: system:serviceaccount:{{ .Release.Namespace }}:{{ include "occm.name" . }} + apiGroup: rbac.authorization.k8s.io +roleRef: + kind: ClusterRole + name: system:auth-delegator + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/templates/clusterrolebinding.yaml b/templates/clusterrolebinding.yaml new file mode 100644 index 00000000..f19f0ef9 --- /dev/null +++ b/templates/clusterrolebinding.yaml @@ -0,0 +1,16 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: system:openstack-cloud-controller-manager + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:openstack-cloud-controller-manager +subjects: +- kind: ServiceAccount + name: openstack-cloud-controller-manager + namespace: {{ .Release.Namespace | quote }} diff --git a/templates/daemonset.yaml b/templates/daemonset.yaml new file mode 100644 index 00000000..03d82856 --- /dev/null +++ b/templates/daemonset.yaml @@ -0,0 +1,104 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "occm.name" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "occm.labels" . | nindent 4 }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "occm.controllermanager.matchLabels" . | nindent 6 }} + updateStrategy: + type: RollingUpdate + template: + metadata: + annotations: + checksum/config: {{ include "cloudConfig" . | sha256sum }} + labels: + {{- include "occm.controllermanager.labels" . | nindent 8 }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: openstack-cloud-controller-manager + containers: + - name: openstack-cloud-controller-manager + image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" + args: + - /bin/openstack-cloud-controller-manager + - --v={{ .Values.logVerbosityLevel }} + - --cloud-config=$(CLOUD_CONFIG) + - --cluster-name=$(CLUSTER_NAME) + - --cloud-provider=openstack + - --use-service-account-credentials=true + - --controllers={{- trimAll "," (include "occm.enabledControllers" . ) -}} + {{- if .Values.serviceMonitor.enabled }} + - --bind-address=0.0.0.0 + {{- else }} + - --bind-address=127.0.0.1 + {{- end }} + {{- if .Values.controllerExtraArgs }} + {{- with .Values.controllerExtraArgs }} + {{- tpl . $ | trim | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.serviceMonitor.enabled }} + ports: + - containerPort: 10258 + hostPort: 10258 + name: http + protocol: TCP + {{- end }} + volumeMounts: + - mountPath: /etc/config + name: cloud-config-volume + readOnly: true + {{- if .Values.extraVolumeMounts }} + {{- toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} + {{- if .Values.livenessProbe }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.readinessProbe }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + {{- end }} + {{- if .Values.resources }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + env: + - name: CLOUD_CONFIG + value: /etc/config/cloud.conf + - name: CLUSTER_NAME + value: {{ .Values.cluster.name }} + {{- if .Values.extraInitContainers }} + initContainers: {{ toYaml .Values.extraInitContainers | nindent 6 }} + {{- end }} + hostNetwork: true + volumes: + - name: cloud-config-volume + secret: + secretName: {{ .Values.secret.name }} + {{- if .Values.extraVolumes }} + {{ toYaml .Values.extraVolumes | nindent 6 }} + {{- end }} diff --git a/templates/secret.yaml b/templates/secret.yaml new file mode 100644 index 00000000..ea35e01e --- /dev/null +++ b/templates/secret.yaml @@ -0,0 +1,19 @@ +{{- if .Values.secret.create }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.secret.name | default "cloud-config" }} + namespace: {{ .Release.Namespace }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +type: Opaque +data: + {{ if .Values.cloudConfigContents -}} + cloud.conf: | + {{ .Values.cloudConfigContents | b64enc }} + {{ else -}} + cloud.conf: {{ include "cloudConfig" . | b64enc }} + {{ end -}} +{{- end }} diff --git a/templates/service-sm.yaml b/templates/service-sm.yaml new file mode 100644 index 00000000..30ae3fe9 --- /dev/null +++ b/templates/service-sm.yaml @@ -0,0 +1,20 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: v1 +kind: Service +metadata: + labels: + {{- include "occm.labels" . | nindent 4 }} + name: {{ include "occm.name" . }} + namespace: {{ .Release.Namespace }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ports: + - name: http + port: 10258 + protocol: TCP + selector: + {{- include "occm.controllermanager.matchLabels" . | nindent 4 }} +{{- end }} diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml new file mode 100644 index 00000000..e24737e1 --- /dev/null +++ b/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: openstack-cloud-controller-manager + namespace: {{ .Release.Namespace }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} diff --git a/templates/servicemonitor.yaml b/templates/servicemonitor.yaml new file mode 100644 index 00000000..2e728add --- /dev/null +++ b/templates/servicemonitor.yaml @@ -0,0 +1,25 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + {{- include "occm.labels" . | nindent 4 }} + name: {{ include "occm.name" . }} + namespace: {{ .Release.Namespace }} + annotations: + {{- with .Values.commonAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + endpoints: + - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + interval: 30s + port: http + scheme: https + tlsConfig: + insecureSkipVerify: true + jobLabel: component + selector: + matchLabels: + {{- include "occm.controllermanager.matchLabels" . | nindent 6 }} +{{- end }} diff --git a/values.yaml b/values.yaml new file mode 100644 index 00000000..bb5cdc9f --- /dev/null +++ b/values.yaml @@ -0,0 +1,122 @@ +# Values OpenStack Cloud Controller Manager Helm Chart +# +# Define deployment mode for the controller and provide cloud credentials in cloudConfig at the end of the file +# +## Annotations to apply to all resources +commonAnnotations: {} +# commonAnnotations: +# "helm.sh/hook": pre-install,pre-upgrade +# "helm.sh/hook-weight": "-100" +# "helm.sh/hook-delete-policy": before-hook-creation + +# Image repository name and tag +image: + repository: registry.k8s.io/provider-os/openstack-cloud-controller-manager + tag: "" + +# Additional containers which are run before the app containers are started. +extraInitContainers: [] +# - name: wait +# image: busybox +# command: ['sh', '-c', 'echo waiting for 10 seconds; sleep 10;'] + +# Set resources for Kubernetes daemonset +resources: {} +# resources: +# requests: +# cpu: 200m + +# Set livenessProbe for Kubernetes daemonset. Used the same port for servicemonitor metrics +livenessProbe: {} +# livenessProbe: +# httpGet: +# path: /metrics +# port: 10258 + +# Set readinessProbe in the same way like livenessProbe +readinessProbe: {} + +# Set nodeSelector where the controller shut run, i.e. controlplane nodes +nodeSelector: [] +# nodeSelector: +# node-role.kubernetes.io/controlplane: "true" + +# Set tolerations for nodes where the controller should run, i.e. node should uninitialized, controlplane... +tolerations: [] +# tolerations: +# - key: node.cloudprovider.kubernetes.io/uninitialized +# value: "true" +# effect: NoSchedule +# - key: node-role.kubernetes.io/controlplane +# value: "true" +# effect: NoSchedule +# - key: node-role.kubernetes.io/etcd +# value: "true" +# effect: NoExecute + +# Set security settings for the controller pods +# For all available options, see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#podsecuritycontext-v1-core +podSecurityContext: + runAsUser: 1001 + +# List of controllers should be enabled. +# Use '*' to enable all controllers. +# Prefix a controller with '-' to disable it. +enabledControllers: + - cloud-node + - cloud-node-lifecycle + - route + - service + +# Any extra arguments for openstack-cloud-controller-manager +controllerExtraArgs: {} +# controllerExtraArgs: |- +# - --cluster-name=my-cluster + +# Create a service monitor for Prometheus Operator +serviceMonitor: {} +# serviceMonitor: +# enabled: true + +# Create a secret resource cloud-config (or other name) to store credentials and settings from cloudConfig +# You can also provide your own secret (not created by the Helm chart), in this case set create to false +# and adjust the name of the secret as necessary +secret: + create: true + name: cloud-config + +# Log verbosity level. +# See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md +# for description of individual verbosity levels. +logVerbosityLevel: 2 + +# Specify settings with the same key as the CCM config: https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md#config-openstack-cloud-controller-manager +cloudConfig: + global: + networking: + loadBalancer: + blockStorage: + metadata: + +# The following three volumes are required to use all OCCM controllers, +# but might not be needed if you just use a specific controller +# Additional volumes that should be available to the pods: +extraVolumes: + - name: flexvolume-dir + hostPath: + path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec + - name: k8s-certs + hostPath: + path: /etc/kubernetes/pki +# Where the additional volumes should be mounted into the pods: +extraVolumeMounts: + - name: flexvolume-dir + mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec + readOnly: true + - name: k8s-certs + mountPath: /etc/kubernetes/pki + readOnly: true + +# cluster name that used for created cluster +cluster: + name: kubernetes From 74033ec2af39491a4c27574c79c1b0a9cff505c2 Mon Sep 17 00:00:00 2001 From: Jun Eeo Date: Wed, 26 Apr 2023 19:13:48 +0100 Subject: [PATCH 4/5] fix Chart.yaml and values --- helm/cloud-provider-openstack-app/Chart.yaml | 4 ++-- helm/cloud-provider-openstack-app/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/cloud-provider-openstack-app/Chart.yaml b/helm/cloud-provider-openstack-app/Chart.yaml index 0dda4fa8..c6c56b4e 100644 --- a/helm/cloud-provider-openstack-app/Chart.yaml +++ b/helm/cloud-provider-openstack-app/Chart.yaml @@ -11,8 +11,8 @@ version: [[ .Version ]] dependencies: - name: openstack-cloud-controller-manager - version: 1.3.0 + version: 1.27.1 - name: openstack-cinder-csi - version: 2.2.0 + version: 2.27.1 icon: https://s.giantswarm.io/app-icons/openstack/1/light.svg diff --git a/helm/cloud-provider-openstack-app/values.yaml b/helm/cloud-provider-openstack-app/values.yaml index 9219117e..ec48bb94 100644 --- a/helm/cloud-provider-openstack-app/values.yaml +++ b/helm/cloud-provider-openstack-app/values.yaml @@ -35,7 +35,7 @@ openstack-cinder-csi: enabled: true plugin: image: - repository: docker.io/k8scloudprovider/cinder-csi-plugin + repository: registry.k8s.io/provider-os/cinder-csi-plugin pullPolicy: IfNotPresent tag: "" # defaults to .Chart.AppVersion volumes: @@ -75,7 +75,7 @@ openstack-cloud-controller-manager: cluster: name: "" image: - repository: docker.io/k8scloudprovider/openstack-cloud-controller-manager + repository: registry.k8s.io/provider-os/openstack-cloud-controller-manager tag: "" # defaults to .Chart.AppVersion # Create a service monitor for Prometheus Operator # serviceMonitor: From 3944e6a53427b08253420a950f372051e512cba7 Mon Sep 17 00:00:00 2001 From: Jun Eeo Date: Wed, 26 Apr 2023 19:17:37 +0100 Subject: [PATCH 5/5] fix dependency --- helm/cloud-provider-openstack-app/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/cloud-provider-openstack-app/Chart.yaml b/helm/cloud-provider-openstack-app/Chart.yaml index c6c56b4e..11d070fd 100644 --- a/helm/cloud-provider-openstack-app/Chart.yaml +++ b/helm/cloud-provider-openstack-app/Chart.yaml @@ -11,7 +11,7 @@ version: [[ .Version ]] dependencies: - name: openstack-cloud-controller-manager - version: 1.27.1 + version: 2.27.1 - name: openstack-cinder-csi version: 2.27.1