Skip to content

Commit fa5b64b

Browse files
committed
Standarize port handling
1 parent ecaf232 commit fa5b64b

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

charts/friendbot/templates/friendbot-deployment.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,16 @@ spec:
6161
{{- end }}
6262
imagePullPolicy: {{ .Values.global.image.friendbot.pullPolicy }}
6363
ports:
64-
- containerPort: {{ .Values.friendbot.service.targetport | default 8004 }}
64+
- containerPort: {{ .Values.friendbot.configmap.port | default 8000 }}
6565
protocol: TCP
66+
{{- with .Values.friendbot.deployment.container.startupProbe }}
67+
{{- $startupProbe := deepCopy . }}
68+
{{- if and (hasKey $startupProbe "tcpSocket") (kindIs "map" $startupProbe.tcpSocket) (not (hasKey $startupProbe.tcpSocket "port")) }}
69+
{{- $_ := set $startupProbe.tcpSocket "port" ($.Values.friendbot.configmap.port | default 8000) }}
70+
{{- end }}
6671
startupProbe:
67-
tcpSocket:
68-
port: {{ .Values.friendbot.deployment.container.startupProbe.tcpSocketPort }}
69-
initialDelaySeconds: {{ .Values.friendbot.deployment.container.startupProbe.initialDelaySeconds }}
70-
failureThreshold: {{ .Values.friendbot.deployment.container.startupProbe.failureThreshold }}
71-
periodSeconds: {{ .Values.friendbot.deployment.container.startupProbe.periodSeconds }}
72-
timeoutSeconds: {{ .Values.friendbot.deployment.container.startupProbe.timeoutSeconds }}
72+
{{- toYaml $startupProbe | nindent 10 }}
73+
{{- end }}
7374
volumeMounts:
7475
- name: friendbot-secret
7576
mountPath: /secret
@@ -83,4 +84,4 @@ spec:
8384
secretName: {{ include "friendbot.secretName" . }}
8485
- name: friendbot-conf
8586
configMap:
86-
name: {{ template "common.fullname" . }}-config
87+
name: {{ template "common.fullname" . }}-config

charts/friendbot/templates/friendbot-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ spec:
3030
service:
3131
name: {{ template "common.fullname" . }}
3232
port:
33-
number: {{ .Values.friendbot.ingress.port | default 80 }}
33+
number: {{ .Values.friendbot.configmap.port | default 8000 }}

charts/friendbot/templates/friendbot-service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
type: ClusterIP
1616
ports:
1717
- protocol: TCP
18-
port: {{ .Values.friendbot.service.port | default 80 }}
19-
targetPort: {{ .Values.friendbot.service.targetport | default 8004 }}
18+
port: {{ .Values.friendbot.configmap.port | default 8000 }}
19+
targetPort: {{ .Values.friendbot.configmap.port | default 8000 }}
2020
selector:
2121
app: {{ template "common.fullname" . }}

charts/friendbot/values.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ friendbot:
3636
- /secret/secret.conf
3737
replicaCount: 1
3838
startupProbe:
39-
tcpSocketPort: 8004
39+
tcpSocket: {}
4040
initialDelaySeconds: 60
4141
failureThreshold: 60
4242
periodSeconds: 10
@@ -48,14 +48,9 @@ friendbot:
4848
# environment: "dev"
4949
# mylabel1: "myvalue1"
5050

51-
service:
52-
port: 80
53-
targetport: 8004
54-
5551
ingress:
5652
host: "friendbot.example.com"
5753
# ingressClassName: ""
58-
# port: 80
5954
# annotations:
6055
# cert-manager.io/cluster-issuer: "default"
6156

0 commit comments

Comments
 (0)