From 48e01337c9a90c615aa8cf57ab01d512a0542cbe 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 | 28 +++---- Chart.yaml | 14 ++-- templates/n8n-deployment.yaml | 60 +++++++------- templates/n8n-ingress.yaml | 30 +++---- templates/n8n-service.yaml | 8 +- templates/tests/test-connection.yaml | 8 +- templates/webhook-deployment.yaml | 54 ++++++------- templates/webhook-ingress.yaml | 30 +++---- templates/webhook-service.yaml | 8 +- templates/worker-deployment.yaml | 30 +++---- templates/worker-hpa.yaml | 16 ++-- values.yaml | 114 +++++++++++++-------------- 12 files changed, 200 insertions(+), 200 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8cbe7a1..ecd4dbd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,19 +5,19 @@ name: default trigger: event: - - push + - push steps: - - name: release - image: cr.grachevko.ru/drone/helm:0.1.4 - settings: - name: n8n - 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: n8n + 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 1e3654b..ad778df 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -6,12 +6,12 @@ version: 0.0.1 appVersion: 0.220.0 icon: https://github.com/n8n-io/n8n/raw/master/assets/n8n-logo.png maintainers: - - email: me@grachevko.ru - name: Konstantin Grachev +- email: me@grachevko.ru + name: Konstantin Grachev sources: - - https://git.grachevko.ru/n8n/chart +- https://git.grachevko.ru/n8n/chart dependencies: - - name: redis - version: ^17 - repository: https://charts.bitnami.com/bitnami - condition: redis.enabled +- name: redis + version: ^17 + repository: https://charts.bitnami.com/bitnami + condition: redis.enabled diff --git a/templates/n8n-deployment.yaml b/templates/n8n-deployment.yaml index 4cd19d6..2ca007e 100644 --- a/templates/n8n-deployment.yaml +++ b/templates/n8n-deployment.yaml @@ -27,40 +27,40 @@ spec: securityContext: {{- toYaml .Values.n8n.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.n8n.securityContext | nindent 12 }} - image: "{{ .Values.n8n.image.registry }}/{{ .Values.n8n.image.repository }}:{{ .Values.n8n.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.n8n.image.pullPolicy }} - envFrom: - - configMapRef: - name: {{ include "n8n.fullname" . }} + image: "{{ .Values.n8n.image.registry }}/{{ .Values.n8n.image.repository }}:{{ .Values.n8n.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.n8n.image.pullPolicy }} + envFrom: + - configMapRef: + name: {{ include "n8n.fullname" . }} {{- if .Values.n8n.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.n8n.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.n8n.extraEnvVarsSecret }} {{- else }} - - secretRef: - name: {{ include "n8n.fullname" . }} + - secretRef: + name: {{ include "n8n.fullname" . }} {{- end }} - ports: - - name: http - containerPort: 5678 - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: http - readinessProbe: - httpGet: - path: /healthz - port: http - startupProbe: - httpGet: - path: /healthz - port: http - failureThreshold: 30 - periodSeconds: 10 - resources: + ports: + - name: http + containerPort: 5678 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + startupProbe: + httpGet: + path: /healthz + port: http + failureThreshold: 30 + periodSeconds: 10 + resources: {{- toYaml .Values.n8n.resources | nindent 12 }} {{- with .Values.n8n.nodeSelector }} nodeSelector: diff --git a/templates/n8n-ingress.yaml b/templates/n8n-ingress.yaml index 5330c0a..0c99d63 100644 --- a/templates/n8n-ingress.yaml +++ b/templates/n8n-ingress.yaml @@ -29,30 +29,30 @@ spec: {{- if .Values.n8n.ingress.tls }} tls: {{- range .Values.n8n.ingress.tls }} - - hosts: + - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ . | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.n8n.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/n8n-service.yaml b/templates/n8n-service.yaml index 9e67696..7511711 100644 --- a/templates/n8n-service.yaml +++ b/templates/n8n-service.yaml @@ -7,9 +7,9 @@ metadata: spec: type: {{ .Values.n8n.service.type }} ports: - - port: {{ .Values.n8n.service.port }} - targetPort: http - protocol: TCP - name: http + - port: {{ .Values.n8n.service.port }} + targetPort: http + protocol: TCP + name: http selector: {{- include "n8n.selectorLabels" . | nindent 4 }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml index ff63ddb..95f4c08 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 "n8n.fullname" . }}:{{ .Values.n8n.service.port }}' ] + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "n8n.fullname" . }}:{{ .Values.n8n.service.port }}'] restartPolicy: Never diff --git a/templates/webhook-deployment.yaml b/templates/webhook-deployment.yaml index 43aa29d..4e1406c 100644 --- a/templates/webhook-deployment.yaml +++ b/templates/webhook-deployment.yaml @@ -29,37 +29,37 @@ spec: securityContext: {{- toYaml .Values.webhook.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.webhook.securityContext | nindent 12 }} - image: "{{ .Values.webhook.image.registry }}/{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.webhook.image.pullPolicy }} - command: - - n8n - - webhook - envFrom: - - configMapRef: - name: {{ include "n8n.fullname" . }} + image: "{{ .Values.webhook.image.registry }}/{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.webhook.image.pullPolicy }} + command: + - n8n + - webhook + envFrom: + - configMapRef: + name: {{ include "n8n.fullname" . }} {{- if .Values.webhook.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.webhook.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.webhook.extraEnvVarsSecret }} {{- else }} - - secretRef: - name: {{ include "n8n.fullname" . }} + - secretRef: + name: {{ include "n8n.fullname" . }} {{- end }} - ports: - - name: http - containerPort: 5678 - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: http - readinessProbe: - httpGet: - path: /healthz - port: http - resources: + ports: + - name: http + containerPort: 5678 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + resources: {{- toYaml .Values.webhook.resources | nindent 12 }} {{- with .Values.webhook.nodeSelector }} nodeSelector: diff --git a/templates/webhook-ingress.yaml b/templates/webhook-ingress.yaml index f35c11e..b23a7ae 100644 --- a/templates/webhook-ingress.yaml +++ b/templates/webhook-ingress.yaml @@ -29,30 +29,30 @@ spec: {{- if .Values.webhook.ingress.tls }} tls: {{- range .Values.webhook.ingress.tls }} - - hosts: + - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ . | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.webhook.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/webhook-service.yaml b/templates/webhook-service.yaml index 9555a59..35fbcac 100644 --- a/templates/webhook-service.yaml +++ b/templates/webhook-service.yaml @@ -7,9 +7,9 @@ metadata: spec: type: {{ .Values.webhook.service.type }} ports: - - port: {{ .Values.webhook.service.port }} - targetPort: http - protocol: TCP - name: http + - port: {{ .Values.webhook.service.port }} + targetPort: http + protocol: TCP + name: http selector: {{- include "n8n-webhook.selectorLabels" . | nindent 4 }} diff --git a/templates/worker-deployment.yaml b/templates/worker-deployment.yaml index c8f8f45..1496429 100644 --- a/templates/worker-deployment.yaml +++ b/templates/worker-deployment.yaml @@ -29,25 +29,25 @@ spec: securityContext: {{- toYaml .Values.worker.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} - securityContext: + - name: {{ .Chart.Name }} + securityContext: {{- toYaml .Values.worker.securityContext | nindent 12 }} - image: "{{ .Values.worker.image.registry }}/{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.worker.image.pullPolicy }} - command: - - n8n - - worker - envFrom: - - configMapRef: - name: {{ include "n8n.fullname" . }} + image: "{{ .Values.worker.image.registry }}/{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.worker.image.pullPolicy }} + command: + - n8n + - worker + envFrom: + - configMapRef: + name: {{ include "n8n.fullname" . }} {{- if .Values.worker.extraEnvVarsSecret }} - - secretRef: - name: {{ .Values.worker.extraEnvVarsSecret }} + - secretRef: + name: {{ .Values.worker.extraEnvVarsSecret }} {{- else }} - - secretRef: - name: {{ include "n8n.fullname" . }} + - secretRef: + name: {{ include "n8n.fullname" . }} {{- end }} - resources: + resources: {{- toYaml .Values.worker.resources | nindent 12 }} {{- with .Values.worker.nodeSelector }} nodeSelector: diff --git a/templates/worker-hpa.yaml b/templates/worker-hpa.yaml index f8eab49..42a27be 100644 --- a/templates/worker-hpa.yaml +++ b/templates/worker-hpa.yaml @@ -14,15 +14,15 @@ spec: maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }} metrics: {{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} diff --git a/values.yaml b/values.yaml index 6092dcb..b280bb6 100644 --- a/values.yaml +++ b/values.yaml @@ -48,7 +48,7 @@ n8n: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - pullSecrets: [ ] + pullSecrets: [] extraEnvVarsSecret: "" @@ -56,20 +56,20 @@ n8n: # 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 + # drop: + # - ALL # readOnlyRootFilesystem: true # runAsNonRoot: true # runAsUser: 1000 @@ -81,36 +81,36 @@ n8n: ingress: enabled: false className: "" - annotations: { } + 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 # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: - # cpu: 100m - # memory: 128Mi + # cpu: 100m + # memory: 128Mi # requests: # cpu: 100m # memory: 128Mi - nodeSelector: { } + nodeSelector: {} - tolerations: [ ] + tolerations: [] - affinity: { } + affinity: {} webhook: replicaCount: 1 @@ -121,7 +121,7 @@ webhook: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - pullSecrets: [ ] + pullSecrets: [] extraEnvVarsSecret: "" @@ -129,21 +129,21 @@ webhook: # 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 + # - ALL + # readOnlyRootFilesystem: true # runAsNonRoot: true # runAsUser: 1000 @@ -154,28 +154,28 @@ webhook: ingress: enabled: false className: "" - annotations: { } + 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 # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: # cpu: 100m - # memory: 128Mi - # requests: + # memory: 128Mi + # requests: # cpu: 100m # memory: 128Mi @@ -186,11 +186,11 @@ webhook: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 - nodeSelector: { } + nodeSelector: {} - tolerations: [ ] + tolerations: [] - affinity: { } + affinity: {} worker: replicaCount: 1 @@ -201,7 +201,7 @@ worker: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - pullSecrets: [ ] + pullSecrets: [] extraEnvVarsSecret: "" @@ -209,21 +209,21 @@ worker: # 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 + # - ALL + # readOnlyRootFilesystem: true # runAsNonRoot: true # runAsUser: 1000 @@ -234,28 +234,28 @@ worker: ingress: enabled: false className: "" - annotations: { } + 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 # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: # cpu: 100m - # memory: 128Mi - # requests: + # memory: 128Mi + # requests: # cpu: 100m # memory: 128Mi @@ -266,8 +266,8 @@ worker: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 - nodeSelector: { } + nodeSelector: {} - tolerations: [ ] + tolerations: [] - affinity: { } + affinity: {}