Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[WIP] Helm chart file changes for csi block plugin #334

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions charts/csiplugin-block/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "csipluginProvisioner.name" -}}
{{- default .Chart.Name .Values.csipluginProvisioner.name | trunc 63 | trimSuffix "-" -}}
{{- define "csiProvisioner.name" -}}
{{- default .Chart.Name .Values.csiProvisioner.name | 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).
*/}}
{{- define "csipluginProvisioner.fullname" -}}
{{- define "csiProvisioner.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csipluginProvisioner.name | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csiProvisioner.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{- define "csipluginAttacher.name" -}}
{{- default .Chart.Name .Values.csipluginAttacher.name | trunc 63 | trimSuffix "-" -}}
{{- define "csiAttacher.name" -}}
{{- default .Chart.Name .Values.csiAttacher.name | 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).
*/}}
{{- define "csipluginAttacher.fullname" -}}
{{- define "csiAttacher.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csipluginAttacher.name | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csiAttacher.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{- define "csipluginNodeplugin.name" -}}
{{- default .Chart.Name .Values.csipluginNodeplugin.name | trunc 63 | trimSuffix "-" -}}
{{- define "csiNodeplugin.name" -}}
{{- default .Chart.Name .Values.csiNodeplugin.name | 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).
*/}}
{{- define "csipluginNodeplugin.fullname" -}}
{{- define "csiNodeplugin.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csipluginNodeplugin.name | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csiNodeplugin.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{- define "csipluginSnapshotter.name" -}}
{{- default .Chart.Name .Values.csipluginSnapshotter.name | trunc 63 | trimSuffix "-" -}}
{{- define "csiSnapshotter.name" -}}
{{- default .Chart.Name .Values.csiSnapshotter.name | 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).
*/}}
{{- define "csipluginSnapshotter.fullname" -}}
{{- define "csiSnapshotter.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csipluginSnapshotter.name | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.csiSnapshotter.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
33 changes: 17 additions & 16 deletions charts/csiplugin-block/templates/csi-attacher-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
kind: Service
apiVersion: v1
metadata:
name: {{ .Values.csipluginAttacher.name }}
name: {{ .Values.csiAttacher.name }}
labels:
app: {{ template "csipluginAttacher.fullname" . }}
app: {{ template "csiAttacher.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "csipluginAttacher.fullname" . }}
app: {{ template "csiAttacher.fullname" . }}
release: {{ .Release.Name }}
ports:
- name: dummy
Expand All @@ -22,44 +22,45 @@ spec:
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: {{ template "csipluginAttacher.fullname" . }}
name: {{ template "csiAttacher.fullname" . }}
labels:
app: {{ template "csipluginAttacher.fullname" . }}
app: {{ template "csiAttacher.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
serviceName: {{ .Values.csipluginAttacher.name }}
replicas: {{ .Values.csipluginAttacher.replicaCount }}
serviceName: {{ .Values.csiAttacher.name }}
replicas: {{ .Values.csiAttacher.replicaCount }}
selector:
matchLabels:
app: {{ template "csipluginAttacher.fullname" . }}
app: {{ template "csiAttacher.fullname" . }}
release: {{ .Release.Name }}
template:
metadata:
name: {{ template "csipluginAttacher.fullname" . }}
name: {{ template "csiAttacher.fullname" . }}
labels:
app: {{ template "csipluginAttacher.fullname" . }}
app: {{ template "csiAttacher.fullname" . }}
release: {{ .Release.Name }}
spec:
serviceAccount: csi-attacher-block
containers:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.1.1
image: "{{ .Values.csiAttacher.image.repository }}:{{ .Values.csiAttacher.image.tag }}"
imagePullPolicy: {{ .Values.csiAttacher.image.pullPolicy }}
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: iscsi-dir
mountPath: /etc/iscsi/
- name: cluster-driver-registrar
image: quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1
image: "{{ .Values.csiClusterDriverRegistrar.image.repository }}:{{ .Values.csiClusterDriverRegistrar.image.tag }}"
imagePullPolicy: {{ .Values.csiClusterDriverRegistrar.image.pullPolicy }}
args:
- "--v=5"
- "--pod-info-mount-version=\"v1\""
Expand All @@ -70,8 +71,9 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: {{ template "csipluginAttacher.fullname" . }}
image: {{ .Values.image }}
- name: {{ template "csiAttacher.fullname" . }}
image: "{{ .Values.opensdsCsiBlockPlugin.image.repository }}:{{ .Values.opensdsCsiBlockPlugin.image.tag }}"
imagePullPolicy: {{ .Values.opensdsCsiBlockPlugin.image.pullPolicy }}
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
Expand Down Expand Up @@ -140,7 +142,6 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin-block
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand Down
9 changes: 2 additions & 7 deletions charts/csiplugin-block/templates/csi-attacher-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# This YAML file contains RBAC API objects,
# which are necessary to run external csi attacher for opensds.

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-attacher-block

---
{{- if .Values.rbac.create }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -47,3 +41,4 @@ roleRef:
kind: ClusterRole
name: external-attacher-runner-block
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This YAML file contains ServiceAccount objects,
# which are necessary to run external csi attacher for opensds.
{{- if .Values.serviceAccounts.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-attacher-block
{{- end }}
20 changes: 10 additions & 10 deletions charts/csiplugin-block/templates/csi-nodeplugin-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ template "csipluginNodeplugin.fullname" . }}
name: {{ template "csiNodeplugin.fullname" . }}
labels:
app: {{ template "csipluginNodeplugin.fullname" . }}
app: {{ template "csiNodeplugin.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ template "csipluginNodeplugin.fullname" . }}
app: {{ template "csiNodeplugin.fullname" . }}
release: {{ .Release.Name }}
template:
metadata:
name: {{ template "csipluginNodeplugin.fullname" . }}
name: {{ template "csiNodeplugin.fullname" . }}
labels:
app: {{ template "csipluginNodeplugin.fullname" . }}
app: {{ template "csiNodeplugin.fullname" . }}
release: {{ .Release.Name }}
spec:
tolerations:
Expand All @@ -29,7 +29,8 @@ spec:
hostNetwork: true
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
image: "{{ .Values.csiNodeplugin.image.repository }}:{{ .Values.csiNodeplugin.image.tag }}"
imagePullPolicy: {{ .Values.csiNodeplugin.image.pullPolicy }}
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
Expand All @@ -41,19 +42,19 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
- name: {{ template "csipluginNodeplugin.fullname" . }}
- name: {{ template "csiNodeplugin.fullname" . }}
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: {{ .Values.image }}
image: "{{ .Values.opensdsCsiBlockPlugin.image.repository }}:{{ .Values.opensdsCsiBlockPlugin.image.tag }}"
imagePullPolicy: {{ .Values.opensdsCsiBlockPlugin.image.pullPolicy }}
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
Expand Down Expand Up @@ -122,7 +123,6 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin-block
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-opensdsplugin-block
Expand Down
9 changes: 2 additions & 7 deletions charts/csiplugin-block/templates/csi-nodeplugin-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# This YAML defines all API objects to create RBAC roles for csi node plugin.

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-nodeplugin-block

---
{{- if .Values.rbac.create }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -42,3 +36,4 @@ roleRef:
kind: ClusterRole
name: csi-nodeplugin-block
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This YAML defines all API objects to create ServiceAccount roles for csi node plugin.
{{- if .Values.serviceAccounts.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-nodeplugin-block
{{- end }}
30 changes: 15 additions & 15 deletions charts/csiplugin-block/templates/csi-provisioner-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
kind: Service
apiVersion: v1
metadata:
name: {{ .Values.csipluginProvisioner.name }}
name: {{ .Values.csiProvisioner.name }}
labels:
app: {{ template "csipluginProvisioner.fullname" . }}
app: {{ template "csiProvisioner.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "csipluginProvisioner.fullname" . }}
app: {{ template "csiProvisioner.fullname" . }}
release: {{ .Release.Name }}
ports:
- name: dummy
Expand All @@ -22,30 +22,31 @@ spec:
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: {{ template "csipluginProvisioner.fullname" . }}
name: {{ template "csiProvisioner.fullname" . }}
labels:
app: {{ template "csipluginProvisioner.fullname" . }}
app: {{ template "csiProvisioner.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
serviceName: {{ .Values.csipluginProvisioner.name }}
replicas: {{ .Values.csipluginProvisioner.replicaCount }}
serviceName: {{ .Values.csiProvisioner.name }}
replicas: {{ .Values.csiProvisioner.replicaCount }}
selector:
matchLabels:
app: {{ template "csipluginProvisioner.fullname" . }}
app: {{ template "csiProvisioner.fullname" . }}
release: {{ .Release.Name }}
template:
metadata:
name: {{ template "csipluginProvisioner.fullname" . }}
name: {{ template "csiProvisioner.fullname" . }}
labels:
app: {{ template "csipluginProvisioner.fullname" . }}
app: {{ template "csiProvisioner.fullname" . }}
release: {{ .Release.Name }}
spec:
serviceAccount: csi-provisioner-block
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.1.0
image: "{{ .Values.csiProvisioner.image.repository }}:{{ .Values.csiProvisioner.image.tag }}"
imagePullPolicy: {{ .Values.csiProvisioner.image.pullPolicy }}
args:
- "--provisioner=csi-opensdsplugin"
- "--csi-address=$(ADDRESS)"
Expand All @@ -54,12 +55,12 @@ spec:
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: {{ template "csipluginProvisioner.fullname" . }}
image: {{ .Values.image }}
- name: {{ template "csiProvisioner.fullname" . }}
image: "{{ .Values.opensdsCsiBlockPlugin.image.repository }}:{{ .Values.opensdsCsiBlockPlugin.image.tag }}"
imagePullPolicy: {{ .Values.opensdsCsiBlockPlugin.image.pullPolicy }}
args :
- "--csiEndpoint=$(CSI_ENDPOINT)"
- "--opensdsEndpoint=$(OPENSDS_ENDPOINT)"
Expand Down Expand Up @@ -123,7 +124,6 @@ spec:
configMapKeyRef:
name: csi-configmap-opensdsplugin-block
key: osuserdomainid
imagePullPolicy: {{ .Values.imagePullPolicy }}
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand Down
9 changes: 2 additions & 7 deletions charts/csiplugin-block/templates/csi-provisioner-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# This YAML file contains RBAC API objects,
# which are necessary to run external csi provisioner for opensds.

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-provisioner-block

---
{{- if .Values.rbac.create }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -55,3 +49,4 @@ roleRef:
kind: ClusterRole
name: external-provisioner-runner-block
apiGroup: rbac.authorization.k8s.io
{{- end }}
Loading