From a8d7b1c89490f92b20e83181fee7bfdf214b63a8 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Tue, 28 Feb 2023 22:09:42 +0300 Subject: [PATCH] cs: yaml --- templates/deployment.yaml | 48 ++++++++++++++-------------- templates/hpa.yaml | 16 +++++----- templates/ingress.yaml | 30 ++++++++--------- templates/service.yaml | 8 ++--- templates/tests/test-connection.yaml | 8 ++--- 5 files changed, 55 insertions(+), 55 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 19898db..e6c394b 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -30,34 +30,34 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - envFrom: - - configMapRef: - name: {{ include "hedgedoc.fullname" . }} + image: "{{ .Values.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: {{ include "hedgedoc.fullname" . }} {{- if .Values.existingSecret }} - - secretRef: - name: {{ .Values.existingSecret }} + - secretRef: + name: {{ .Values.existingSecret }} {{- else }} - - secretRef: - name: {{ include "hedgedoc.fullname" . }} + - secretRef: + name: {{ include "hedgedoc.fullname" . }} {{- end }} - ports: - - name: http - containerPort: {{ .Values.service.port }} - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/templates/hpa.yaml b/templates/hpa.yaml index c0fdd56..20d3f8d 100644 --- a/templates/hpa.yaml +++ b/templates/hpa.yaml @@ -14,15 +14,15 @@ spec: maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 719ad36..b6027c2 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -29,32 +29,32 @@ spec: {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - - hosts: + - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ . | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: + - host: {{ .host | quote }} + http: + paths: {{- range .paths }} - - path: {{ .path }} + - path: {{ .path }} {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} + pathType: {{ .pathType }} {{- end }} - backend: + backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} {{- end }} {{- end }} {{- end }} diff --git a/templates/service.yaml b/templates/service.yaml index 92a1bfb..f4a5c1f 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -7,9 +7,9 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http selector: {{- include "hedgedoc.selectorLabels" . | nindent 4 }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml index 99f9ed6..8031123 100644 --- a/templates/tests/test-connection.yaml +++ b/templates/tests/test-connection.yaml @@ -8,8 +8,8 @@ metadata: "helm.sh/hook": test spec: containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "hedgedoc.fullname" . }}:{{ .Values.service.port }}'] + - name: wget + image: busybox + command: [ 'wget' ] + args: [ '{{ include "hedgedoc.fullname" . }}:{{ .Values.service.port }}' ] restartPolicy: Never