Skip to content

Commit

Permalink
fix: k8s yaml (#4219)
Browse files Browse the repository at this point in the history
I merged previous PR before some K8S renaming was done. Fixes it.
  • Loading branch information
jvmakine authored Jan 29, 2025
1 parent 9ecb151 commit 736e180
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ DOCKER_IMAGES := '''
"timeline": {},
"lease": {},
"admin": {},
"schemaservice": {}
"schema": {}
}
'''
USER_HERMIT_PACKAGES := "openjdk maven"
Expand Down
6 changes: 3 additions & 3 deletions charts/ftl/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: admin
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ftl-schemaservice.selectorLabels" -}}
{{- define "ftl-schema.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: schemaservice
app.kubernetes.io/component: schema
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/ftl/templates/cron-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"
- name: FTL_SCHEMA_ENDPOINT
value: "http://{{ .Values.schemaservice.service.name }}:{{ .Values.schemaservice.service.port }}"
value: "http://{{ .Values.schema.service.name }}:{{ .Values.schema.service.port }}"
{{- if .Values.cron.nodeSelector }}
nodeSelector:
{{- toYaml .Values.cron.nodeSelector | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/ftl/templates/schema-role.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if .Values.schemaservice.enabled }}
{{- if .Values.schema.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.schemaservice.serviceAccountName }}
name: {{ .Values.schema.serviceAccountName }}
namespace: {{ .Release.Namespace }}

{{- end }}
10 changes: 5 additions & 5 deletions charts/ftl/templates/schema-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: Service
metadata:
labels:
{{- include "ftl.labels" . | nindent 4 }}
name: {{ include "ftl.fullname" . }}-schemaservice
{{- if .Values.schemaservice.service.annotations }}
name: {{ include "ftl.fullname" . }}-schema
{{- if .Values.schema.service.annotations }}
annotations:
{{- toYaml .Values.schemaservice.service.annotations | nindent 4 }}
{{- toYaml .Values.schema.service.annotations | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.schemaservice.service.ports }}
{{- range .Values.schema.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
Expand All @@ -21,4 +21,4 @@ spec:
{{- end }}
selector:
{{- include "ftl-schema.selectorLabels" . | nindent 4 }}
type: {{ .Values.schemaservice.service.type | default "ClusterIP" }}
type: {{ .Values.schema.service.type | default "ClusterIP" }}
52 changes: 26 additions & 26 deletions charts/ftl/templates/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ftl.fullname" . }}-schemaservice
name: {{ include "ftl.fullname" . }}-schema
labels:
{{- include "ftl.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.schemaservice.replicas }}
revisionHistoryLimit: {{ .Values.schemaservice.revisionHistoryLimit }}
replicas: {{ .Values.schema.replicas }}
revisionHistoryLimit: {{ .Values.schema.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "ftl-schema.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ftl-schema.selectorLabels" . | nindent 8 }}
{{- if .Values.schemaservice.podAnnotations }}
{{- if .Values.schema.podAnnotations }}
annotations:
{{- toYaml .Values.schemaservice.podAnnotations | nindent 8 }}
{{- toYaml .Values.schema.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.schemaservice.serviceAccountName }}
serviceAccountName: {{ .Values.schema.serviceAccountName }}
containers:
- name: app
image: "{{ .Values.schemaservice.image.repository }}:{{ .Values.schemaservice.image.tag | default $version }}"
imagePullPolicy: {{ .Values.schemaservice.image.pullPolicy }}
{{- if .Values.schemaservice.envFrom }}
image: "{{ .Values.schema.image.repository }}:{{ .Values.schema.image.tag | default $version }}"
imagePullPolicy: {{ .Values.schema.image.pullPolicy }}
{{- if .Values.schema.envFrom }}
envFrom:
{{- if .Values.schemaservice.envFrom }}
{{- toYaml .Values.schemaservice.envFrom | nindent 12 }}
{{- if .Values.schema.envFrom }}
{{- toYaml .Values.schema.envFrom | nindent 12 }}
{{- end }}
{{- else if or .Values.secrets.logEncryptionKey .Values.secrets.asyncEncryptionKey }}
envFrom:
- secretRef:
name: {{ include "ftl.fullname" . }}-secrets
{{- end }}
env:
{{- if .Values.schemaservice.env }}
{{- toYaml .Values.schemaservice.env | nindent 12 }}
{{- if .Values.schema.env }}
{{- toYaml .Values.schema.env | nindent 12 }}
{{- end }}
- name: FTL_BIND
value: "http://0.0.0.0:{{ (index .Values.schemaservice.ports 0).containerPort }}"
value: "http://0.0.0.0:{{ (index .Values.schema.ports 0).containerPort }}"
ports:
{{- range .Values.schemaservice.ports }}
{{- range .Values.schema.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
protocol: {{ .protocol | default "TCP" }}
{{- end }}
readinessProbe:
{{- if .Values.schemaservice.readinessProbe }}
{{- toYaml .Values.schemaservice.readinessProbe | nindent 12 }}
{{- if .Values.schema.readinessProbe }}
{{- toYaml .Values.schema.readinessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /healthz
port: {{ (index .Values.schemaservice.ports 0).containerPort }}
port: {{ (index .Values.schema.ports 0).containerPort }}
initialDelaySeconds: 1
periodSeconds: 2
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 15
{{- end }}
{{- if .Values.schemaservice.nodeSelector }}
{{- if .Values.schema.nodeSelector }}
nodeSelector:
{{- toYaml .Values.schemaservice.nodeSelector | nindent 8 }}
{{- toYaml .Values.schema.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.schemaservice.affinity }}
{{- if .Values.schema.affinity }}
affinity:
{{- toYaml .Values.schemaservice.affinity | nindent 8 }}
{{- toYaml .Values.schema.affinity | nindent 8 }}
{{- end }}
{{- if .Values.schemaservice.topologySpreadConstraints }}
{{- if .Values.schema.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.schemaservice.topologySpreadConstraints | nindent 8 }}
{{- toYaml .Values.schema.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.schemaservice.tolerations }}
{{- if .Values.schema.tolerations }}
tolerations:
{{- toYaml .Values.schemaservice.tolerations | nindent 8 }}
{{- toYaml .Values.schema.tolerations | nindent 8 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/ftl/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ timeline:
topologySpreadConstraints: null
tolerations: null

schemaservice:
schema:
enabled: true
env:
- name: MY_POD_IP
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions deployment/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rm: teardown
# Deploy all components after building images and setting up Istio
full-deploy: build-all-images setup-istio-cluster
#!/bin/bash
kubectl rollout restart deployment ftl-schemaservice || true # if this exists already restart it to get the latest image
kubectl rollout restart deployment ftl-schema || true # if this exists already restart it to get the latest image
kubectl rollout restart deployment ftl-controller || true # if this exists already restart it to get the latest image
kubectl rollout restart deployment ftl-provisioner || true # if this exists already restart it to get the latest image
kubectl rollout restart deployment ftl-cron || true # if this exists already restart it to get the latest image
Expand All @@ -36,7 +36,7 @@ full-deploy: build-all-images setup-istio-cluster
# Wait for core Kubernetes components to be ready
wait-for-kube:
#!/bin/bash
kubectl wait --for=condition=available deployment/ftl-schemaservice --timeout=5m
kubectl wait --for=condition=available deployment/ftl-schema --timeout=5m
kubectl wait --for=condition=available deployment/ftl-timeline --timeout=5m
kubectl wait --for=condition=available deployment/ftl-console --timeout=5m
kubectl wait --for=condition=available deployment/ftl-controller --timeout=5m
Expand Down
2 changes: 1 addition & 1 deletion deployment/values-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ controller:
- name: "http-8891"
port: 8891

schemaservice:
schema:
podAnnotations:
proxy.istio.io/config: |
holdApplicationUntilProxyStarts: true
Expand Down
2 changes: 1 addition & 1 deletion deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ controller:
proxy.istio.io/config: |
holdApplicationUntilProxyStarts: true
sidecar.istio.io/logLevel: "debug"
schemaservice:
schema:
image:
repository: "ftl:5000/ftl-schema"
tag: "latest"
Expand Down

0 comments on commit 736e180

Please sign in to comment.