-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Upgrade Helm to Mender Server v4.0
BREAKING CHANGE: See CHANGELOG.md Signed-off-by: Alf-Rune Siqveland <[email protected]>
- Loading branch information
Showing
12 changed files
with
500 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{{- define "mender.container.resources" -}} | ||
{{- if .override.resources }} | ||
{{- .override.resources | toYaml }} | ||
{{- else if .dot.Values.default.resources }} | ||
{{- .dot.Values.default.resources | toYaml }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{- define "mender.container.securityContext" -}} | ||
{{- if .override.containerSecurityContext }} | ||
{{- /* NOTE: respect falsy override.containerSecurityContext.enabled */ -}} | ||
{{- if .override.containerSecurityContext.enabled }} | ||
{{- omit .override.containerSecurityContext "enabled" | toYaml }} | ||
{{- else }} | ||
{{- printf "{}" }} | ||
{{- end }} | ||
{{- else if and .dot.Values.default.containerSecurityContext | ||
.dot.Values.default.containerSecurityContext.enabled }} | ||
{{- omit .dot.Values.default.containerSecurityContext "enabled" | toYaml }} | ||
{{- else }} | ||
{{- printf "{}" }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{- /* Synopsis | ||
{{ include "mender.container" (dict | ||
"dot" . | ||
"component" "<serviceName>" | ||
"override" .Values.<serviceName> | ||
"readinessPath": "optional|/api/internal/v1/.component/health" | ||
"livenessPath": "optional|/api/internal/v1/.component/alive") | ||
}} | ||
Bolierplate Mender service ContainerSpec | ||
*/ -}} | ||
{{- define "mender.container" -}} | ||
image: {{ include "mender.image" . }} | ||
imagePullPolicy: {{ include "mender.imagePullPolicy" . }} | ||
{{- if .args }} | ||
args: {{ splitList " " .args | toYaml | nindent 2 }} | ||
{{- else if and .override.automigrate }} | ||
args: ["server", "--automigrate"] | ||
{{- else }} | ||
args: ["server"] | ||
{{- end }} | ||
{{- if (not .migration) }} | ||
# Readiness/liveness probes | ||
readinessProbe: | ||
httpGet: | ||
path: {{ coalesce .readinessPath (printf "/api/internal/v1/%s/health" .component) }} | ||
port: 8080 | ||
{{- coalesce .override.readinessProbe .dot.Values.default.readinessProbe | | ||
toYaml | | ||
nindent 2 }} | ||
livenessProbe: | ||
httpGet: | ||
path: {{ coalesce .livenessPath (printf "/api/internal/v1/%s/alive" .component) }} | ||
port: 8080 | ||
{{- coalesce .override.livenessProbe .dot.Values.default.livenessProbe | | ||
toYaml | | ||
nindent 2 }} | ||
startupProbe: | ||
httpGet: | ||
path: {{ coalesce .livenessPath (printf "/api/internal/v1/%s/alive" .component) }} | ||
port: 8080 | ||
{{- coalesce .override.startupProbe .dot.Values.default.startupProbe | | ||
toYaml | | ||
nindent 2 }} | ||
{{- end }} | ||
{{- with include "mender.container.resources" . }} | ||
resources: {{- nindent 2 . }} | ||
{{- end }} | ||
securityContext: {{ include "mender.container.securityContext" . }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{{- define "mender.podSecurityContext" -}} | ||
{{- if .override.containerSecurityContext }} | ||
{{- /* NOTE: respect falsy override.containerSecurityContext.enabled */ -}} | ||
{{- if .override.containerSecurityContext.enabled }} | ||
{{- omit .override.containerSecurityContext "enabled" | toYaml }} | ||
{{- else }} | ||
{{- printf "{}" }} | ||
{{- end }} | ||
{{- else if and .dot.Values.default.containerSecurityContext | ||
.dot.Values.default.containerSecurityContext.enabled }} | ||
{{- omit .dot.Values.default.containerSecurityContext "enabled" | toYaml }} | ||
{{- else }} | ||
{{- printf "{}" }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{- /* Synopsis: | ||
{{ include "mender.podSpec" (dict | ||
"dot" . | ||
"component" "<serviceName>" | ||
"override" .Values.<serviceName> | ||
}} | ||
Generates shared boilerplate PodSpec | ||
*/ -}} | ||
{{- define "mender.podSpec" -}} | ||
serviceAccountName: {{ include "mender.serviceAccountName" . }} | ||
{{- with (coalesce .override.affinity .dot.Values.default.affinity) }} | ||
affinity: {{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with (coalesce .override.tolerations .dot.Values.default.tolerations) }} | ||
tolerations: {{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
securityContext: {{ include "mender.podSecurityContext" . | nindent 2}} | ||
{{- with .restartPolicy }} | ||
restartPolicy: {{ quote . }} | ||
{{- end }} | ||
{{- with coalesce .override.imagePullSecrets .dot.Values.default.imagePullSecrets }} | ||
imagePullSecrets: {{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- with (coalesce .override.priorityClassName .dot.Values.default.PriorityClassName) }} | ||
priorityClassName: {{ quote . }} | ||
{{- end }} | ||
{{- with (coalesce .override.nodeSelector .dot.Values.default.nodeSelector) }} | ||
nodeSelector: {{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end -}} |
Oops, something went wrong.