Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] add configurable port names for istio compatibility #154

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.17
version: 6.0.18
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
15 changes: 8 additions & 7 deletions charts/retool/templates/deployment_code_executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ spec:
{{- end }}
ports:
- containerPort: 3004
{{ if .Values.codeExecutor.portName }}
name: {{ .Values.codeExecutor.portName }}
{{ else }}
name: {{ template "retool.name" . }}
protocol: TCP
- containerPort: 9090
name: metrics
{{ end }}
Comment on lines +82 to +86

This comment was marked as resolved.

protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
Expand Down Expand Up @@ -137,9 +138,9 @@ spec:
- protocol: TCP
port: 80
targetPort: 3004
{{ if .Values.codeExecutor.portName }}
name: {{ .Values.codeExecutor.portName }}
{{ else }}
name: {{ template "retool.name" . }}
- protocol: TCP
port: 9090
targetPort: metrics
name: metrics
Comment on lines -141 to -144
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused, no need to expose this.

{{ end }}
Comment on lines +137 to +141

This comment was marked as resolved.

{{- end }}
9 changes: 9 additions & 0 deletions charts/retool/templates/deployment_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ spec:
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
{{ if .Values.workflows.backend.portName }}
name: {{ .Values.workflows.backend.portName }}
{{ else }}
name: {{ template "retool.name" . }}
{{ end }}
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
Expand Down Expand Up @@ -314,4 +318,9 @@ spec:
- protocol: TCP
port: 80
targetPort: {{ .Values.service.internalPort }}
{{ if .Values.workflows.backend.portName }}
name: {{ .Values.workflows.backend.portName }}
{{ else }}
name: {{ template "retool.name" . }}
{{ end }}
{{- end }}
14 changes: 11 additions & 3 deletions charts/retool/templates/deployment_workflows_worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,14 @@ spec:
{{- end }}
ports:
- containerPort: 3005
{{ if .Values.workflows.worker.portName }}
name: {{ .Values.workflows.worker.portName }}
{{ else }}
name: {{ template "retool.name" . }}
{{ end }}
protocol: TCP
- containerPort: 9090
name: metrics
name: {{ .Values.workflows.worker.metricsPortName | default "metrics" }}
protocol: TCP

{{- if .Values.livenessProbe.enabled }}
Expand Down Expand Up @@ -336,9 +340,13 @@ spec:
- protocol: TCP
port: 3005
targetPort: 3005
{{ if .Values.workflows.worker.portName }}
name: {{ .Values.workflows.worker.portName }}
{{ else }}
name: {{ template "retool.name" . }}
Comment on lines +345 to 346

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 346 is the fallback if .Values.workflows.worker.portName is not set, so we should be good here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean like you do above - the conditional L343-L347 becomes one line

name: {{ .Values.workflows.worker.portName | default (template "retool.name" .) }}

{{ end }}
- protocol: TCP
port: 9090
targetPort: metrics
name: metrics
targetPort: {{ .Values.workflows.worker.metricsPortName | default "metrics" }}
name: {{ .Values.workflows.worker.metricsPortName | default "metrics" }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,15 @@ workflows:
# Scaling this number will increase the number of workflow workers, e.g. a replicaCount of 4
# will launch 9 pods -- 1 workflow backend, 4 workflow workers, and 4 for temporal cluster
replicaCount: 1
# portName: custom-port-name, e.g. http-workflows-worker; defaults to "retool.name"
# metricsPortName: custom-port-name, e.g. http-workflow-worker-metrics; defaults to "metrics"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all the defaults in our values.yaml, I think it would make sense to just pick a default port name and possibly just drop the template "retool.name" . and | default "metrics" dynamic fallbacks. The defaults can be static (i.e. no point to using template "retool.name" anyway) and we can even just use the istio naming convention for them. This would remove the need for those conditionals in templates and just simplify a bit. Adding port names is a non-breaking change anyway I am pretty sure, so extremely low risk.


backend:
# A replicaCount of 1 will launch 6 pods -- 1 workflow backend, 1 workflow worker, and 4 pods that make up the executor temporal cluster
# Scaling this number will increase the number of workflow backends, e.g. a replicaCount of 4
# will launch 9 pods -- 4 workflow backend, 1 workflow workers, and 4 for temporal cluster
replicaCount: 1
# portName: custom-port-name, e.g. http-workflows-backend; defaults to "retool.name"

# Timeout for queries, in ms. This will set the timeout for workflows-related pods only
# If this value is not set but config.dbConnectorTimeout is, we will set workflows pod timeouts
Expand Down Expand Up @@ -452,6 +455,8 @@ codeExecutor:
# tag:
pullPolicy: IfNotPresent

# portName: custom-port-name, e.g. http-code-executor; defaults to "retool.name"

retool-temporal-services-helm:
# Enable to spin up a new Temporal Cluster alongside Retool
enabled: false
Expand Down
5 changes: 5 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,15 @@ workflows:
# Scaling this number will increase the number of workflow workers, e.g. a replicaCount of 4
# will launch 9 pods -- 1 workflow backend, 4 workflow workers, and 4 for temporal cluster
replicaCount: 1
# portName: custom-port-name, e.g. http-workflows-worker; defaults to "retool.name"
# metricsPortName: custom-port-name, e.g. http-workflow-worker-metrics; defaults to "metrics"

backend:
# A replicaCount of 1 will launch 6 pods -- 1 workflow backend, 1 workflow worker, and 4 pods that make up the executor temporal cluster
# Scaling this number will increase the number of workflow backends, e.g. a replicaCount of 4
# will launch 9 pods -- 4 workflow backend, 1 workflow workers, and 4 for temporal cluster
replicaCount: 1
# portName: custom-port-name, e.g. http-workflows-backend; defaults to "retool.name"

# Timeout for queries, in ms. This will set the timeout for workflows-related pods only
# If this value is not set but config.dbConnectorTimeout is, we will set workflows pod timeouts
Expand Down Expand Up @@ -452,6 +455,8 @@ codeExecutor:
# tag:
pullPolicy: IfNotPresent

# portName: custom-port-name, e.g. http-code-executor; defaults to "retool.name"

retool-temporal-services-helm:
# Enable to spin up a new Temporal Cluster alongside Retool
enabled: false
Expand Down
Loading