mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
feat(common): Release version 2.0.0-beta.1 (#173)
This commit is contained in:
parent
19767d668c
commit
7b6ee00be6
189 changed files with 3110 additions and 3023 deletions
|
@ -3,30 +3,38 @@ This template serves as a blueprint for Deployment objects that are created
|
|||
using the common library.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.class.deployment" -}}
|
||||
{{- $strategy := default "Recreate" .Values.controller.strategy -}}
|
||||
{{- if and (ne $strategy "Recreate") (ne $strategy "RollingUpdate") -}}
|
||||
{{- fail (printf "Not a valid strategy type for Deployment (%s)" $strategy) -}}
|
||||
{{- end -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $deploymentObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $deploymentObject.identifier)
|
||||
($deploymentObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
{{- $annotations := merge
|
||||
($deploymentObject.annotations | default dict)
|
||||
(include "bjw-s.common.lib.metadata.globalAnnotations" $rootContext | fromYaml)
|
||||
-}}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "bjw-s.common.lib.chart.names.fullname" . }}
|
||||
{{- with include "bjw-s.common.lib.controller.metadata.labels" . }}
|
||||
labels: {{- . | nindent 4 }}
|
||||
name: {{ $deploymentObject.name }}
|
||||
{{- with $labels }}
|
||||
labels: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
{{- with include "bjw-s.common.lib.controller.metadata.annotations" . }}
|
||||
annotations: {{- . | nindent 4 }}
|
||||
{{- with $annotations }}
|
||||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
|
||||
{{- if not (eq .Values.controller.replicas nil) }}
|
||||
replicas: {{ .Values.controller.replicas }}
|
||||
revisionHistoryLimit: {{ $deploymentObject.revisionHistoryLimit }}
|
||||
{{- if not (eq $deploymentObject.replicas nil) }}
|
||||
replicas: {{ $deploymentObject.replicas }}
|
||||
{{- end }}
|
||||
strategy:
|
||||
type: {{ $strategy }}
|
||||
{{- with .Values.controller.rollingUpdate }}
|
||||
{{- if and (eq $strategy "RollingUpdate") (or .surge .unavailable) }}
|
||||
type: {{ $deploymentObject.strategy }}
|
||||
{{- with $deploymentObject.rollingUpdate }}
|
||||
{{- if and (eq $deploymentObject.strategy "RollingUpdate") (or .surge .unavailable) }}
|
||||
rollingUpdate:
|
||||
{{- with .unavailable }}
|
||||
maxUnavailable: {{ . }}
|
||||
|
@ -38,18 +46,15 @@ spec:
|
|||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: {{ $deploymentObject.identifier }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with include ("bjw-s.common.lib.metadata.podAnnotations") . }}
|
||||
annotations:
|
||||
{{- . | nindent 8 }}
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.annotations" (dict "rootContext" $rootContext "controllerObject" $deploymentObject)) }}
|
||||
annotations: {{ . | nindent 8 }}
|
||||
{{- end -}}
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.labels" (dict "rootContext" $rootContext "controllerObject" $deploymentObject)) }}
|
||||
labels: {{ . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "bjw-s.common.lib.controller.pod" . | nindent 6 }}
|
||||
spec: {{ include "bjw-s.common.lib.pod.spec" (dict "rootContext" $rootContext "controllerObject" $deploymentObject) | nindent 6 }}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue