디렉토리 구조 및 각 서비스 추가

This commit is contained in:
dsk-minchulahn
2024-01-03 17:29:11 +09:00
parent 98de2a7627
commit d601d0f259
1632 changed files with 207616 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
The OpenEBS Node Disk Manager has been installed. Check its status by running:
$ kubectl get pods -n {{ .Release.Namespace }}
Use `kubectl get bd -n {{ .Release.Namespace }} ` to see the list of
blockdevices attached to the Kubernetes cluster nodes.
For more information, visit our Slack at https://openebs.io/community or view
the documentation online at http://docs.openebs.io/.

View File

@@ -0,0 +1,242 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
This name is used for ndm daemonset
*/}}
{{- define "openebs-ndm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "openebs-ndm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified ndm daemonset 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 "openebs-ndm.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains .Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{- define "openebs-ndm.operator.name" -}}
{{- $ndmName := default .Chart.Name .Values.ndmOperator.nameOverride | trunc 63 | trimSuffix "-" }}
{{- $componentName := .Values.ndmOperator.name | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" $ndmName $componentName | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified ndm operator 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 "openebs-ndm.operator.fullname" -}}
{{- if .Values.ndmOperator.fullnameOverride }}
{{- .Values.ndmOperator.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $ndmOperatorName := include "openebs-ndm.operator.name" .}}
{{- $name := default $ndmOperatorName .Values.ndmOperator.nameOverride }}
{{- if contains .Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{- define "openebs-ndm.cluster-exporter.name" -}}
{{- $ndmName := default .Chart.Name .Values.ndmExporter.clusterExporter.nameOverride | trunc 63 | trimSuffix "-" }}
{{- $componentName := .Values.ndmExporter.clusterExporter.name | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" $ndmName $componentName | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified ndm cluster exporter 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 "openebs-ndm.cluster-exporter.fullname" -}}
{{- if .Values.ndmExporter.clusterExporter.fullnameOverride }}
{{- .Values.ndmExporter.clusterExporter.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $ndmClusterExporterName := include "openebs-ndm.cluster-exporter.name" .}}
{{- $name := default $ndmClusterExporterName .Values.ndmExporter.clusterExporter.nameOverride }}
{{- if contains .Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{- define "openebs-ndm.exporter.name" -}}
{{- $ndmName := .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- $componentName := "exporter" | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" $ndmName $componentName | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "openebs-ndm.node-exporter.name" -}}
{{- $ndmName := default .Chart.Name .Values.ndmExporter.nodeExporter.nameOverride | trunc 63 | trimSuffix "-" }}
{{- $componentName := .Values.ndmExporter.nodeExporter.name | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" $ndmName $componentName | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified ndm node exporter 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 "openebs-ndm.node-exporter.fullname" -}}
{{- if .Values.ndmExporter.nodeExporter.fullnameOverride }}
{{- .Values.ndmExporter.nodeExporter.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $ndmNodeExporterName := include "openebs-ndm.node-exporter.name" .}}
{{- $name := default $ndmNodeExporterName .Values.ndmExporter.nodeExporter.nameOverride }}
{{- if contains .Release.Name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "openebs-ndm.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openebs-ndm.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Define meta labels for ndm components
*/}}
{{- define "openebs-ndm.common.metaLabels" -}}
chart: {{ template "openebs-ndm.chart" . }}
heritage: {{ .Release.Service }}
openebs.io/version: {{ .Values.release.version | quote }}
{{- end -}}
{{/*
Create match labels for ndm daemonset component
*/}}
{{- define "openebs-ndm.matchLabels" -}}
app: {{ template "openebs-ndm.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.ndm.componentName | quote }}
{{- end -}}
{{/*
Create component labels for ndm daemonset component
*/}}
{{- define "openebs-ndm.componentLabels" -}}
openebs.io/component-name: {{ .Values.ndm.componentName | quote }}
{{- end -}}
{{/*
Create labels for ndm daemonset component
*/}}
{{- define "openebs-ndm.labels" -}}
{{ include "openebs-ndm.common.metaLabels" . }}
{{ include "openebs-ndm.matchLabels" . }}
{{ include "openebs-ndm.componentLabels" . }}
{{- end -}}
{{/*
Create match labels for ndm operator deployment
*/}}
{{- define "openebs-ndm.operator.matchLabels" -}}
app: {{ template "openebs-ndm.operator.name" . }}
release: {{ .Release.Name }}
component: {{ default (include "openebs-ndm.operator.name" .) .Values.ndmOperator.componentName }}
{{- end -}}
{{/*
Create component labels for ndm operator component
*/}}
{{- define "openebs-ndm.operator.componentLabels" -}}
openebs.io/component-name: {{ default (include "openebs-ndm.operator.name" .) .Values.ndmOperator.componentName }}
{{- end -}}
{{/*
Create labels for ndm operator component
*/}}
{{- define "openebs-ndm.operator.labels" -}}
{{ include "openebs-ndm.common.metaLabels" . }}
{{ include "openebs-ndm.operator.matchLabels" . }}
{{ include "openebs-ndm.operator.componentLabels" . }}
{{- end -}}
{{/*
Create match labels for ndm cluster exporter deployment
*/}}
{{- define "openebs-ndm.cluster-exporter.matchLabels" -}}
app: {{ template "openebs-ndm.exporter.name" . }}
release: {{ .Release.Name }}
component: {{ default (include "openebs-ndm.cluster-exporter.name" .) .Values.ndmExporter.clusterExporter.componentName }}
{{- end -}}
{{/*
Create component labels for ndm cluster exporter component
*/}}
{{- define "openebs-ndm.cluster-exporter.componentLabels" -}}
openebs.io/component-name: {{ default (include "openebs-ndm.cluster-exporter.name" .) .Values.ndmExporter.clusterExporter.componentName }}
{{- end -}}
{{/*
Create labels for ndm cluster exporter component
*/}}
{{- define "openebs-ndm.cluster-exporter.labels" -}}
{{ include "openebs-ndm.common.metaLabels" . }}
{{ include "openebs-ndm.cluster-exporter.matchLabels" . }}
{{ include "openebs-ndm.cluster-exporter.componentLabels" . }}
{{- end -}}
{{/*
Create match labels for ndm node exporter deployment
*/}}
{{- define "openebs-ndm.node-exporter.matchLabels" -}}
app: {{ template "openebs-ndm.exporter.name" . }}
release: {{ .Release.Name }}
component: {{ default (include "openebs-ndm.node-exporter.name" .) .Values.ndmExporter.nodeExporter.componentName }}
{{- end -}}
{{/*
Create component labels for ndm node exporter component
*/}}
{{- define "openebs-ndm.node-exporter.componentLabels" -}}
openebs.io/component-name: {{ default (include "openebs-ndm.node-exporter.name" .) .Values.ndmExporter.nodeExporter.componentName }}
{{- end -}}
{{/*
Create labels for ndm cluster node component
*/}}
{{- define "openebs-ndm.node-exporter.labels" -}}
{{ include "openebs-ndm.common.metaLabels" . }}
{{ include "openebs-ndm.node-exporter.matchLabels" . }}
{{ include "openebs-ndm.node-exporter.componentLabels" . }}
{{- end -}}

View File

@@ -0,0 +1,18 @@
{{- if and .Values.ndmExporter.enabled .Values.ndmExporter.clusterExporter.metricsPort }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "openebs-ndm.cluster-exporter.fullname" . }}-service
labels:
{{- include "openebs-ndm.cluster-exporter.labels" . | nindent 4 }}
spec:
clusterIP: None
ports:
- name: metrics
port: {{ .Values.ndmExporter.clusterExporter.metricsPort }}
targetPort: {{ .Values.ndmExporter.clusterExporter.metricsPort }}
selector:
{{- with .Values.ndmExporter.clusterExporter.podLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,60 @@
{{- if .Values.ndmExporter.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "openebs-ndm.cluster-exporter.fullname" . }}
labels:
{{- include "openebs-ndm.cluster-exporter.labels" . | nindent 4 }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
{{- include "openebs-ndm.cluster-exporter.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "openebs-ndm.cluster-exporter.labels" . | nindent 8 }}
{{- with .Values.ndmExporter.clusterExporter.podLabels }}
{{ toYaml . }}
{{- end }}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
containers:
- name: {{ template "openebs-ndm.cluster-exporter.fullname" . }}
image: "{{ .Values.ndmExporter.image.registry }}{{ .Values.ndmExporter.image.repository }}:{{ .Values.ndmExporter.image.tag }}"
command:
- /usr/local/bin/exporter
args:
- "start"
- "--mode=cluster"
- "--port=$(METRICS_LISTEN_PORT)"
- "--metrics=/metrics"
ports:
- containerPort: {{ .Values.ndmExporter.clusterExporter.metricsPort }}
protocol: TCP
name: metrics
imagePullPolicy: {{ .Values.ndmExporter.image.pullPolicy }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.ndmExporter.clusterExporter.metricsPort }}
- name: METRICS_LISTEN_PORT
value: :{{ .Values.ndmExporter.clusterExporter.metricsPort }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.ndmExporter.clusterExporter.nodeSelector }}
nodeSelector:
{{ toYaml .Values.ndmExporter.clusterExporter.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.ndmExporter.clusterExporter.tolerations }}
tolerations:
{{ toYaml .Values.ndmExporter.clusterExporter.tolerations | indent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,45 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "openebs-ndm.fullname" . }}-config
data:
# node-disk-manager-config contains config of available probes and filters.
# Probes and Filters will initialize with default values if config for that
# filter or probe are not present in configmap
# udev-probe is default or primary probe it should be enabled to run ndm
# filterconfigs contains configs of filters. To provide a group of include
# and exclude values add it as , separated string
node-disk-manager.config: |
probeconfigs:
- key: udev-probe
name: udev probe
state: {{ .Values.ndm.probes.enableUdevProbe }}
- key: seachest-probe
name: seachest probe
state: {{ .Values.ndm.probes.enableSeachest }}
- key: smart-probe
name: smart probe
state: {{ .Values.ndm.probes.enableSmartProbe }}
filterconfigs:
- key: os-disk-exclude-filter
name: os disk exclude filter
state: {{ .Values.ndm.filters.enableOsDiskExcludeFilter }}
exclude: "{{ .Values.ndm.filters.osDiskExcludePaths }}"
- key: vendor-filter
name: vendor filter
state: {{ .Values.ndm.filters.enableVendorFilter }}
include: ""
exclude: "{{ .Values.ndm.filters.excludeVendors }}"
- key: path-filter
name: path filter
state: {{ .Values.ndm.filters.enablePathFilter }}
include: "{{ .Values.ndm.filters.includePaths }}"
exclude: "{{ .Values.ndm.filters.excludePaths }}"
metaconfigs:
- key: node-labels
name: node labels
pattern: "{{ .Values.ndm.metaConfig.nodeLabelPattern }}"
- key: device-labels
name: device labels
type: "{{ .Values.ndm.metaConfig.deviceLabelTypes }}"

View File

@@ -0,0 +1,179 @@
{{- if .Values.ndm.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "openebs-ndm.fullname" . }}
{{- with .Values.ndm.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "openebs-ndm.labels" . | nindent 4 }}
spec:
updateStrategy:
{{ toYaml .Values.ndm.updateStrategy | indent 4 }}
selector:
matchLabels:
{{- include "openebs-ndm.matchLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.ndm.podAnnotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "openebs-ndm.labels" . | nindent 8 }}
{{- with .Values.ndm.podLabels}}
{{ toYaml . }}
{{- end}}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
{{- if .Values.featureGates.enabled }}
{{- if .Values.featureGates.APIService.enabled }}
hostPID: true
{{- end}}
{{- end}}
containers:
- name: {{ template "openebs-ndm.name" . }}
image: "{{ .Values.ndm.image.registry }}{{ .Values.ndm.image.repository }}:{{ .Values.ndm.image.tag }}"
args:
- -v=4
{{- if .Values.featureGates.enabled }}
{{- if .Values.featureGates.GPTBasedUUID.enabled }}
- --feature-gates={{ .Values.featureGates.GPTBasedUUID.featureGateFlag }}
{{- end}}
{{- if .Values.featureGates.APIService.enabled }}
- --feature-gates={{ .Values.featureGates.APIService.featureGateFlag }}
- --api-service-address={{ .Values.featureGates.APIService.address }}
{{- end}}
{{- if .Values.featureGates.UseOSDisk.enabled }}
- --feature-gates={{ .Values.featureGates.UseOSDisk.featureGateFlag }}
{{- end}}
{{- if .Values.featureGates.ChangeDetection.enabled }}
- --feature-gates={{ .Values.featureGates.ChangeDetection.featureGateFlag }}
{{- end}}
{{- if .Values.featureGates.PartitionTableUUID.enabled }}
- --feature-gates={{ .Values.featureGates.PartitionTableUUID.featureGateFlag }}
{{- end}}
{{- end}}
imagePullPolicy: {{ .Values.ndm.image.pullPolicy }}
resources:
{{ toYaml .Values.ndm.resources | indent 12 }}
securityContext:
privileged: true
env:
# namespace in which NDM is installed will be passed to NDM Daemonset
# as environment variable
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# pass hostname as env variable using downward API to the NDM container
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- if .Values.ndm.sparse }}
{{- if .Values.ndm.sparse.path }}
# specify the directory where the sparse files need to be created.
# if not specified, then sparse files will not be created.
- name: SPARSE_FILE_DIR
value: "{{ .Values.ndm.sparse.path }}"
{{- end }}
{{- if .Values.ndm.sparse.size }}
# Size(bytes) of the sparse file to be created.
- name: SPARSE_FILE_SIZE
value: "{{ .Values.ndm.sparse.size }}"
{{- end }}
{{- if .Values.ndm.sparse.count }}
# Specify the number of sparse files to be created
- name: SPARSE_FILE_COUNT
value: "{{ .Values.ndm.sparse.count }}"
{{- end }}
{{- end }}
# Process name used for matching is limited to the 15 characters
# present in the pgrep output.
# So fullname can be used here with pgrep (cmd is < 15 chars).
livenessProbe:
exec:
command:
- pgrep
- "ndm"
initialDelaySeconds: {{ .Values.ndm.healthCheck.initialDelaySeconds }}
periodSeconds: {{ .Values.ndm.healthCheck.periodSeconds }}
volumeMounts:
- name: config
mountPath: /host/node-disk-manager.config
subPath: node-disk-manager.config
readOnly: true
- name: udev
mountPath: /run/udev
- name: procmount
mountPath: /host/proc
readOnly: true
- name: devmount
mountPath: /dev
- name: basepath
mountPath: /var/openebs/ndm
{{- if .Values.ndm.sparse }}
{{- if .Values.ndm.sparse.path }}
- name: sparsepath
mountPath: {{ .Values.ndm.sparse.path }}
{{- end }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "openebs-ndm.fullname" . }}-config
- name: udev
hostPath:
path: /run/udev
type: Directory
# mount /proc (to access mount file of process 1 of host) inside container
# to read mount-point of disks and partitions
- name: procmount
hostPath:
path: /proc
type: Directory
- name: devmount
# the /dev directory is mounted so that we have access to the devices that
# are connected at runtime of the pod.
hostPath:
path: /dev
type: Directory
- name: basepath
hostPath:
path: "{{ .Values.varDirectoryPath.baseDir }}/ndm"
type: DirectoryOrCreate
{{- if .Values.ndm.sparse }}
{{- if .Values.ndm.sparse.path }}
- name: sparsepath
hostPath:
path: {{ .Values.ndm.sparse.path }}
{{- end }}
{{- end }}
# By default the node-disk-manager will be run on all kubernetes nodes
# If you would like to limit this to only some nodes, say the nodes
# that have storage attached, you could label those node and use
# nodeSelector.
#
# e.g. label the storage nodes with - "openebs.io/nodegroup"="storage-node"
# kubectl label node <node-name> "openebs.io/nodegroup"="storage-node"
#nodeSelector:
# "openebs.io/nodegroup": "storage-node"
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.ndm.nodeSelector }}
nodeSelector:
{{ toYaml .Values.ndm.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.ndm.tolerations }}
tolerations:
{{ toYaml .Values.ndm.tolerations | indent 8 }}
{{- end }}
{{- if .Values.ndm.securityContext }}
securityContext:
{{ toYaml .Values.ndm.securityContext | indent 8 }}
{{- end }}
hostNetwork: true
{{- end }}

View File

@@ -0,0 +1,87 @@
{{- if .Values.ndmOperator.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "openebs-ndm.operator.fullname" . }}
{{- with .Values.ndmOperator.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "openebs-ndm.operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.ndmOperator.replicas }}
strategy:
type: "Recreate"
rollingUpdate: null
selector:
matchLabels:
{{- include "openebs-ndm.operator.matchLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.ndmOperator.podAnnotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "openebs-ndm.operator.labels" . | nindent 8 }}
{{- with .Values.ndmOperator.podLabels}}
{{ toYaml . }}
{{- end}}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
containers:
- name: {{ template "openebs-ndm.operator.fullname" . }}
image: "{{ .Values.ndmOperator.image.registry }}{{ .Values.ndmOperator.image.repository }}:{{ .Values.ndmOperator.image.tag }}"
imagePullPolicy: {{ .Values.ndmOperator.image.pullPolicy }}
resources:
{{ toYaml .Values.ndmOperator.resources | indent 12 }}
livenessProbe:
httpGet:
path: /healthz
port: 8585
initialDelaySeconds: {{ .Values.ndmOperator.healthCheck.initialDelaySeconds }}
periodSeconds: {{ .Values.ndmOperator.healthCheck.periodSeconds }}
readinessProbe:
httpGet:
path: /readyz
port: 8585
initialDelaySeconds: {{ .Values.ndmOperator.readinessCheck.initialDelaySeconds }}
periodSeconds: {{ .Values.ndmOperator.readinessCheck.periodSeconds }}
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: OPERATOR_NAME
value: "node-disk-operator"
- name: CLEANUP_JOB_IMAGE
value: "{{ .Values.helperPod.image.registry }}{{ .Values.helperPod.image.repository }}:{{ .Values.helperPod.image.tag }}"
{{- if .Values.imagePullSecrets }}
- name: OPENEBS_IO_IMAGE_PULL_SECRETS
value: "{{- range $index, $secret := .Values.imagePullSecrets}}{{if $index}},{{end}}{{ $secret.name }}{{- end}}"
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.ndmOperator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.ndmOperator.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.ndmOperator.securityContext }}
securityContext:
{{ toYaml .Values.ndmOperator.securityContext | indent 8 }}
{{- end }}
{{- if .Values.ndmOperator.tolerations }}
tolerations:
{{ toYaml .Values.ndmOperator.tolerations | indent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,18 @@
{{- if and .Values.ndmExporter.enabled .Values.ndmExporter.nodeExporter.metricsPort }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "openebs-ndm.node-exporter.fullname" . }}-service
labels:
{{- include "openebs-ndm.node-exporter.labels" . | nindent 4 }}
spec:
clusterIP: None
ports:
- name: metrics
port: {{ .Values.ndmExporter.nodeExporter.metricsPort }}
targetPort: {{ .Values.ndmExporter.nodeExporter.metricsPort }}
selector:
{{- with .Values.ndmExporter.nodeExporter.podLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,62 @@
{{- if .Values.ndmExporter.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "openebs-ndm.node-exporter.fullname" . }}
labels:
{{- include "openebs-ndm.node-exporter.labels" . | nindent 4 }}
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
{{- include "openebs-ndm.node-exporter.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "openebs-ndm.node-exporter.labels" . | nindent 8 }}
{{- with .Values.ndmExporter.nodeExporter.podLabels }}
{{ toYaml . }}
{{- end }}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
containers:
- name: {{ template "openebs-ndm.node-exporter.fullname" . }}
image: "{{ .Values.ndmExporter.image.registry }}{{ .Values.ndmExporter.image.repository }}:{{ .Values.ndmExporter.image.tag }}"
command:
- /usr/local/bin/exporter
args:
- "start"
- "--mode=node"
- "--port=$(METRICS_LISTEN_PORT)"
- "--metrics=/metrics"
ports:
- containerPort: {{ .Values.ndmExporter.nodeExporter.metricsPort }}
protocol: TCP
name: metrics
imagePullPolicy: {{ .Values.ndmExporter.image.pullPolicy }}
securityContext:
privileged: true
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.ndmExporter.nodeExporter.metricsPort }}
- name: METRICS_LISTEN_PORT
value: :{{ .Values.ndmExporter.nodeExporter.metricsPort }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- if .Values.ndmExporter.nodeExporter.nodeSelector }}
nodeSelector:
{{ toYaml .Values.ndmExporter.nodeExporter.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.ndmExporter.nodeExporter.tolerations }}
tolerations:
{{ toYaml .Values.ndmExporter.nodeExporter.tolerations | indent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,44 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "openebs-ndm.serviceAccountName" . }}
{{- end }}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openebs-ndm.fullname" . }}
rules:
- apiGroups: ["*"]
resources: ["nodes", "pods", "events", "configmaps", "jobs"]
verbs:
- '*'
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs:
- '*'
- apiGroups:
- openebs.io
resources:
- blockdevices
- blockdeviceclaims
verbs:
- '*'
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openebs-ndm.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "openebs-ndm.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
- kind: User
name: system:serviceaccount:default:default
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: {{ include "openebs-ndm.fullname" . }}
apiGroup: rbac.authorization.k8s.io
---