Skip to content

Commit

Permalink
Revert "allow name overrides in pods (#143)" (#146)
Browse files Browse the repository at this point in the history
This reverts commit 4f697dc.
  • Loading branch information
avimoondra authored Feb 2, 2024
1 parent 4f697dc commit 5349f37
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 47 deletions.
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: retool
description: A Helm chart for Kubernetes
type: application
version: 6.0.14
version: 6.0.13
maintainers:
- name: Retool Engineering
email: engineering+helm@retool.com
Expand Down
30 changes: 6 additions & 24 deletions charts/retool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,6 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Set service names
*/}}
{{- define "retool.codeExecutor.name" -}}
{{- default (printf "%s-code-executor" (include "retool.fullname" .)) .Values.codeExecutor.name -}}
{{- end -}}

{{- define "retool.backend.name" -}}
{{- default (include "retool.fullname" .) .Values.backend.name -}}
{{- end -}}

{{- define "retool.jobRunner.name" -}}
{{- default (printf "%s-jobs-runner" (include "retool.fullname" .)) .Values.jobRunner.name -}}
{{- end -}}

{{- define "retool.workflowsWorker.name" -}}
{{- default (printf "%s-workflow-worker" (include "retool.fullname" .)) .Values.workflows.worker.name -}}
{{- end -}}

{{- define "retool.workflowsBackend.name" -}}
{{- default (printf "%s-workflow-backend" (include "retool.fullname" .)) .Values.workflows.backend.name -}}
{{- end -}}


{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down Expand Up @@ -221,3 +197,9 @@ Set Temporal namespace
{{- end -}}
{{- end -}}

{{/*
Set code executor service name
*/}}
{{- define "retool.codeExecutor.name" -}}
{{ template "retool.fullname" . }}-code-executor
{{- end -}}
6 changes: 3 additions & 3 deletions charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "retool.backend.name" . }}
name: {{ template "retool.fullname" . }}
labels:
{{- include "retool.labels" . | nindent 4 }}
{{- if .Values.deployment.annotations }}
Expand Down Expand Up @@ -112,7 +112,7 @@ spec:
{{- end }}
{{- if include "retool.workflows.enabled" . }}
- name: WORKFLOW_BACKEND_HOST
value: http://{{ template "retool.workflowsBackend.name" . }}
value: http://{{ template "retool.fullname" . }}-workflow-backend
{{- end }}
{{- if (.Values.workflows.temporal).sslEnabled }}
- name: WORKFLOW_TEMPORAL_TLS_ENABLED
Expand Down Expand Up @@ -327,7 +327,7 @@ apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "retool.backend.name" . }}
name: {{ template "retool.fullname" . }}
spec:
{{ toYaml .Values.podDisruptionBudget }}
selector:
Expand Down
6 changes: 3 additions & 3 deletions charts/retool/templates/deployment_jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "retool.jobRunner.name" . }}
name: {{ template "retool.fullname" . }}-jobs-runner
labels:
{{- include "retool.labels" . | nindent 4 }}
{{- if .Values.deployment.annotations }}
Expand All @@ -13,7 +13,7 @@ spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ template "retool.jobRunner.name" . }}
app.kubernetes.io/name: {{ include "retool.name" . }}-jobs-runner
app.kubernetes.io/instance: {{ .Release.Name }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
template:
Expand All @@ -26,7 +26,7 @@ spec:
{{ toYaml .Values.jobRunner.annotations | indent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ template "retool.jobRunner.name" . }}
app.kubernetes.io/name: {{ include "retool.name" . }}-jobs-runner
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
Expand Down
16 changes: 8 additions & 8 deletions charts/retool/templates/deployment_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "retool.workflowsBackend.name" . }}
name: {{ template "retool.fullname" . }}-workflow-backend
labels:
retoolService: {{ template "retool.workflowsBackend.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-backend
{{- include "retool.labels" . | nindent 4 }}
{{- if .Values.deployment.annotations }}
annotations:
Expand All @@ -14,7 +14,7 @@ spec:
replicas: {{ (.Values.workflows.backend).replicaCount | default 1 }}
selector:
matchLabels:
retoolService: {{ template "retool.workflowsBackend.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-backend
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
template:
metadata:
Expand All @@ -26,7 +26,7 @@ spec:
{{ toYaml .Values.backend.annotations | indent 8 }}
{{- end }}
labels:
retoolService: {{ template "retool.workflowsBackend.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-backend
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
Expand Down Expand Up @@ -119,7 +119,7 @@ spec:
- name: POSTGRES_SSL_ENABLED
value: {{ template "retool.postgresql.ssl_enabled" . }}
- name: WORKFLOW_BACKEND_HOST
value: http://{{ template "retool.workflowsBackend.name" . }}
value: http://{{ template "retool.fullname" . }}-workflow-backend
{{- if .Values.codeExecutor.enabled }}
- name: CODE_EXECUTOR_INGRESS_DOMAIN
value: http://{{ template "retool.codeExecutor.name" . }}
Expand Down Expand Up @@ -295,17 +295,17 @@ spec:
{{ toYaml .Values.podDisruptionBudget }}
selector:
matchLabels:
retoolService: {{ template "retool.workflowsBackend.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-backend
{{- include "retool.selectorLabels" . | nindent 6 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "retool.workflowsBackend.name" . }}
name: {{ template "retool.fullname" . }}-workflow-backend
spec:
selector:
retoolService: {{ template "retool.workflowsBackend.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-backend
ports:
- protocol: TCP
port: 80
Expand Down
16 changes: 8 additions & 8 deletions charts/retool/templates/deployment_workflows_worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "retool.workflowsWorker.name" . }}
name: {{ template "retool.fullname" . }}-workflow-worker
labels:
retoolService: {{ template "retool.workflowsWorker.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-worker
{{- include "retool.labels" . | nindent 4 }}
{{- if .Values.deployment.annotations }}
annotations:
Expand All @@ -14,12 +14,12 @@ spec:
replicas: {{ (.Values.workflows.worker).replicaCount | default (.Values.workflows.replicaCount | default 1) }}
selector:
matchLabels:
retoolService: {{ template "retool.workflowsWorker.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-worker
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
template:
metadata:
annotations:
prometheus.io/job: {{ template "retool.workflowsWorker.name" . }}
prometheus.io/job: {{ template "retool.fullname" . }}-workflow-worker
prometheus.io/scrape: 'true'
prometheus.io/port: '9090'
{{- if .Values.podAnnotations }}
Expand All @@ -32,7 +32,7 @@ spec:
{{ toYaml .Values.workflows.annotations | indent 8 }}
{{- end }}
labels:
retoolService: {{ template "retool.workflowsWorker.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-worker
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
Expand Down Expand Up @@ -110,7 +110,7 @@ spec:
- name: WORKFLOW_WORKER_HEALTHCHECK_PORT
value: "3005"
- name: WORKFLOW_BACKEND_HOST
value: http://{{ template "retool.workflowsBackend.name" . }}
value: http://{{ template "retool.fullname" . }}-workflow-backend
- name: CLIENT_ID
value: {{ default "" .Values.config.auth.google.clientId }}
- name: COOKIE_INSECURE
Expand Down Expand Up @@ -324,10 +324,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: {{ template "retool.workflowsWorker.name" . }}
name: {{ template "retool.fullname" . }}-workflow-worker
spec:
selector:
retoolService: {{ template "retool.workflowsWorker.name" . }}
retoolService: {{ template "retool.fullname" . }}-workflow-worker
ports:
- protocol: TCP
port: 3005
Expand Down

0 comments on commit 5349f37

Please sign in to comment.