Skip to content
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
10 changes: 10 additions & 0 deletions .github/workflows/build-installer-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@ jobs:
exit 1
else
echo "No uncommitted changes detected in dist/install.yaml. The file is properly committed."
fi

if [[ -n $(git status --porcelain chart/) ]]; then
echo "::error::Running 'make build-chart' produced changes to chart/ that aren't committed to the repository."
echo "Please run 'make build-chart' locally and commit the changes to chart/ before pushing."
git status chart/
git diff chart
exit 1
else
echo "No uncommitted changes detected in chart/. The dir is properly committed."
fi
23 changes: 23 additions & 0 deletions chart/.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/
21 changes: 21 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: chart
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
62 changes: 62 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "chart.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 "chart.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 "chart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "chart.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "chart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
98 changes: 98 additions & 0 deletions chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "chart.fullname" . }}-z-prometheus-node-exporter
labels:
app.kubernetes.io/component: metrics
app.kubernetes.io/part-of: dz-prometheus-node-exporter
{{- include "chart.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/instance: node-exporter
app.kubernetes.io/name: dz-prometheus-node-exporter
{{- include "chart.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app.kubernetes.io/component: metrics
app.kubernetes.io/instance: node-exporter
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: dz-prometheus-node-exporter
app.kubernetes.io/part-of: dz-prometheus-node-exporter
app.kubernetes.io/version: 1.7.0
helm.sh/chart: prometheus-node-exporter-4.24.0
{{- include "chart.selectorLabels" . | nindent 8 }}
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
spec:
automountServiceAccountToken: false
containers:
- args: {{- toYaml .Values.zPrometheusNodeExporter.nodeExporter.args | nindent 8
}}
env:
- name: HOST_IP
value: {{ quote .Values.zPrometheusNodeExporter.nodeExporter.env.hostIp }}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
image: {{ .Values.zPrometheusNodeExporter.nodeExporter.image.repository }}:{{ .Values.zPrometheusNodeExporter.nodeExporter.image.tag
| default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.zPrometheusNodeExporter.nodeExporter.imagePullPolicy
}}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9101
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: node-exporter
ports:
- containerPort: 9101
name: metrics
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9101
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources: {}
securityContext: {{- toYaml .Values.zPrometheusNodeExporter.nodeExporter.containerSecurityContext
| nindent 10 }}
volumeMounts:
- mountPath: /host/proc
name: proc
readOnly: true
- mountPath: /host/sys
name: sys
readOnly: true
- mountPath: /host/root
mountPropagation: HostToContainer
name: root
readOnly: true
hostNetwork: true
hostPID: true
nodeSelector: {{- toYaml .Values.zPrometheusNodeExporter.nodeSelector | nindent 8
}}
securityContext: {{- toYaml .Values.zPrometheusNodeExporter.podSecurityContext |
nindent 8 }}
serviceAccountName: {{ include "chart.fullname" . }}-z-prometheus-node-exporter
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- hostPath:
path: /proc
name: proc
- hostPath:
path: /sys
name: sys
- hostPath:
path: /
name: root
Loading
Loading