mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
feat(common): Release common-3.1.0 (#303)
This commit is contained in:
parent
55b1b3a383
commit
11f1a43664
15 changed files with 185 additions and 19 deletions
|
@ -36,13 +36,13 @@ metadata:
|
|||
spec:
|
||||
suspend: {{ default false $cronJobSettings.suspend }}
|
||||
concurrencyPolicy: {{ default "Forbid" $cronJobSettings.concurrencyPolicy }}
|
||||
startingDeadlineSeconds: {{ default 30 $cronJobSettings.startingDeadlineSeconds }}
|
||||
startingDeadlineSeconds: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $cronJobSettings.startingDeadlineSeconds "default" 30) }}
|
||||
{{- with $timeZone }}
|
||||
timeZone: {{ . }}
|
||||
{{- end }}
|
||||
schedule: {{ $cronJobSettings.schedule | quote }}
|
||||
successfulJobsHistoryLimit: {{ default 1 $cronJobSettings.successfulJobsHistory }}
|
||||
failedJobsHistoryLimit: {{ default 1 $cronJobSettings.failedJobsHistory }}
|
||||
successfulJobsHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $cronJobSettings.successfulJobsHistory "default" 1) }}
|
||||
failedJobsHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $cronJobSettings.failedJobsHistory "default" 1) }}
|
||||
jobTemplate:
|
||||
spec:
|
||||
{{- with $cronJobSettings.ttlSecondsAfterFinished }}
|
||||
|
@ -51,7 +51,7 @@ spec:
|
|||
{{- with $cronJobSettings.parallelism }}
|
||||
parallelism: {{ . }}
|
||||
{{- end }}
|
||||
backoffLimit: {{ default 6 $cronJobSettings.backoffLimit }}
|
||||
backoffLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $cronJobSettings.backoffLimit "default" 6) }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.annotations" (dict "rootContext" $rootContext "controllerObject" $cronjobObject)) }}
|
||||
|
|
|
@ -27,7 +27,7 @@ metadata:
|
|||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ default 3 $daemonsetObject.revisionHistoryLimit }}
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ $daemonsetObject.identifier }}
|
||||
|
|
|
@ -27,7 +27,7 @@ metadata:
|
|||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ default 3 $deploymentObject.revisionHistoryLimit }}
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $deploymentObject.revisionHistoryLimit "default" 3) }}
|
||||
{{- if hasKey $deploymentObject "replicas" }}
|
||||
{{- if not (eq $deploymentObject.replicas nil) }}
|
||||
replicas: {{ $deploymentObject.replicas }}
|
||||
|
|
|
@ -42,7 +42,7 @@ spec:
|
|||
{{- with $jobSettings.completionMode }}
|
||||
completionMode: {{ . }}
|
||||
{{- end }}
|
||||
backoffLimit: {{ default 6 $jobSettings.backoffLimit }}
|
||||
backoffLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $jobSettings.backoffLimit "default" 6) }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.annotations" (dict "rootContext" $rootContext "controllerObject" $jobObject)) }}
|
||||
|
|
|
@ -64,7 +64,7 @@ spec:
|
|||
name: {{ default .name $service.name }}
|
||||
namespace: {{ default $rootContext.Release.Namespace .namespace }}
|
||||
port: {{ default .port $servicePrimaryPort.port }}
|
||||
weight: {{ default 1 .weight }}
|
||||
weight: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" .weight "default" 1) }}
|
||||
{{- end }}
|
||||
{{- if or (eq $routeKind "HTTPRoute") (eq $routeKind "GRPCRoute") }}
|
||||
{{- with .matches }}
|
||||
|
|
|
@ -21,6 +21,10 @@ metadata:
|
|||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
jobLabel: "{{ $serviceMonitorObject.name }}"
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ $rootContext.Release.Namespace }}
|
||||
selector:
|
||||
{{- if $serviceMonitorObject.selector -}}
|
||||
{{- tpl ($serviceMonitorObject.selector | toYaml) $rootContext | nindent 4}}
|
||||
|
|
|
@ -27,7 +27,7 @@ metadata:
|
|||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ default 3 $statefulsetObject.revisionHistoryLimit }}
|
||||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $statefulsetObject.revisionHistoryLimit "default" 3) }}
|
||||
replicas: {{ $statefulsetObject.replicas }}
|
||||
podManagementPolicy: {{ dig "statefulset" "podManagementPolicy" "OrderedReady" $statefulsetObject }}
|
||||
updateStrategy:
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return the value or the specified default if the given value is null.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.defaultKeepNonNullValue" -}}
|
||||
{{- $value := .value -}}
|
||||
{{- $default := required "default value is required" .default -}}
|
||||
|
||||
{{- if eq nil $value -}}
|
||||
{{- $default | toYaml -}}
|
||||
{{- else -}}
|
||||
{{- $value | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
|
@ -39,10 +39,10 @@ Probes used by the container.
|
|||
{{- $probeType = $probeValues.type | default "TCP" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $_ := set $probeDefinition "initialDelaySeconds" (default 0 $probeSpec.initialDelaySeconds) -}}
|
||||
{{- $_ := set $probeDefinition "failureThreshold" (default 3 $probeSpec.failureThreshold) -}}
|
||||
{{- $_ := set $probeDefinition "timeoutSeconds" (default 1 $probeSpec.timeoutSeconds) -}}
|
||||
{{- $_ := set $probeDefinition "periodSeconds" (default 10 $probeSpec.periodSeconds) -}}
|
||||
{{- $_ := set $probeDefinition "initialDelaySeconds" (include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $probeSpec.initialDelaySeconds "default" 0) | int) -}}
|
||||
{{- $_ := set $probeDefinition "failureThreshold" (include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $probeSpec.failureThreshold "default" 3) | int) -}}
|
||||
{{- $_ := set $probeDefinition "timeoutSeconds" (include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $probeSpec.timeoutSeconds "default" 1) | int) -}}
|
||||
{{- $_ := set $probeDefinition "periodSeconds" (include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $probeSpec.periodSeconds "default" 10) | int) -}}
|
||||
|
||||
{{- $probeHeader := "" -}}
|
||||
{{- if or ( eq $probeType "HTTPS" ) ( eq $probeType "HTTP" ) -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue