From 742a5acd9cef05b32fa58fa5a9dc3f6de8b77b6c Mon Sep 17 00:00:00 2001 From: oliverlaslett <11660098+owlas@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:23:32 +0100 Subject: [PATCH] feat(breaking): separate worker-backend selectors --- charts/lightdash/Chart.yaml | 2 +- charts/lightdash/templates/deployment.yaml | 88 --------------------- charts/lightdash/templates/hpa.yaml | 2 +- charts/lightdash/templates/scheduler.yaml | 89 ---------------------- charts/lightdash/templates/service.yaml | 1 + 5 files changed, 3 insertions(+), 179 deletions(-) delete mode 100644 charts/lightdash/templates/deployment.yaml delete mode 100644 charts/lightdash/templates/scheduler.yaml diff --git a/charts/lightdash/Chart.yaml b/charts/lightdash/Chart.yaml index 722f133..55e6881 100644 --- a/charts/lightdash/Chart.yaml +++ b/charts/lightdash/Chart.yaml @@ -6,7 +6,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.10.1 +version: 1.0.0-rc1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/lightdash/templates/deployment.yaml b/charts/lightdash/templates/deployment.yaml deleted file mode 100644 index efcedb6..0000000 --- a/charts/lightdash/templates/deployment.yaml +++ /dev/null @@ -1,88 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "lightdash.fullname" . }} - labels: - {{- include "lightdash.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "lightdash.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "lightdash.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - serviceAccountName: {{ include "lightdash.serviceAccountName" . }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: {{ .Values.image.command }} - args: {{ .Values.image.args }} - env: - - name: PGPASSWORD - valueFrom: - secretKeyRef: - name: {{ (include "lightdash.database.secretName" .) }} - key: {{ (include "lightdash.database.secret.passwordKey" .) }} - {{- if .Values.extraEnv }} - {{- toYaml .Values.extraEnv | nindent 12 }} - {{- end }} - envFrom: - - configMapRef: - name: {{ template "lightdash.fullname" $ }} - {{ if .Values.secrets }} - - secretRef: - name: {{ template "lightdash.fullname" $ }} - {{ end }} - ports: - - name: http - containerPort: {{ .Values.service.port }} - protocol: TCP - livenessProbe: - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - httpGet: - path: /api/v1/livez - port: {{ .Values.service.port }} - readinessProbe: - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - httpGet: - path: /api/v1/health - port: {{ .Values.service.port }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.extraContainers }} - {{- toYaml .Values.extraContainers | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/charts/lightdash/templates/hpa.yaml b/charts/lightdash/templates/hpa.yaml index c30705a..fa7a7fc 100644 --- a/charts/lightdash/templates/hpa.yaml +++ b/charts/lightdash/templates/hpa.yaml @@ -9,7 +9,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "lightdash.fullname" . }} + name: {{ include "lightdash.fullname" . }}-backend minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: diff --git a/charts/lightdash/templates/scheduler.yaml b/charts/lightdash/templates/scheduler.yaml deleted file mode 100644 index 51a45aa..0000000 --- a/charts/lightdash/templates/scheduler.yaml +++ /dev/null @@ -1,89 +0,0 @@ -{{- if .Values.scheduler.enabled }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "lightdash.fullname" . }}-scheduler - labels: - {{- include "lightdash.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.scheduler.replicas }} - selector: - matchLabels: - {{- include "lightdash.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "lightdash.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - serviceAccountName: {{ include "lightdash.serviceAccountName" . }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["yarn", "workspace", "backend", "scheduler"] - args: {{ .Values.image.args }} - env: - - name: PGPASSWORD - valueFrom: - secretKeyRef: - name: {{ (include "lightdash.database.secretName" .) }} - key: {{ (include "lightdash.database.secret.passwordKey" .) }} - - name: PORT - value: {{ .Values.scheduler.port | quote }} - {{- if .Values.extraEnv }} - {{- toYaml .Values.extraEnv | nindent 12 }} - {{- end }} - {{- if .Values.schedulerExtraEnv }} - {{- toYaml .Values.schedulerExtraEnv | nindent 12 }} - {{- end }} - envFrom: - - configMapRef: - name: {{ template "lightdash.fullname" $ }} - {{ if .Values.secrets }} - - secretRef: - name: {{ template "lightdash.fullname" $ }} - {{ end }} - livenessProbe: - initialDelaySeconds: 60 - periodSeconds: 60 - timeoutSeconds: 300 - httpGet: - path: /api/v1/health - port: {{ .Values.scheduler.port }} - readinessProbe: - initialDelaySeconds: 30 - periodSeconds: 60 - timeoutSeconds: 300 - httpGet: - path: /api/v1/health - port: {{ .Values.scheduler.port }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.extraContainers }} - {{- toYaml .Values.extraContainers | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} diff --git a/charts/lightdash/templates/service.yaml b/charts/lightdash/templates/service.yaml index 73f7c0e..6079283 100644 --- a/charts/lightdash/templates/service.yaml +++ b/charts/lightdash/templates/service.yaml @@ -17,3 +17,4 @@ spec: name: http selector: {{- include "lightdash.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: backend