rancher-partner-charts/charts/kasten/k10/templates/deployments.yaml

34 lines
1.7 KiB
YAML

{{/*
Generates deployment specs for K10 services and other services such as
"frontend" and "kanister".
*/}}
{{- include "singleAuth.check" . -}}
{{- $main_context := . -}}
{{- $stateless_services := include "k10.statelessServices" . | splitList " " -}}
{{- $colocated_services := include "k10.colocatedServices" . | fromYaml -}}
{{ $service_list := include "k10.restServices" . | splitList " " }}
{{- if not (default .Values.features dict).multicluster -}}
{{- $service_list = without $service_list "mccontrollermanager" -}}
{{- end -}}
{{- range $skip, $k10_service := $service_list }}
{{ if not (hasKey $colocated_services $k10_service ) }}
{{/* Set $stateful for stateful services when .Values.global.persistence.enabled is true */}}
{{- $stateful := and $.Values.global.persistence.enabled (not (has $k10_service $stateless_services)) -}}
{{ $replicas := get $.Values (printf "%sReplicas" $k10_service) | default 1 }}
{{ $tmp_contx := dict "main" $main_context "k10_service" $k10_service "stateful" $stateful "replicas" $replicas }}
{{ if eq $k10_service "metering" }}
{{- include "k10-metering" $tmp_contx -}}
{{ else }}
{{- include "k10-default" $tmp_contx -}}
{{ end }}
{{ end }}{{/* if not (hasKey $colocated_services $k10_service ) */}}
{{- end }}
{{/*
Generate deployment specs for additional services. These are stateless and have
1 replica.
*/}}
{{- range $skip, $k10_service := concat (include "k10.services" . | splitList " ") (include "k10.additionalServices" . | splitList " ") }}
{{ $tmp_contx := dict "main" $main_context "k10_service" $k10_service "stateful" false "replicas" 1 }}
{{- include "k10-default" $tmp_contx -}}
{{- end }}