Skip to content

Commit

Permalink
feat(huawei-csi-plugin): new chart containing the huawei csi plugin (#…
Browse files Browse the repository at this point in the history
…181)

* feat(huawei-csi-plugin): new chart containing the huawei csi plugin

this is the initial commit and the chart is more in a PoC state than fully engineered

* refactor(huawei-csi-plugin): better templating, small fix in appVersion

* refactor(labelling): adding labels to all resources
  • Loading branch information
sinicis authored Feb 26, 2021
1 parent 966060d commit 0b75f53
Show file tree
Hide file tree
Showing 17 changed files with 1,524 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/charts/barman @adfinis-sygroup/helm-charts @michaelimfeld @sinicis
/charts/common @adfinis-sygroup/helm-charts @hairmare
/charts/csi-secret-provider-class @adfinis-sygroup/helm-charts @hairmare
/charts/huawei-csi-plugin @adfinis-sygroup/helm-charts @sinicis
/charts/timed @adfinis-sygroup/helm-charts @michaelimfeld @aziiee
/charts/vault-auth @adfinis-sygroup/helm-charts @eyenx
/charts/vault-csi-provider @adfinis-sygroup/helm-charts @pree @eyenx
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Configure cert-manager Issuers and ClusterIssuers via Helm
| [caasperli](charts/caasperli) | Deploy Caasperli to a Kubernetes Cluster | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: latest](https://img.shields.io/badge/app%20version-latest-brightgreen) |
| [common](charts/common) | Common chartbuilding components and helpers, based on incubator/common | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 0.x](https://img.shields.io/badge/app%20version-0.x-brightgreen) |
| [csi-secret-provider-class](charts/csi-secret-provider-class) | A Helm chart to create a SecretProviderClass resource | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 0.x](https://img.shields.io/badge/app%20version-0.x-brightgreen) |
| [huawei-csi-plugin](charts/huawei-csi-plugin) | Deploy the Huawei CSI plugin | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 2.2.x](https://img.shields.io/badge/app%20version-2.2.x-brightgreen) |
| [infra-apps](charts/infra-apps) | Argo CD app-of-apps config for infrastructure components | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 0.x](https://img.shields.io/badge/app%20version-0.x-brightgreen) |
| [logging-apps](charts/logging-apps) | Argo CD app-of-apps config for logging applications | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 0.x](https://img.shields.io/badge/app%20version-0.x-brightgreen) |
| [misc-apps](charts/misc-apps) | Argo CD app-of-apps config for miscellaneous small tools | ![Version: 0.x](https://img.shields.io/badge/version-0.x-brightgreen) ![App version: 0.x](https://img.shields.io/badge/app%20version-0.x-brightgreen) |
Expand Down
23 changes: 23 additions & 0 deletions charts/huawei-csi-plugin/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions charts/huawei-csi-plugin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: huawei-csi-plugin
description: Deploy the Huawei CSI plugin
type: application
version: 0.0.1
appVersion: v2.2.RC3
home: https://github.com/Huawei/eSDK_K8S_Plugin
sources:
- https://github.com/Huawei/eSDK_K8S_Plugin
- https://github.com/adfinis-sygroup/huawei-csi-plugin
- https://github.com/adfinis-sygroup/helm-charts/tree/master/charts/huawei-csi-plugin
maintainers:
- name: adfinis-sygroup
email: [email protected]
url: https://adfinis.com
80 changes: 80 additions & 0 deletions charts/huawei-csi-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# huawei-csi-plugin

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.2.RC3](https://img.shields.io/badge/AppVersion-v2.2.RC3-informational?style=flat-square)

Deploy the Huawei CSI plugin

**Homepage:** <https://github.com/Huawei/eSDK_K8S_Plugin>

## Maintainers
This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk_kwd=helm-charts).

## Source Code

* <https://github.com/Huawei/eSDK_K8S_Plugin>
* <https://github.com/adfinis-sygroup/huawei-csi-plugin>
* <https://github.com/adfinis-sygroup/helm-charts/tree/master/charts/huawei-csi-plugin>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| controller | object | `{'replicaCount':1}` | different configuration options of controller deployment |
| csi_attacher.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-attacher |
| csi_attacher.image.repository | string | `"quay.io/k8scsi/csi-attacher"` | Image Repo for csi-attacher |
| csi_attacher.image.tag | string | `"v1.2.1"` | Image Tag for csi-attacher |
| csi_attacher.resources | object | `{}` | resources for csi-attacher |
| csi_driver.controller.resources | object | `{}` | resources for csi-driver container within controller-deployment |
| csi_driver.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-driver |
| csi_driver.image.repository | string | `"ghcr.io/adfinis-sygroup/huawei-csi-plugin"` | Image Repo for csi-driver |
| csi_driver.image.tag | string | `"v2.2.RC3"` | Image Tag for csi-driver |
| csi_driver.node.resources | object | `{}` | resources for csi-driver container within node-daemonset |
| csi_driver.node.securityContext | object | - | securityContext esacalates all the privileges for csi-driver container within node-daemonset |
| csi_node_driver_registrar.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-node-driver-registrar |
| csi_node_driver_registrar.image.repository | string | `"quay.io/k8scsi/csi-node-driver-registrar"` | Image Repo for csi-node-driver-registrar |
| csi_node_driver_registrar.image.tag | string | `"v1.2.0"` | Image Tag for csi-node-driver-registrar |
| csi_node_driver_registrar.resources | object | `{}` | resources for csi-node-driver-registrar |
| csi_provisioner.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-provisioner |
| csi_provisioner.image.repository | string | `"quay.io/k8scsi/csi-provisioner"` | Image Repo for csi-provisioner |
| csi_provisioner.image.tag | string | `"v1.5.0"` | Image Tag for csi-provisioner |
| csi_provisioner.resources | object | `{}` | resources for csi-provisioner |
| csi_resizer.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-resizer |
| csi_resizer.image.repository | string | `"quay.io/k8scsi/csi-resizer"` | Image Repo for csi-resizer |
| csi_resizer.image.tag | string | `"v0.5.0"` | Image Tag for csi-resizer |
| csi_resizer.resources | object | `{}` | resources for csi-resizer |
| csi_snapshot_controller.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-snapshot-controller |
| csi_snapshot_controller.image.repository | string | `"quay.io/k8scsi/csi-snapshot-controller"` | Image Repo for csi-snapshot-controller |
| csi_snapshot_controller.image.tag | string | `"v2.1.0"` | Image Tag for csi-snapshot-controller |
| csi_snapshot_controller.resources | object | `{}` | resources for csi-snapshot-controller |
| csi_snapshotter.image.pullPolicy | string | `"IfNotPresent"` | Image PullPolicy for csi-snapshotter |
| csi_snapshotter.image.repository | string | `"quay.io/k8scsi/csi-snapshotter"` | Image Repo for csi-snapshotter |
| csi_snapshotter.image.tag | string | `"v2.1.0"` | Image Tag for csi-snapshotter |
| csi_snapshotter.resources | object | `{}` | resources for csi-snapshotter |
| csiconfig | object | - | complete backend configuration for the csi controller (see [documentation](https://github.com/Huawei/eSDK_K8S_Plugin/tree/master/docs/en)) |
| features.multiController.enabled | bool | `false` | specifies if multiController is enabled or not |
| features.resizing.enabled | bool | `true` | specifies if resizing is enabled or not |
| features.snapshotting.enabled | bool | `true` | specifies if snapshotting is enabled or not |
| fullnameOverride | string | `""` | specifies the full name override to be used for helm |
| imagePullSecrets | list | `[]` | specifies the image pull secrets to be used |
| nameOverride | string | `""` | specifies the name override to be used for helm |
| node | object | - | different configuration options of node daemonset |
| rbac.create | bool | `true` | Whether to create RBAC or not |
| serviceAccount.annotations | object | `{}` | annotations to add to each service account |
| serviceAccount.create | bool | `true` | Whether to create serviceAccounts or not |

## About this chart

Adfinis fights for a software world that is more open, where the quality is
better and where software must be accessible to everyone. This chart
is part of the action behind this commitment. Feel free to
[contact](https://adfinis.com/kontakt/?pk_campaign=github&pk_kwd=helm-charts)
us if you have any questions.

## License

This Helm chart is free software: you can redistribute it and/or modify it under the terms
of the GNU Affero General Public License as published by the Free Software Foundation,
version 3 of the License.

----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/)
8 changes: 8 additions & 0 deletions charts/huawei-csi-plugin/ci/defaults-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The CRD defintions provided by Huawei are using the
# apiextensions.k8s.io/v1beta1 which is deprecated so
# our CI tests are failing. But just changing the api-
# Version to apiextensions.k8s.io/v1 will break the
# CRD creation
features:
snapshotting:
enabled: false
62 changes: 62 additions & 0 deletions charts/huawei-csi-plugin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "huawei-csi-plugin.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 "huawei-csi-plugin.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 "huawei-csi-plugin.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "huawei-csi-plugin.labels" -}}
helm.sh/chart: {{ include "huawei-csi-plugin.chart" . }}
{{ include "huawei-csi-plugin.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "huawei-csi-plugin.selectorLabels" -}}
app.kubernetes.io/name: {{ include "huawei-csi-plugin.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "huawei-csi-plugin.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "huawei-csi-plugin.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/huawei-csi-plugin/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "huawei-csi-plugin.fullname" . }}
labels:
{{- include "huawei-csi-plugin.labels" . | nindent 4 }}
data:
csi.json: |
{{ .Values.csiconfig | toJson }}
121 changes: 121 additions & 0 deletions charts/huawei-csi-plugin/templates/daemonset-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "huawei-csi-plugin.fullname" . }}
labels:
{{- include "huawei-csi-plugin.labels" . | nindent 4 }}
app.kubernetes.io/component: "csi-node"
spec:
selector:
matchLabels:
{{- include "huawei-csi-plugin.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: "csi-node"
template:
metadata:
{{- with .Values.node.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "huawei-csi-plugin.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: "csi-node"
spec:
serviceAccountName: {{ include "huawei-csi-plugin.fullname" . }}-node
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml | nindent 8 }}
{{- end }}
hostNetwork: true
containers:
- name: csi-node-driver-registrar
image: "{{ .Values.csi_node_driver_registrar.image.repository }}:{{ .Values.csi_node_driver_registrar.image.tag }}"
imagePullPolicy: {{ .Values.csi_node_driver_registrar.image.pullPolicy }}
args:
- "--csi-address=/csi/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/csi.huawei.com/csi.sock"
resources:
{{- toYaml .Values.csi_node_driver_registrar.resources | nindent 12 }}
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration

- name: huawei-csi-driver
image: "{{ .Values.csi_driver.image.repository }}:{{ .Values.csi_driver.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.csi_driver.image.pullPolicy }}
args:
- "--endpoint=/csi/csi.sock"
- "--containerized"
resources:
{{- toYaml .Values.csi_driver.node.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.csi_driver.node.securityContext | nindent 12 }}
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -f /csi/csi.sock"]
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: pods-dir
mountPath: /var/lib/kubelet
mountPropagation: "Bidirectional"
- name: etc-dir
mountPath: /etc
- name: log-dir
mountPath: /var/log
- name: dev-dir
mountPath: /dev
mountPropagation: "HostToContainer"
- name: iscsi-dir
mountPath: /var/lib/iscsi
- name: config-map
mountPath: /etc/huawei

volumes:
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi.huawei.com
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry
type: Directory
- name: pods-dir
hostPath:
path: /var/lib/kubelet
type: Directory
- name: etc-dir
hostPath:
path: /etc
type: Directory
- name: dev-dir
hostPath:
path: /dev
type: Directory
- name: iscsi-dir
hostPath:
path: /var/lib/iscsi
type: Directory
- name: log-dir
hostPath:
path: /var/log/
type: Directory
- name: config-map
configMap:
name: {{ include "huawei-csi-plugin.fullname" . }}

{{- with .Values.node.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.node.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.node.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 0b75f53

Please sign in to comment.