Add OpenEBS v4.6.1 with images repointed to ghcr.io/wrktalk-tech - Loki and Alloy disabled
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
The OpenEBS ZFS LocalPV has been installed. Check its status by running:
|
||||
$ kubectl get pods -n {{ .Release.Namespace }} -l role=openebs-zfs
|
||||
|
||||
For more information, visit our Slack at https://openebs.io/community or view
|
||||
the documentation online at http://docs.openebs.io/.
|
||||
@@ -0,0 +1,211 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "zfslocalpv.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified localpv provisioner 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 "zfslocalpv.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 "zfslocalpv.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Create the name of the service account for controller
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.zfsController.create }}
|
||||
{{- default (include "zfslocalpv.fullname" .) .Values.serviceAccount.zfsController.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.zfsController.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.zfsNode.create }}
|
||||
{{- default (include "zfslocalpv.fullname" .) .Values.serviceAccount.zfsNode.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.zfsNode.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Define meta labels for openebs zfs-localpv components
|
||||
*/}}
|
||||
{{- define "zfslocalpv.common.metaLabels" -}}
|
||||
{{- if or (not (hasKey .Values "enableHelmMetaLabels")) .Values.enableHelmMetaLabels -}}
|
||||
chart: {{ template "zfslocalpv.chart" . }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{ end -}}
|
||||
openebs.io/version: {{ .Chart.AppVersion | quote }}
|
||||
role: {{ .Values.role | quote }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create match labels for openebs zfs-localpv controller
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.matchLabels" -}}
|
||||
app: {{ .Values.zfsController.componentName | quote }}
|
||||
{{ if or (not (hasKey .Values "enableHelmMetaLabels")) .Values.enableHelmMetaLabels -}}
|
||||
release: {{ .Release.Name }}
|
||||
{{ end -}}
|
||||
component: {{ .Values.zfsController.componentName | quote }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create component labels for zfslocalpv controller
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.componentLabels" -}}
|
||||
openebs.io/component-name: {{ .Values.zfsController.componentName | quote }}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Create labels for openebs zfs-localpv controller
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.labels" -}}
|
||||
{{ include "zfslocalpv.common.metaLabels" . }}
|
||||
{{ include "zfslocalpv.zfsController.matchLabels" . }}
|
||||
{{ include "zfslocalpv.zfsController.componentLabels" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create match labels for openebs zfs-localpv node daemon
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.matchLabels" -}}
|
||||
name: {{ .Values.zfsNode.componentName | quote }}{{ if or (not (hasKey .Values "enableHelmMetaLabels")) .Values.enableHelmMetaLabels }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create component labels openebs zfs-localpv node daemon
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.componentLabels" -}}
|
||||
app: {{ .Values.zfsNode.componentName | quote }}
|
||||
openebs.io/component-name: {{ .Values.zfsNode.componentName | quote }}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Create labels for openebs zfs-localpv node daemon
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.labels" -}}
|
||||
{{ include "zfslocalpv.common.metaLabels" . }}
|
||||
{{ include "zfslocalpv.zfsNode.matchLabels" . }}
|
||||
{{ include "zfslocalpv.zfsNode.componentLabels" . }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the priority class for csi node plugin
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.priorityClassName" -}}
|
||||
{{- if .Values.zfsNode.priorityClass.create }}
|
||||
{{- printf "%s-%s" .Release.Name .Values.zfsNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.zfsNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the priority class for csi controller plugin
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.priorityClassName" -}}
|
||||
{{- if .Values.zfsController.priorityClass.create }}
|
||||
{{- printf "%s-%s" .Release.Name .Values.zfsController.priorityClass.name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.zfsController.priorityClass.name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Enable zfsController containers leader election if replicas > 1
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsController.leaderElection" -}}
|
||||
{{- with .Values.zfsController.replicas | int }}
|
||||
{{- if gt . 1 }}
|
||||
- "--leader-election"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Ensure that the path to kubelet ends with a slash
|
||||
*/}}
|
||||
{{- define "zfslocalpv.zfsNode.kubeletDir" -}}
|
||||
{{- printf "%s/" (default .Values.zfsNode.kubeletDir .Values.global.kubeletDir | trimSuffix "/") -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Creates the image URL ie registry/repository:tag
|
||||
*/}}
|
||||
{{- define "zfslocalpv.common.image" -}}
|
||||
{{- $registryName := default .imageRoot.registry ((.global).imageRegistry) | trimSuffix "/" -}}
|
||||
{{- $repositoryName := .imageRoot.repository -}}
|
||||
{{- $termination := .imageRoot.tag | toString -}}
|
||||
{{- if $registryName }}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $termination -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s:%s" $repositoryName $termination -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Concatenates imagepullsecrets and handles different formats (example - secret or - name: secret)
|
||||
*/}}
|
||||
{{- define "zfslocalpv.common.pullSecrets" -}}
|
||||
{{- $names := list -}}
|
||||
{{- with .Values.global.imagePullSecrets -}}
|
||||
{{- range . -}}
|
||||
{{- if kindIs "map" . }}
|
||||
{{- if and (hasKey . "name") (not (empty .name)) -}}
|
||||
{{ $names = append $names .name }}
|
||||
{{- end -}}
|
||||
{{- else if not (empty .) -}}
|
||||
{{ $names = append $names . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with .Values.imagePullSecrets -}}
|
||||
{{- range . }}
|
||||
{{- if kindIs "map" . -}}
|
||||
{{- if and (hasKey . "name") (not (empty .name)) -}}
|
||||
{{- $names = append $names .name }}
|
||||
{{- end -}}
|
||||
{{- else if not (empty .) -}}
|
||||
{{- $names = append $names . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $names = uniq $names -}}
|
||||
{{- if $names -}}
|
||||
{{- range $names }}
|
||||
- name: {{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,17 @@
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: openebs-zfspv-bin
|
||||
namespace: {{ .Release.Namespace }} # should be the same namespace where it is getting mounted
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
data:
|
||||
zfs: |
|
||||
#!/bin/sh
|
||||
if [ -x /host/sbin/zfs ]; then
|
||||
chroot /host /sbin/zfs "$@"
|
||||
elif [ -x /host/usr/sbin/zfs ]; then
|
||||
chroot /host /usr/sbin/zfs "$@"
|
||||
else
|
||||
chroot /host "{{ .Values.zfs.bin }}" "$@"
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
# Create the CSI Driver object
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: CSIDriver
|
||||
metadata:
|
||||
name: zfs.csi.openebs.io
|
||||
spec:
|
||||
# do not require volumeattachment
|
||||
attachRequired: false
|
||||
podInfoOnMount: false
|
||||
storageCapacity: {{ .Values.feature.storageCapacity }}
|
||||
@@ -0,0 +1,19 @@
|
||||
{{- if .Values.zfsController.priorityClass.create }}
|
||||
apiVersion: scheduling.k8s.io/v1
|
||||
kind: PriorityClass
|
||||
metadata:
|
||||
name: {{ template "zfslocalpv.zfsController.priorityClassName" . }}
|
||||
value: 900000000
|
||||
globalDefault: false
|
||||
description: "This priority class should be used for the CStor CSI driver controller deployment only."
|
||||
{{- end }}
|
||||
---
|
||||
{{- if .Values.zfsNode.priorityClass.create }}
|
||||
apiVersion: scheduling.k8s.io/v1
|
||||
kind: PriorityClass
|
||||
metadata:
|
||||
name: {{ template "zfslocalpv.zfsNode.priorityClassName" . }}
|
||||
value: 900001000
|
||||
globalDefault: false
|
||||
description: "This priority class should be used for the CStor CSI driver node deployment only."
|
||||
{{- end }}
|
||||
@@ -0,0 +1,24 @@
|
||||
{{- if .Values.rbac.pspEnabled }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: openebs-zfs-node-psp
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
spec:
|
||||
privileged: true
|
||||
allowPrivilegeEscalation: true
|
||||
allowedCapabilities: ['*']
|
||||
volumes: ['*']
|
||||
hostNetwork: true
|
||||
hostIPC: true
|
||||
hostPID: true
|
||||
runAsUser:
|
||||
rule: 'RunAsAny'
|
||||
seLinux:
|
||||
rule: 'RunAsAny'
|
||||
supplementalGroups:
|
||||
rule: 'RunAsAny'
|
||||
fsGroup:
|
||||
rule: 'RunAsAny'
|
||||
{{- end }}
|
||||
@@ -0,0 +1,200 @@
|
||||
{{- if .Values.serviceAccount.zfsController.create -}}
|
||||
kind: ServiceAccount
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.zfsController.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-provisioner-role
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["namespaces"]
|
||||
verbs: ["*"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumes", "services"]
|
||||
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims"]
|
||||
verbs: ["get", "list", "watch", "update"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims/status"]
|
||||
verbs: ["update", "patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["storageclasses", "csinodes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [ "storage.k8s.io" ]
|
||||
resources: [ "csistoragecapacities"]
|
||||
verbs: ["*"]
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["list", "watch", "create", "update", "patch"]
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
- apiGroups: ["*"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
|
||||
verbs: ["*"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-provisioner-binding
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccount.zfsController.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: openebs-zfs-provisioner-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-snapshotter-role
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["storageclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["list", "watch", "create", "update", "patch"]
|
||||
- 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: ["volumesnapshots"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents/status"]
|
||||
verbs: ["update", "patch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshots/status"]
|
||||
verbs: ["update"]
|
||||
- apiGroups: ["apiextensions.k8s.io"]
|
||||
resources: ["customresourcedefinitions"]
|
||||
verbs: ["create", "list", "watch", "delete"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-snapshotter-binding
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccount.zfsController.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: openebs-zfs-snapshotter-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
{{ end }}
|
||||
{{- if .Values.serviceAccount.zfsNode.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.zfsNode.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-driver-registrar-role
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumes", "nodes", "services"]
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups: ["*"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-driver-registrar-binding
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccount.zfsNode.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: openebs-zfs-driver-registrar-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
{{- if .Values.rbac.pspEnabled }}
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: openebs-zfs-node-role
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: ['policy']
|
||||
resources: ['podsecuritypolicies']
|
||||
verbs: ['use']
|
||||
resourceNames:
|
||||
- openebs-zfs-node-psp
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: openebs-zfs-node-binding
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: openebs-zfs-node-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccount.zfsNode.name }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,193 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "zfslocalpv.fullname" . }}-controller
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.zfsController.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "zfslocalpv.zfsController.matchLabels" . | nindent 6 }}
|
||||
replicas: {{ .Values.zfsController.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.zfsController.podAnnotations }}
|
||||
annotations: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsController.labels" . | nindent 8 -}}
|
||||
{{- with .Values.zfsController.podLabels}}
|
||||
{{ toYaml . | nindent 8 -}}
|
||||
{{- end}}
|
||||
{{- with .Values.loggingLabels}}
|
||||
{{ toYaml . | nindent 8 -}}
|
||||
{{- end}}
|
||||
spec:
|
||||
{{- if .Values.zfsController.priorityClass.create }}
|
||||
priorityClassName: {{ template "zfslocalpv.zfsController.priorityClassName" . }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.zfsController.name }}
|
||||
{{- if .Values.zfsController.initContainers }}
|
||||
initContainers:
|
||||
{{- if eq (kindOf .Values.zfsController.initContainers) "slice" }}
|
||||
{{ toYaml .Values.zfsController.initContainers | indent 10 }}
|
||||
{{- else }}
|
||||
{{- range $key, $value := .Values.zfsController.initContainers }}
|
||||
- name: {{ $key }}
|
||||
{{ toYaml $value | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Values.zfsController.resizer.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsController.resizer.image "global" .Values.global) | quote }}
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
{{- include "zfslocalpv.zfsController.leaderElection" . | indent 12 }}
|
||||
{{- range .Values.zfsController.resizer.extraArgs }}
|
||||
- {{ tpl . $ | quote }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
||||
imagePullPolicy: {{ default .Values.zfsController.resizer.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /var/lib/csi/sockets/pluginproxy/
|
||||
resources:
|
||||
{{- toYaml .Values.zfsController.resources | nindent 12 }}
|
||||
- name: {{ .Values.zfsController.snapshotter.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsController.snapshotter.image "global" .Values.global) | quote }}
|
||||
imagePullPolicy: {{ default .Values.zfsController.snapshotter.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
{{- include "zfslocalpv.zfsController.leaderElection" . | indent 12 }}
|
||||
{{- range .Values.zfsController.snapshotter.extraArgs }}
|
||||
- {{ tpl . $ | quote }}
|
||||
{{- 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.zfsController.resources | nindent 12 }}
|
||||
{{- if .Values.zfsController.snapshotController.enabled }}
|
||||
- name: {{ .Values.zfsController.snapshotController.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsController.snapshotController.image "global" .Values.global) | quote }}
|
||||
args:
|
||||
- "--v=5"
|
||||
{{- include "zfslocalpv.zfsController.leaderElection" . | indent 12 }}
|
||||
{{- range .Values.zfsController.snapshotController.extraArgs }}
|
||||
- {{ tpl . $ | quote }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ default .Values.zfsController.snapshotController.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
resources:
|
||||
{{- toYaml .Values.zfsController.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
- name: {{ .Values.zfsController.provisioner.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsController.provisioner.image "global" .Values.global) | quote }}
|
||||
imagePullPolicy: {{ default .Values.zfsController.provisioner.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v=5"
|
||||
- "--feature-gates=Topology=true"
|
||||
- "--strict-topology"
|
||||
- "--enable-capacity={{ .Values.feature.storageCapacity }}"
|
||||
- "--extra-create-metadata=true"
|
||||
- "--default-fstype=ext4"
|
||||
{{- include "zfslocalpv.zfsController.leaderElection" . | indent 12 }}
|
||||
{{- range .Values.zfsController.provisioner.extraArgs }}
|
||||
- {{ tpl . $ | quote }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
||||
- name: NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /var/lib/csi/sockets/pluginproxy/
|
||||
resources:
|
||||
{{- toYaml .Values.zfsController.resources | nindent 12 }}
|
||||
- name: {{ .Values.zfsPlugin.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsPlugin.image "global" .Values.global) | quote }}
|
||||
imagePullPolicy: {{ default .Values.zfsPlugin.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
env:
|
||||
- name: OPENEBS_CONTROLLER_DRIVER
|
||||
value: controller
|
||||
- name: OPENEBS_CSI_ENDPOINT
|
||||
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
|
||||
- name: OPENEBS_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: OPENEBS_IO_INSTALLER_TYPE
|
||||
value: "{{ if (not (hasKey .Values.analytics "installerType")) }}zfs-localpv-helm{{ else }}{{ .Values.analytics.installerType }}{{ end }}"
|
||||
- name: OPENEBS_IO_ENABLE_ANALYTICS
|
||||
{{- if kindIs "bool" .Values.global.analytics.enabled }}
|
||||
value: "{{ .Values.global.analytics.enabled }}"
|
||||
{{- else}}
|
||||
value: "{{ .Values.analytics.enabled }}"
|
||||
{{- end}}
|
||||
{{- if .Values.global.analytics.gaId }}
|
||||
- name: GA_ID
|
||||
value: {{ .Values.global.analytics.gaId | quote }}
|
||||
{{- else if .Values.analytics.gaId }}
|
||||
- name: GA_ID
|
||||
value: {{ .Values.analytics.gaId | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.analytics.gaKey }}
|
||||
- name: GA_KEY
|
||||
value: {{ .Values.global.analytics.gaKey | quote }}
|
||||
{{- else if .Values.analytics.gaKey }}
|
||||
- name: GA_KEY
|
||||
value: {{ .Values.analytics.gaKey | quote }}
|
||||
{{- end }}
|
||||
- name: OPENEBS_IO_ENABLE_BACKUP_GC
|
||||
value: "{{ .Values.backupGC.enabled }}"
|
||||
args :
|
||||
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
|
||||
- "--plugin=$(OPENEBS_CONTROLLER_DRIVER)"
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /var/lib/csi/sockets/pluginproxy/
|
||||
resources:
|
||||
{{- toYaml .Values.zfsController.resources | nindent 12 }}
|
||||
volumes:
|
||||
- name: socket-dir
|
||||
emptyDir: {}
|
||||
{{- if .Values.zfsController.additionalVolumes }}
|
||||
{{- range $name, $config := .Values.zfsController.additionalVolumes }}
|
||||
- name: {{ $name }}
|
||||
{{- tpl (toYaml $config) $ | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if or .Values.global.imagePullSecrets .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- include "zfslocalpv.common.pullSecrets" . | indent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsController.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.zfsController.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsController.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.zfsController.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsController.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.zfsController.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,183 @@
|
||||
kind: DaemonSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: {{ template "zfslocalpv.fullname" . }}-node
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.zfsNode.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "zfslocalpv.zfsNode.matchLabels" . | nindent 6 }}
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 100%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.zfsNode.podAnnotations }}
|
||||
annotations: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "zfslocalpv.zfsNode.labels" . | nindent 8 }}
|
||||
{{- with .Values.zfsNode.podLabels}}
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end}}
|
||||
{{- with .Values.loggingLabels}}
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end}}
|
||||
spec:
|
||||
{{- if .Values.zfsNode.priorityClass.create }}
|
||||
priorityClassName: {{ template "zfslocalpv.zfsNode.priorityClassName" . }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.zfsNode.name }}
|
||||
hostNetwork: true
|
||||
{{- if .Values.zfsNode.initContainers }}
|
||||
initContainers:
|
||||
{{- if eq (kindOf .Values.zfsNode.initContainers) "slice" }}
|
||||
{{ toYaml .Values.zfsNode.initContainers | indent 10 }}
|
||||
{{- else }}
|
||||
{{- range $key, $value := .Values.zfsNode.initContainers }}
|
||||
- name: {{ $key }}
|
||||
{{ toYaml $value | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Values.zfsNode.driverRegistrar.name }}
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsNode.driverRegistrar.image "global" .Values.global) | quote }}
|
||||
imagePullPolicy: {{ default .Values.zfsNode.driverRegistrar.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command: ["/bin/sh", "-c", "rm -rf /registration/zfs-localpv /registration/zfs-localpv-reg.sock"]
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /plugin/csi.sock
|
||||
- name: DRIVER_REG_SOCK_PATH
|
||||
value: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins/zfs-localpv/csi.sock" | quote }}
|
||||
- name: KUBE_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: NODE_DRIVER
|
||||
value: openebs-zfs
|
||||
volumeMounts:
|
||||
- name: plugin-dir
|
||||
mountPath: /plugin
|
||||
- name: registration-dir
|
||||
mountPath: /registration
|
||||
resources:
|
||||
{{- toYaml .Values.zfsNode.resources | nindent 12 }}
|
||||
- name: {{ .Values.zfsPlugin.name }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
allowPrivilegeEscalation: true
|
||||
image: {{ include "zfslocalpv.common.image" (dict "imageRoot" .Values.zfsPlugin.image "global" .Values.global) | quote }}
|
||||
imagePullPolicy: {{ default .Values.zfsPlugin.image.pullPolicy .Values.global.imagePullPolicy }}
|
||||
args:
|
||||
- "--nodename=$(OPENEBS_NODE_NAME)"
|
||||
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
|
||||
- "--plugin=$(OPENEBS_NODE_DRIVER)"
|
||||
{{- range $fstype, $options := .Values.zfsNode.defaultFormatOptions }}
|
||||
{{- if $options }}
|
||||
- "--default-format-options={{ $fstype }}={{ $options }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: OPENEBS_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: OPENEBS_CSI_ENDPOINT
|
||||
value: unix:///plugin/csi.sock
|
||||
- name: OPENEBS_NODE_DRIVER
|
||||
value: agent
|
||||
- name: OPENEBS_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: ALLOWED_TOPOLOGIES
|
||||
value: "{{ .Values.zfsNode.allowedTopologyKeys }}"
|
||||
volumeMounts:
|
||||
- name: plugin-dir
|
||||
mountPath: /plugin
|
||||
- name: device-dir
|
||||
mountPath: /dev
|
||||
- name: encr-keys
|
||||
mountPath: /home/keys
|
||||
- name: chroot-zfs
|
||||
mountPath: /sbin/zfs
|
||||
subPath: zfs
|
||||
- name: host-root
|
||||
mountPath: /host
|
||||
mountPropagation: "HostToContainer"
|
||||
readOnly: true
|
||||
- name: pods-mount-dir
|
||||
mountPath: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }}
|
||||
# needed so that any mounts setup inside this container are
|
||||
# propagated back to the host machine.
|
||||
mountPropagation: "Bidirectional"
|
||||
resources:
|
||||
{{- toYaml .Values.zfsNode.resources | nindent 12 }}
|
||||
volumes:
|
||||
- name: device-dir
|
||||
hostPath:
|
||||
path: /dev
|
||||
type: Directory
|
||||
- name: encr-keys
|
||||
hostPath:
|
||||
path: {{ .Values.zfsNode.encrKeysDir }}
|
||||
type: DirectoryOrCreate
|
||||
- name: chroot-zfs
|
||||
configMap:
|
||||
defaultMode: 0555
|
||||
name: openebs-zfspv-bin
|
||||
- name: host-root
|
||||
hostPath:
|
||||
path: /
|
||||
type: Directory
|
||||
- name: registration-dir
|
||||
hostPath:
|
||||
path: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins_registry/" | quote }}
|
||||
type: DirectoryOrCreate
|
||||
- name: plugin-dir
|
||||
hostPath:
|
||||
path: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins/zfs-localpv/" | quote }}
|
||||
type: DirectoryOrCreate
|
||||
- name: pods-mount-dir
|
||||
hostPath:
|
||||
path: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }}
|
||||
type: Directory
|
||||
{{- if .Values.zfsNode.additionalVolumes }}
|
||||
{{- range $name, $config := .Values.zfsNode.additionalVolumes }}
|
||||
- name: {{ $name }}
|
||||
{{- tpl (toYaml $config) $ | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if or .Values.global.imagePullSecrets .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- include "zfslocalpv.common.pullSecrets" . | indent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsNode.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.zfsNode.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsNode.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.zfsNode.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsNode.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.zfsNode.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.zfsNode.dnsPolicy }}
|
||||
dnsPolicy: {{ .Values.zfsNode.dnsPolicy }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user