Skip to content

Commit

Permalink
fix: kube service names (#4406)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Feb 13, 2025
1 parent 9a9fb3b commit cee83dc
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 95 deletions.
18 changes: 8 additions & 10 deletions charts/ftl/templates/console-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,19 @@ spec:
- name: FTL_BIND
value: "http://0.0.0.0:8892"
- name: FTL_TIMELINE_ENDPOINT
value: "http://ftl-timeline:8892"
value: "http://{{ include "ftl.fullname" . }}-timeline:{{ .Values.timeline.port }}"
- name: FTL_ENDPOINT
value: "http://ftl-controller:8892"
value: "http://{{ include "ftl.fullname" . }}-controller:8892"
- name: FTL_ADMIN_ENDPOINT
value: "http://ftl-admin:8892"
value: "http://{{ include "ftl.fullname" . }}-admin:8892"
- name: FTL_VERB_SERVICE_ENDPOINT
value: "http://ftl-controller:8892"
value: "http://{{ include "ftl.fullname" . }}-controller:8892"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:8892"
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"
ports:
{{- range .Values.console.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
protocol: {{ .protocol | default "TCP" }}
{{- end }}
- name: http2
containerPort: 8892
protocol: "TCP"
{{- include "ftl.resources" .Values.console | nindent 10 }}
{{- include "ftl.healthProbes" .Values.console | nindent 10 }}
{{- include "ftl.securityContext" .Values.timeline | nindent 10 }}
Expand Down
10 changes: 4 additions & 6 deletions charts/ftl/templates/console-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ metadata:
{{- end }}
spec:
ports:
{{- range .Values.console.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
targetPort: {{ .targetPort }}
{{- end }}
- name: http2
port: {{ .Values.console.port }}
protocol: "TCP"
targetPort: 8892
selector:
{{- include "ftl-console.selectorLabels" . | nindent 4 }}
type: {{ .Values.console.service.type | default "ClusterIP" }}
Expand Down
8 changes: 4 additions & 4 deletions charts/ftl/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ spec:
{{- toYaml .Values.controller.env | nindent 12 }}
{{- end }}
- name: FTL_TIMELINE_ENDPOINT
value: "http://ftl-timeline:{{ .Values.timeline.port }}"
value: "http://{{ include "ftl.fullname" . }}-timeline:{{ .Values.timeline.port }}"
- name: FTL_LEASE_ENDPOINT
value: "http://ftl-lease:{{ .Values.lease.port }}"
value: "http://{{ include "ftl.fullname" . }}-lease:{{ .Values.lease.port }}"
- name: FTL_ADMIN_ENDPOINT
value: "http://ftl-admin:{{ .Values.admin.port }}"
value: "http://{{ include "ftl.fullname" . }}-admin:{{ .Values.admin.port }}"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:{{ .Values.schema.services.schema.port }}"
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"
- name: FTL_ARTEFACT_REGISTRY
value: "{{ .Values.registry.repository }}"
- name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE
Expand Down
16 changes: 6 additions & 10 deletions charts/ftl/templates/cron-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,12 @@ spec:
{{- if .Values.cron.env }}
{{- toYaml .Values.cron.env | nindent 12 }}
{{- end }}
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_BIND
value: "http://$(MY_POD_IP):{{ .Values.cron.services.cron.containerPort }}"
value: "http://0.0.0.0:{{ .Values.cron.services.cron.containerPort }}"
- name: FTL_TIMELINE_ENDPOINT
value: "http://ftl-timeline:{{ .Values.timeline.port }}"
value: "http://{{ include "ftl.fullname" . }}-timeline:{{ .Values.timeline.port }}"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:8892"
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"
- name: RAFT_INITIAL_MEMBERS
value: "{{- range $index := until (.Values.cron.replicas | int ) }}{{- if ne $index 0 -}},{{- end -}}ftl-cron-{{ add $index 1 }}.ftl-cron-raft:{{$.Values.cron.services.raft.port}}{{- end -}}"
- name: RAFT_INITIAL_REPLICA_IDS
Expand All @@ -76,11 +72,11 @@ spec:
fieldRef:
fieldPath: metadata.labels['apps.kubernetes.io/pod-index']
- name: RAFT_ADDRESS
value: "ftl-cron-$(ORDINAL_NUMBER).ftl-cron-raft:{{$.Values.cron.services.raft.port}}"
value: "{{ include "ftl.fullname" . }}-cron-$(ORDINAL_NUMBER).{{ include "ftl.fullname" . }}-cron-raft:{{$.Values.cron.services.raft.port}}"
- name: RAFT_LISTEN_ADDRESS
value: "$(MY_POD_IP):{{$.Values.cron.services.raft.port}}"
value: "0.0.0.0:{{$.Values.cron.services.raft.port}}"
- name: RAFT_CONTROL_ADDRESS
value: "http://ftl-cron:{{ .Values.cron.services.cron.port }}"
value: "http://{{ include "ftl.fullname" . }}-cron:{{ .Values.cron.services.cron.port }}"
{{- include "ftl.resources" .Values.cron | nindent 10 }}
{{- include "ftl.securityContext" .Values.cron | nindent 10 }}
{{- include "ftl.commonPodConfig" .Values.cron | nindent 6 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/ftl/templates/http-ingress-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ spec:
- name: FTL_BIND
value: "http://0.0.0.0:8892"
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"
value: "http://{{ include "ftl.fullname" . }}-timeline:{{ .Values.timeline.port }}"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:8892"
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"

ports:
{{- range .Values.ingress.ports }}
Expand Down
4 changes: 3 additions & 1 deletion charts/ftl/templates/provisioner-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ spec:
- name: FTL_WORKING_DIR
value: "/working"
- name: FTL_ENDPOINT
value: "http://ftl-controller:{{ .Values.controller.port }}"
value: "http://{{ include "ftl.fullname" . }}-controller:{{ .Values.controller.port }}"
- name: FTL_SCHEMA_ENDPOINT
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"
{{- if .Values.provisioner.env }}
{{- toYaml .Values.provisioner.env | nindent 12 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ftl/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ data:
- name: FTL_LEASE_ENDPOINT
value: http://ftl-lease:8892
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"
value: "http://{{ include "ftl.fullname" . }}-timeline:{{ .Values.timeline.port }}"
- name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE
value: "{{ .Values.registry.allowInsecure }}"
- name: FTL_ARTEFACT_REGISTRY_USERNAME
Expand Down
12 changes: 6 additions & 6 deletions charts/ftl/templates/schema-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
{{- toYaml .Values.schema.env | nindent 12 }}
{{- end }}
- name: FTL_BIND
value: "http://0.0.0.0:{{ .Values.schema.services.schema.containerPort }}"
value: "http://0.0.0.0:{{ .Values.schema.services.schema.port }}"
- name: RAFT_INITIAL_MEMBERS
value: "{{- range $index := until (.Values.schema.replicas | int ) }}{{- if ne $index 0 -}},{{- end -}}ftl-schema-{{ add $index 1 }}.ftl-schema-raft:{{$.Values.schema.services.raft.port}}{{- end -}}"
- name: RAFT_INITIAL_REPLICA_IDS
Expand All @@ -69,17 +69,17 @@ spec:
fieldRef:
fieldPath: metadata.labels['apps.kubernetes.io/pod-index']
- name: RAFT_ADDRESS
value: "ftl-schema-$(ORDINAL_NUMBER).ftl-schema-raft:{{$.Values.schema.services.raft.port}}"
value: "{{ include "ftl.fullname" . }}-schema-$(ORDINAL_NUMBER).{{ include "ftl.fullname" . }}-schema-raft:{{$.Values.schema.services.raft.port}}"
- name: RAFT_LISTEN_ADDRESS
value: "$(MY_POD_IP):{{$.Values.schema.services.raft.port}}"
value: "0.0.0.0:{{$.Values.schema.services.raft.port}}"
- name: RAFT_CONTROL_ADDRESS
value: "http://ftl-schema:8892"
value: "http://{{ include "ftl.fullname" . }}-schema:{{ $.Values.schema.services.schema.port }}"
ports:
- name: http
containerPort: {{ .Values.schema.services.schema.containerPort }}
containerPort: {{ .Values.schema.services.schema.port }}
protocol: "TCP"
- name: raft
containerPort: {{ .Values.schema.services.raft.containerPort }}
containerPort: {{ .Values.schema.services.raft.port }}
protocol: "TCP"
{{- include "ftl.resources" .Values.schema | nindent 10 }}
{{- include "ftl.healthProbes" .Values.schema | nindent 10 }}
Expand Down
9 changes: 5 additions & 4 deletions charts/ftl/templates/timeline-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ spec:
imagePullPolicy: {{ .Values.timeline.image.pullPolicy | default .Values.image.pullPolicy }}
{{- if .Values.timeline.envFrom }}
envFrom:
{{- if .Values.timeline.envFrom }}
{{- toYaml .Values.timeline.envFrom | nindent 12 }}
{{- end }}
{{- end }}
env:
- name: FTL_ENDPOINT
value: "http://{{- include "ftl.fullname" . -}}:8892"
- name: FTL_BIND
value: "http://0.0.0.0:8892"
{{- if .Values.timeline.env }}
{{- toYaml .Values.timeline.env | nindent 12 }}
{{- toYaml .Values.provisioner.env | nindent 12 }}
{{- end }}

ports:
- name: http2
containerPort: {{ .Values.timeline.port }}
Expand Down
45 changes: 2 additions & 43 deletions charts/ftl/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ controller:
value: "http://$(MY_POD_IP):8892"
- name: FTL_ADVERTISE
value: "http://$(MY_POD_IP):8892"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:8892"
- name: LOG_LEVEL
value: "debug"
- name: LOG_JSON
Expand Down Expand Up @@ -86,14 +84,6 @@ provisioner:
serviceAccountName: ftl-provisioner

env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_BIND
value: "http://$(MY_POD_IP):8893"
- name: FTL_SCHEMA_ENDPOINT
value: "http://ftl-schema:8892"
- name: LOG_LEVEL
value: "debug"
- name: LOG_JSON
Expand Down Expand Up @@ -298,19 +288,7 @@ ingress:

timeline:
enabled: true
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_ENDPOINT
value: "http://ftl-controller:8892"
- name: FTL_BIND
value: "http://$(MY_POD_IP):8892"
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
env: nil

port: 8892

Expand All @@ -330,10 +308,8 @@ timeline:
limits:
memory: 128Mi
cpu: 2

envFrom: null
serviceAccountName: ftl-timeline

readinessProbe: null

service:
Expand All @@ -350,18 +326,8 @@ schema:
replicas: 3
storage: 50Mi
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_BIND
value: "http://$(MY_POD_IP):8892"
- name: LOG_LEVEL
value: "trace"
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP

revisionHistoryLimit: 0

Expand All @@ -386,15 +352,12 @@ schema:
readinessProbe: null

services:
port: 8892
schema:
type: ClusterIP
annotations: null
containerPort: 8892
port: 8892
raft:
annotations: null
containerPort: 8893
port: 8893
podAnnotations: null
nodeSelector: null
Expand All @@ -417,11 +380,7 @@ console:
value: "debug"
- name: LOG_JSON
value: "true"
ports:
- name: http
containerPort: 8892
protocol: TCP
port: 8892
port: 8892

replicas: 1
revisionHistoryLimit: 0
Expand Down
8 changes: 0 additions & 8 deletions deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ image:

ingress:
enabled: true
image:
repository: "ftl:5000/ftl-http-ingress"
ingressAnnotations:
ingress.kubernetes.io/ssl-redirect: "false"
kubernetes.io/ingress.class: traefik

schema:
service:
ports:
- name: "http-8892"
port: 8892

runner:
podAnnotations:
sidecar.istio.io/logLevel: "debug"
Expand Down

0 comments on commit cee83dc

Please sign in to comment.