From 2324e7d6e24958fff24b3f03dcfd5520a12de940 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Fri, 17 Mar 2023 17:00:07 +0300 Subject: [PATCH] cs: fix --- .drone.yml | 30 ++++++++--------- Chart.yaml | 6 ++-- templates/deployment.yaml | 40 +++++++++++------------ templates/hpa.yaml | 16 +++++----- templates/ingress.yaml | 30 ++++++++--------- templates/migrations-job.yaml | 48 ++++++++++++++-------------- templates/service.yaml | 8 ++--- templates/tests/test-connection.yaml | 8 ++--- values.yaml | 38 +++++++++++----------- 9 files changed, 112 insertions(+), 112 deletions(-) diff --git a/.drone.yml b/.drone.yml index c28d56a..543edce 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,20 +5,20 @@ name: default trigger: event: - - push - - tag + - push + - tag steps: - - name: release - image: cr.grachevko.ru/drone/helm:0.1.4 - settings: - name: hasura - registry: https://harbor.grachevko.ru/chartrepo - username: - from_secret: HELM_REPO_USERNAME - password: - from_secret: HELM_REPO_PASSWORD - when: - branch: - - master - - rc +- name: release + image: cr.grachevko.ru/drone/helm:0.1.4 + settings: + name: hasura + registry: https://harbor.grachevko.ru/chartrepo + username: + from_secret: HELM_REPO_USERNAME + password: + from_secret: HELM_REPO_PASSWORD + when: + branch: + - master + - rc diff --git a/Chart.yaml b/Chart.yaml index 6f4c7c7..63400ba 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -6,7 +6,7 @@ version: 0.2.6 appVersion: 2.16.0 icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/powered_by_hasura_primary_lightbg.svg maintainers: - - email: me@grachevko.ru - name: Konstantin Grachev +- email: me@grachevko.ru + name: Konstantin Grachev sources: - - https://git.grachevko.ru/hasura/chart +- https://git.grachevko.ru/hasura/chart diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 281bef1..a5f45a4 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -28,29 +28,29 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ include "hasura.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - envFrom: + image: {{ include "hasura.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.extraEnvVarsSecret }} {{- end }} - ports: - - name: http - containerPort: 8080 - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: http - readinessProbe: - httpGet: - path: /healthz - port: http - resources: + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/templates/hpa.yaml b/templates/hpa.yaml index 18e4879..9f81754 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 fdac0ab..f35d69c 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -29,30 +29,30 @@ 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 }} - pathType: {{ default "ImplementationSpecific" .pathType }} - backend: + - path: {{ .path }} + pathType: {{ default "ImplementationSpecific" .pathType }} + 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/migrations-job.yaml b/templates/migrations-job.yaml index fd29790..b21d564 100644 --- a/templates/migrations-job.yaml +++ b/templates/migrations-job.yaml @@ -22,32 +22,32 @@ spec: {{- end }} restartPolicy: Never volumes: - - name: data - emptyDir: { } + - name: data + emptyDir: {} initContainers: - - name: copy - image: "{{ .Values.migrations.image.registry }}/{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag | default "latest" }}" - command: ["/bin/sh", "-c", "cp -R /{{ .Values.migrations.image.path }}/* /shared-data/"] - workingDir: /data - volumeMounts: - - name: data - mountPath: /shared-data + - name: copy + image: "{{ .Values.migrations.image.registry }}/{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag | default "latest" }}" + command: ["/bin/sh", "-c", "cp -R /{{ .Values.migrations.image.path }}/* /shared-data/"] + workingDir: /data + volumeMounts: + - name: data + mountPath: /shared-data containers: - - name: migrate - image: {{ include "hasura.image" . }} - command: [ "/bin/sh", "-c" ] - args: - - hasura-cli deploy - workingDir: /data - env: - - name: HASURA_GRAPHQL_ENDPOINT - value: "http://{{ include "hasura.fullname" . }}" - envFrom: + - name: migrate + image: {{ include "hasura.image" . }} + command: ["/bin/sh", "-c"] + args: + - hasura-cli deploy + workingDir: /data + env: + - name: HASURA_GRAPHQL_ENDPOINT + value: "http://{{ include "hasura.fullname" . }}" + envFrom: {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.extraEnvVarsSecret }} {{- end }} - volumeMounts: - - name: data - mountPath: /data + volumeMounts: + - name: data + mountPath: /data {{- end }} diff --git a/templates/service.yaml b/templates/service.yaml index db29a27..6eafef7 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 "hasura.selectorLabels" . | nindent 4 }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml index 19a66ed..1b0b16d 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 "hasura.fullname" . }}:{{ .Values.service.port }}' ] + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "hasura.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never diff --git a/values.yaml b/values.yaml index fd03afb..253b90b 100644 --- a/values.yaml +++ b/values.yaml @@ -10,7 +10,7 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - pullSecrets: [ ] + pullSecrets: [] extraEnvVarsSecret: "" @@ -20,7 +20,7 @@ migrations: registry: *registry repository: "" tag: "" - pullSecrets: [ ] + pullSecrets: [] path: /data nameOverride: "" @@ -30,22 +30,22 @@ serviceAccount: # Specifies whether a service account should be created create: false # Annotations to add to the service account - annotations: { } + annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template name: "" -podAnnotations: { } +podAnnotations: {} -podSecurityContext: { } +podSecurityContext: {} # fsGroup: 2000 -securityContext: { } +securityContext: {} # capabilities: # drop: # - ALL # readOnlyRootFilesystem: true - # runAsNonRoot: true +# runAsNonRoot: true # runAsUser: 1000 service: @@ -55,20 +55,20 @@ service: ingress: enabled: false className: "" - annotations: { } - # kubernetes.io/ingress.class: nginx + annotations: {} + # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [ ] + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] # - secretName: chart-example-tls # hosts: # - chart-example.local -resources: { } +resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -77,7 +77,7 @@ resources: { } # cpu: 100m # memory: 128Mi # requests: - # cpu: 100m +# cpu: 100m # memory: 128Mi autoscaling: @@ -87,8 +87,8 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -nodeSelector: { } +nodeSelector: {} -tolerations: [ ] +tolerations: [] -affinity: { } +affinity: {}