mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
update cephfs helm template to deploy attacher sidecar container in provisioner.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
168468a934
commit
94f7ac3d4e
@ -24,24 +24,6 @@ If release name contains chart name it will be used as a full name.
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- 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 "ceph-csi-cephfs.attacher.fullname" -}}
|
|
||||||
{{- if .Values.attacher.fullnameOverride -}}
|
|
||||||
{{- .Values.attacher.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
||||||
{{- if contains $name .Release.Name -}}
|
|
||||||
{{- printf "%s-%s" .Release.Name .Values.attacher.name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- printf "%s-%s-%s" .Release.Name $name .Values.attacher.name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create a default fully qualified app name.
|
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).
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
@ -85,17 +67,6 @@ Create chart name and version as used by the chart label.
|
|||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create the name of the service account to use
|
|
||||||
*/}}
|
|
||||||
{{- define "ceph-csi-cephfs.serviceAccountName.attacher" -}}
|
|
||||||
{{- if .Values.serviceAccounts.attacher.create -}}
|
|
||||||
{{ default (include "ceph-csi-cephfs.attacher.fullname" .) .Values.serviceAccounts.attacher.name }}
|
|
||||||
{{- else -}}
|
|
||||||
{{ default "default" .Values.serviceAccounts.attacher.name }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
{{- if .Values.rbac.create -}}
|
|
||||||
kind: ClusterRole
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["events"]
|
|
||||||
verbs: ["get", "list", "watch", "update"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["persistentvolumes"]
|
|
||||||
verbs: ["get", "list", "watch", "update"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["nodes"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
- apiGroups: ["storage.k8s.io"]
|
|
||||||
resources: ["volumeattachments"]
|
|
||||||
verbs: ["get", "list", "watch", "update"]
|
|
||||||
- apiGroups: ["csi.storage.k8s.io"]
|
|
||||||
resources: ["csinodeinfos"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
{{- end -}}
|
|
@ -1,20 +0,0 @@
|
|||||||
{{- if .Values.rbac.create -}}
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: {{ include "ceph-csi-cephfs.serviceAccountName.attacher" . }}
|
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
roleRef:
|
|
||||||
kind: ClusterRole
|
|
||||||
name: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
{{- end -}}
|
|
@ -1,18 +0,0 @@
|
|||||||
kind: Service
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
ports:
|
|
||||||
- name: dummy
|
|
||||||
port: 12345
|
|
@ -1,12 +0,0 @@
|
|||||||
{{- if .Values.serviceAccounts.attacher.create -}}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ceph-csi-cephfs.serviceAccountName.attacher" . }}
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
{{- end -}}
|
|
@ -1,60 +0,0 @@
|
|||||||
kind: StatefulSet
|
|
||||||
apiVersion: apps/v1beta1
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
spec:
|
|
||||||
serviceName: {{ include "ceph-csi-cephfs.attacher.fullname" . }}
|
|
||||||
replicas: {{ .Values.attacher.replicas }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
||||||
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
||||||
component: {{ .Values.attacher.name }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
spec:
|
|
||||||
serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.attacher" . }}
|
|
||||||
containers:
|
|
||||||
- name: csi-cephfsplugin-attacher
|
|
||||||
image: "{{ .Values.attacher.image.repository }}:{{ .Values.attacher.image.tag }}"
|
|
||||||
args:
|
|
||||||
- "--v=5"
|
|
||||||
- "--csi-address=$(ADDRESS)"
|
|
||||||
env:
|
|
||||||
- name: ADDRESS
|
|
||||||
value: "{{ .Values.socketDir }}/{{ .Values.socketFile }}"
|
|
||||||
imagePullPolicy: {{ .Values.attacher.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: socket-dir
|
|
||||||
mountPath: {{ .Values.socketDir }}
|
|
||||||
resources:
|
|
||||||
{{ toYaml .Values.attacher.resources | indent 12 }}
|
|
||||||
volumes:
|
|
||||||
- name: socket-dir
|
|
||||||
hostPath:
|
|
||||||
path: {{ .Values.socketDir }}
|
|
||||||
type: DirectoryOrCreate
|
|
||||||
{{- if .Values.attacher.affinity -}}
|
|
||||||
affinity:
|
|
||||||
{{ toYaml .Values.attacher.affinity . | indent 8 }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if .Values.attacher.nodeSelector -}}
|
|
||||||
nodeSelector:
|
|
||||||
{{ toYaml .Values.attacher.nodeSelector | indent 8 }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if .Values.attacher.tolerations -}}
|
|
||||||
tolerations:
|
|
||||||
{{ toYaml .Values.attacher.tolerations | indent 8 }}
|
|
||||||
{{- end -}}
|
|
@ -28,10 +28,13 @@ rules:
|
|||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["events"]
|
resources: ["events"]
|
||||||
verbs: ["list", "watch", "create", "update", "patch"]
|
verbs: ["list", "watch", "create", "update", "patch"]
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["configmaps"]
|
|
||||||
verbs: ["get", "list", "create", "delete"]
|
|
||||||
- apiGroups: ["csi.storage.k8s.io"]
|
- apiGroups: ["csi.storage.k8s.io"]
|
||||||
resources: ["csinodeinfos"]
|
resources: ["csinodeinfos"]
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["nodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["volumeattachments"]
|
||||||
|
verbs: ["get", "list", "watch", "update"]
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -41,6 +41,18 @@ spec:
|
|||||||
mountPath: {{ .Values.socketDir }}
|
mountPath: {{ .Values.socketDir }}
|
||||||
resources:
|
resources:
|
||||||
{{ toYaml .Values.provisioner.resources | indent 12 }}
|
{{ toYaml .Values.provisioner.resources | indent 12 }}
|
||||||
|
- name: csi-attacher
|
||||||
|
image: "{{ .Values.attacher.image.repository }}:{{ .Values.attacher.image.tag }}"
|
||||||
|
args:
|
||||||
|
- "--v=5"
|
||||||
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
env:
|
||||||
|
- name: ADDRESS
|
||||||
|
value: "{{ .Values.socketDir }}/{{ .Values.socketFile }}"
|
||||||
|
imagePullPolicy: {{ .Values.attacher.image.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: {{ .Values.socketDir }}
|
||||||
- name: csi-cephfsplugin
|
- name: csi-cephfsplugin
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
Loading…
Reference in New Issue
Block a user