Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Andreev committed Jan 25, 2022
1 parent 34f5fa9 commit 4459d37
Show file tree
Hide file tree
Showing 15 changed files with 201 additions and 191 deletions.
6 changes: 4 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ description: Common Helm chart for Kubernetes
name: nxs-helm-chart
version: 1.0.0
maintainers:
- name: Roman Andreev
email: randreev@nixys.ru
- name: Roman Andreev
email: r.andreev@nixys.ru
- name: Anton Zhideev
email: a.zhideev@nixys.ru
8 changes: 4 additions & 4 deletions templates/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ metadata:
{{- if .labels }}
{{- include "helpers.tplvalues.render" (dict "value" .labels "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.global.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.labels "context" $) | nindent 4 }}
{{- if $.Values.generic.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": "pre-install,pre-upgrade"
Expand All @@ -31,8 +31,8 @@ metadata:
namespace: {{ $.Release.Namespace | quote }}
labels:
{{- include "helpers.app.labels" $ | nindent 4 }}
{{- if $.Values.global.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.labels "context" $) | nindent 4 }}
{{- if $.Values.generic.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": "pre-install,pre-upgrade"
Expand Down
52 changes: 26 additions & 26 deletions templates/cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ metadata:
{{- if .labels }}
{{- include "helpers.tplvalues.render" (dict "value" .labels "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.global.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.labels "context" $) | nindent 4 }}
{{- if $.Values.generic.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if $.Values.global.annotations }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.annotations "context" $) | nindent 4 }}
{{- if $.Values.generic.annotations }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .annotations }}
{{- include "helpers.tplvalues.render" (dict "value" .annotations "context" $) | nindent 4 }}
Expand Down Expand Up @@ -85,32 +85,32 @@ spec:
labels:
{{- if .extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" .extraSelectorLabels "context" $) | nindent 12 }}
{{- else if $.Values.global.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.extraSelectorLabels "context" $) | nindent 12 }}
{{- else if $.Values.generic.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.extraSelectorLabels "context" $) | nindent 12 }}
{{- end }}
{{- if .podLabels }}
{{- include "helpers.tplvalues.render" (dict "value" .podLabels "context" $) | nindent 12 }}
{{- end }}
{{- if $.Values.global.podLabels }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.podLabels "context" $ ) | nindent 12 }}
{{- if $.Values.generic.podLabels }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.podLabels "context" $ ) | nindent 12 }}
{{- end }}
annotations:
{{- if $.Values.global.podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.podAnnotations "context" $ ) | nindent 12 }}
{{- if $.Values.generic.podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.podAnnotations "context" $ ) | nindent 12 }}
{{- end }}
{{- if .podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" .podAnnotations "context" $) | nindent 12 }}
{{- end }}
spec:
{{- if .serviceAccountName }}
serviceAccountName: {{ .serviceAccountName }}
{{- else if $.Values.global.serviceAccountName }}
serviceAccountName: {{ $.Values.global.serviceAccountName }}
{{- else if $.Values.generic.serviceAccountName }}
serviceAccountName: {{ $.Values.generic.serviceAccountName }}
{{- end }}
{{- if .hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" .hostAliases "context" $) | nindent 12 }}
{{- else if $.Values.global.hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" $.Values.global.hostAliases "context" $) | nindent 12 }}
{{- else if $.Values.generic.hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.hostAliases "context" $) | nindent 12 }}
{{- end }}
{{- if .affinity }}
affinity: {{- include "helpers.tplvalues.render" ( dict "value" .affinity "context" $) | nindent 12 }}
Expand All @@ -127,18 +127,18 @@ spec:
{{- end }}
{{- if .dnsPolicy }}
dnsPolicy: {{ .dnsPolicy }}
{{- else if $.Values.global.dnsPolicy }}
dnsPolicy: {{ $.Values.global.dnsPolicy }}
{{- else if $.Values.generic.dnsPolicy }}
dnsPolicy: {{ $.Values.generic.dnsPolicy }}
{{- end }}
{{- with .nodeSelector }}
nodeSelector: {{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 12 }}
{{- end }}
{{- with .tolerations }}
tolerations: {{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 12 }}
{{- end }}
{{ if or $.Values.global.imagePullSecrets .imagePullSecrets }}
{{ if or $.Values.generic.imagePullSecrets .imagePullSecrets }}
imagePullSecrets:
{{- range $sName, $v := $.Values.global.imagePullSecrets }}
{{- range $sName, $v := $.Values.generic.imagePullSecrets }}
- name: {{ $sName }}
{{- end }}
{{- if .imagePullSecrets }}
Expand All @@ -149,7 +149,7 @@ spec:
initContainers:
{{- range . }}
- name: {{ .name | default $cronJobName }}
image: {{ .image | default $.Values.global.defaultImage }}:{{ .imageTag | default $.Values.global.defaultImageTag }}
image: {{ .image | default $.Values.generic.defaultImage }}:{{ .imageTag | default $.Values.generic.defaultImageTag }}
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- with .containerSecurityContext }}
securityContext: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 14 }}
Expand Down Expand Up @@ -185,8 +185,8 @@ spec:
{{- $volMounts = .volumeMounts -}}
{{- else if $general.extraVolumeMounts -}}
{{- $volMounts = $general.extraVolumeMounts -}}
{{- else if $.Values.global.extraVolumeMounts -}}
{{- $volMounts = $.Values.global.extraVolumeMounts -}}
{{- else if $.Values.generic.extraVolumeMounts -}}
{{- $volMounts = $.Values.generic.extraVolumeMounts -}}
{{- end -}}
{{- if not (empty $volMounts) }}
volumeMounts:
Expand Down Expand Up @@ -214,7 +214,7 @@ spec:
containers:
{{- range $containers }}
- name: {{ .name | default $cronJobName }}
image: {{ .image | default $.Values.global.defaultImage }}:{{ .imageTag | default $.Values.global.defaultImageTag }}
image: {{ .image | default $.Values.generic.defaultImage }}:{{ .imageTag | default $.Values.generic.defaultImageTag }}
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- with .containerSecurityContext }}
securityContext: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 14 }}
Expand Down Expand Up @@ -259,8 +259,8 @@ spec:
{{- $volMounts = .volumeMounts -}}
{{- else if $general.extraVolumeMounts -}}
{{- $volMounts = $general.extraVolumeMounts -}}
{{- else if $.Values.global.extraVolumeMounts -}}
{{- $volMounts = $.Values.global.extraVolumeMounts -}}
{{- else if $.Values.generic.extraVolumeMounts -}}
{{- $volMounts = $.Values.generic.extraVolumeMounts -}}
{{- end -}}
{{- if not (empty $volMounts) }}
volumeMounts:
Expand Down Expand Up @@ -332,8 +332,8 @@ spec:
{{- include "helpers.tplvalues.render" ( dict "value" .extraVolumes "context" $) | nindent 10 }}
{{- else if $general.extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" $general.extraVolumes "context" $) | nindent 10 }}
{{- else if $.Values.global.extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.extraVolumes "context" $) | nindent 10 }}
{{- else if $.Values.generic.extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.extraVolumes "context" $) | nindent 10 }}
{{- end }}
restartPolicy: {{ .restartPolicy | default "Never" }}
{{- end }}
61 changes: 31 additions & 30 deletions templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
{{- if .labels }}
{{- include "helpers.tplvalues.render" (dict "value" .labels "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.global.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.labels "context" $) | nindent 4 }}
{{- if $.Values.generic.labels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .annotations }}
{{- include "helpers.tplvalues.render" (dict "value" .annotations "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.global.annotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.annotations "context" $ ) | nindent 4 }}
{{- if $.Values.generic.annotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .replicas | default 1 }}
Expand All @@ -32,41 +32,41 @@ spec:
{{- include "helpers.app.selectorLabels" $ | nindent 6 }}
{{- if .extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" .extraSelectorLabels "context" $) | nindent 6 }}
{{- else if $.Values.global.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.extraSelectorLabels "context" $) | nindent 6 }}
{{- else if $.Values.generic.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.extraSelectorLabels "context" $) | nindent 6 }}
{{- end }}
template:
metadata:
labels:
{{- include "helpers.app.selectorLabels" $ | nindent 8 }}
{{- if .extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" .extraSelectorLabels "context" $) | nindent 8 }}
{{- else if $.Values.global.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.global.extraSelectorLabels "context" $) | nindent 8 }}
{{- else if $.Values.generic.extraSelectorLabels }}
{{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.extraSelectorLabels "context" $) | nindent 8 }}
{{- end }}
{{- if .podLabels }}
{{- include "helpers.tplvalues.render" (dict "value" .podLabels "context" $) | nindent 8 }}
{{- end }}
{{- if $.Values.global.podLabels }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.podLabels "context" $ ) | nindent 8 }}
{{- if $.Values.generic.podLabels }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.podLabels "context" $ ) | nindent 8 }}
{{- end }}
annotations:
{{- if $.Values.global.podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.podAnnotations "context" $ ) | nindent 8 }}
{{- if $.Values.generic.podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.podAnnotations "context" $ ) | nindent 8 }}
{{- end }}
{{- if .podAnnotations }}
{{- include "helpers.tplvalues.render" ( dict "value" .podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
{{- if .serviceAccountName }}
serviceAccountName: {{ .serviceAccountName }}
{{- else if $.Values.global.serviceAccountName }}
serviceAccountName: {{ $.Values.global.serviceAccountName }}
{{- else if $.Values.generic.serviceAccountName }}
serviceAccountName: {{ $.Values.generic.serviceAccountName }}
{{- end }}
{{- if .hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" .hostAliases "context" $) | nindent 8 }}
{{- else if $.Values.global.hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" $.Values.global.hostAliases "context" $) | nindent 8 }}
{{- else if $.Values.generic.hostAliases }}
hostAliases: {{- include "helpers.tplvalues.render" (dict "value" $.Values.generic.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .affinity }}
affinity:
Expand All @@ -79,8 +79,8 @@ spec:
{{- end }}
{{- if .dnsPolicy }}
dnsPolicy: {{ .dnsPolicy }}
{{- else if $.Values.global.dnsPolicy }}
dnsPolicy: {{ $.Values.global.dnsPolicy }}
{{- else if $.Values.generic.dnsPolicy }}
dnsPolicy: {{ $.Values.generic.dnsPolicy }}
{{- end }}
{{- with .nodeSelector }}
nodeSelector: {{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
Expand All @@ -91,9 +91,9 @@ spec:
{{- with .podSecurityContext }}
securityContext: {{- include "helpers.tplvalues.render" (dict "value" . "context" $) nindent 8 }}
{{- end }}
{{ if or $.Values.global.imagePullSecrets .imagePullSecrets }}
{{ if or $.Values.generic.imagePullSecrets .imagePullSecrets }}
imagePullSecrets:
{{- range $sName, $v := $.Values.global.imagePullSecrets }}
{{- range $sName, $v := $.Values.generic.imagePullSecrets }}
- name: {{ $sName }}
{{- end }}
{{- if .imagePullSecrets }}
Expand All @@ -107,7 +107,7 @@ spec:
initContainers:
{{- range . }}
- name: {{ .name }}
image: {{ .image | default $.Values.global.defaultImage }}:{{ .imageTag | default $.Values.global.defaultImageTag }}
image: {{ .image | default $.Values.generic.defaultImage }}:{{ .imageTag | default $.Values.generic.defaultImageTag }}
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- with .containerSecurityContext }}
securityContext: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 10 }}
Expand Down Expand Up @@ -136,13 +136,14 @@ spec:
{{- end }}
{{- $volMounts := list -}}
{{- if .volumeMounts -}}
{{- $volMounts = .volumeMounts -}}
{{- else if $.Values.global.extraVolumeMounts -}}
{{- $volMounts = $.Values.global.extraVolumeMounts -}}
{{- $volMounts = concat $volMounts .volumeMounts -}}
{{- end }}
{{- if $.Values.generic.extraVolumeMounts -}}
{{- $volMounts = concat $volMounts $.Values.generic.extraVolumeMounts -}}
{{- end }}
{{- if not (empty $volMounts) }}
volumeMounts:
{{- range .volumeMounts }}
{{- range $volMounts }}
{{- if .extraFilesDirName }}
- name: {{ include "helpers.app.fullname" (dict "name" (.partOfName | replace "_" "-") "context" $) }}
{{- else }}
Expand All @@ -165,7 +166,7 @@ spec:
containers:
{{- range .containers }}
- name: {{ .name }}
image: {{ .image | default $.Values.global.defaultImage }}:{{ .imageTag | default $.Values.global.defaultImageTag }}
image: {{ .image | default $.Values.generic.defaultImage }}:{{ .imageTag | default $.Values.generic.defaultImageTag }}
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- with .containerSecurityContext }}
securityContext: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 10 }}
Expand Down Expand Up @@ -206,8 +207,8 @@ spec:
{{- $volMounts := list -}}
{{- if .volumeMounts -}}
{{- $volMounts = .volumeMounts -}}
{{- else if $.Values.global.extraVolumeMounts -}}
{{- $volMounts = $.Values.global.extraVolumeMounts -}}
{{- else if $.Values.generic.extraVolumeMounts -}}
{{- $volMounts = $.Values.generic.extraVolumeMounts -}}
{{- end }}
{{- if not (empty $volMounts) }}
volumeMounts:
Expand Down Expand Up @@ -279,8 +280,8 @@ spec:
{{- end }}
{{- if .extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" .extraVolumes "context" $) | nindent 8 }}
{{- else if $.Values.global.extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.global.extraVolumes "context" $) | nindent 8 }}
{{- else if $.Values.generic.extraVolumes }}
{{- include "helpers.tplvalues.render" ( dict "value" $.Values.generic.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit 4459d37

Please sign in to comment.