Skip to content

Commit

Permalink
Update charts
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Dec 9, 2024
1 parent 2cb39c8 commit 83f018f
Show file tree
Hide file tree
Showing 14 changed files with 365 additions and 16 deletions.
4 changes: 2 additions & 2 deletions charts/ftl/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: ftl
description: |
A Helm chart for Kubernetes that deploys FTL
home: https://github.com/TBD54566975/ftl
version: 0.408.2
appVersion: 0.408.2
version: 0.409.0
appVersion: 0.409.0
dependencies:
- name: postgresql
version: 15.5.38
Expand Down
12 changes: 11 additions & 1 deletion charts/ftl/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: http-ingress
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- end -}}
{{- define "ftl-timeline.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: timeline
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ftl-lease.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: lease
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
8 changes: 4 additions & 4 deletions charts/ftl/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ spec:
- name: FTL_CONTROLLER_DSN
value: "postgres://{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.global.postgresql.auth.database }}?sslmode=disable&user={{ .Values.postgresql.global.postgresql.auth.username }}&password={{ .Values.postgresql.global.postgresql.auth.password }}"
{{- end }}
{{- if .Values.controller.kmsUri }}
- name: FTL_KMS_URI
value: "{{ .Values.controller.kmsUri }}"
{{- end }}
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"
- name: FTL_LEASE_ENDPOINT
value: http://ftl-lease:8892
- name: FTL_ARTEFACT_REGISTRY
value: "{{ .Values.registry.repository }}"
- name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE
Expand Down
4 changes: 3 additions & 1 deletion charts/ftl/templates/cron-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
{{- if .Values.cron.env }}
{{- toYaml .Values.cron.env | nindent 12 }}
{{- end }}
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"
{{- if .Values.cron.nodeSelector }}
nodeSelector:
{{- toYaml .Values.cron.nodeSelector | nindent 8 }}
Expand All @@ -50,4 +52,4 @@ spec:
{{- if .Values.cron.tolerations }}
tolerations:
{{- toYaml .Values.cron.tolerations | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/ftl/templates/http-ingress-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
{{- if .Values.ingress.env }}
{{- toYaml .Values.ingress.env | nindent 12 }}
{{- end }}
- name: FTL_TIMELINE_ENDPOINT
value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}"

ports:
{{- range .Values.ingress.ports }}
Expand Down
5 changes: 5 additions & 0 deletions charts/ftl/templates/istio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ spec:
explicit_http_config:
http_protocol_options:
enable_trailers: true
- applyTo: CLUSTER
patch:
operation: MERGE
value:
http2_protocol_options: {}
{{- end }}
80 changes: 80 additions & 0 deletions charts/ftl/templates/lease-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{{ $version := printf "v%s" .Chart.Version -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ftl.fullname" . }}-lease
labels:
{{- include "ftl.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.lease.replicas }}
revisionHistoryLimit: {{ .Values.lease.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "ftl-lease.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ftl-lease.selectorLabels" . | nindent 8 }}
{{- if .Values.lease.podAnnotations }}
annotations:
{{- toYaml .Values.lease.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.lease.serviceAccountName }}
containers:
- name: app
image: "{{ .Values.lease.image.repository }}:{{ .Values.lease.image.tag | default $version }}"
imagePullPolicy: {{ .Values.lease.image.pullPolicy }}
resources:
limits:
cpu: "{{ .Values.lease.resources.limits.cpu }}"
memory: "{{ .Values.lease.resources.limits.memory }}"
requests:
cpu: "{{ .Values.lease.resources.requests.cpu }}"
memory: "{{ .Values.lease.resources.requests.memory }}"
{{- if .Values.lease.envFrom }}
envFrom:
{{- if .Values.lease.envFrom }}
{{- toYaml .Values.lease.envFrom | nindent 12 }}
{{- end }}
{{- end }}
env:
{{- if .Values.lease.env }}
{{- toYaml .Values.lease.env | nindent 12 }}
{{- end }}

ports:
{{- range .Values.lease.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
protocol: {{ .protocol | default "TCP" }}
{{- end }}
readinessProbe:
{{- if .Values.lease.readinessProbe }}
{{- toYaml .Values.lease.readinessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /healthz
port: 8892
initialDelaySeconds: 1
periodSeconds: 2
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 15
{{- end }}
{{- if .Values.lease.nodeSelector }}
nodeSelector:
{{- toYaml .Values.lease.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.lease.affinity }}
affinity:
{{- toYaml .Values.lease.affinity | nindent 8 }}
{{- end }}
{{- if .Values.lease.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.lease.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.lease.tolerations }}
tolerations:
{{- toYaml .Values.lease.tolerations | nindent 8 }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/ftl/templates/lease-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.lease.serviceAccountName }}
namespace: {{ .Release.Namespace }}
21 changes: 21 additions & 0 deletions charts/ftl/templates/lease-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "ftl.labels" . | nindent 4 }}
name: {{ include "ftl.fullname" . }}-lease
{{- if .Values.lease.service.annotations }}
annotations:
{{- toYaml .Values.lease.service.annotations | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.lease.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
targetPort: {{ .targetPort }}
{{- end }}
selector:
{{- include "ftl-lease.selectorLabels" . | nindent 4 }}
type: {{ .Values.lease.service.type | default "ClusterIP" }}
2 changes: 2 additions & 0 deletions charts/ftl/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ data:
value: "{{ .Values.registry.repository }}"
- name: FTL_BIND
value: "http://0.0.0.0:{{ (index .Values.runner.ports 0).containerPort }}"
- name: FTL_LEASE_ENDPOINT
value: http://ftl-lease:8892
- name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE
value: "{{ .Values.registry.allowInsecure }}"
- name: FTL_ARTEFACT_REGISTRY_USERNAME
Expand Down
83 changes: 83 additions & 0 deletions charts/ftl/templates/timeline-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{{- if .Values.timeline.enabled }}
{{ $version := printf "v%s" .Chart.Version -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ftl.fullname" . }}-timeline
labels:
{{- include "ftl.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.timeline.replicas }}
revisionHistoryLimit: {{ .Values.timeline.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "ftl-timeline.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ftl-timeline.selectorLabels" . | nindent 8 }}
{{- if .Values.timeline.podAnnotations }}
annotations:
{{- toYaml .Values.timeline.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.timeline.serviceAccountName }}
containers:
- name: app
image: "{{ .Values.timeline.image.repository }}:{{ .Values.timeline.image.tag | default $version }}"
imagePullPolicy: {{ .Values.timeline.image.pullPolicy }}
resources:
limits:
cpu: "{{ .Values.timeline.resources.limits.cpu }}"
memory: "{{ .Values.timeline.resources.limits.memory }}"
requests:
cpu: "{{ .Values.timeline.resources.requests.cpu }}"
memory: "{{ .Values.timeline.resources.requests.memory }}"
{{- if .Values.timeline.envFrom }}
envFrom:
{{- if .Values.timeline.envFrom }}
{{- toYaml .Values.timeline.envFrom | nindent 12 }}
{{- end }}
{{- end }}
env:
{{- if .Values.timeline.env }}
{{- toYaml .Values.timeline.env | nindent 12 }}
{{- end }}

ports:
{{- range .Values.timeline.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
protocol: {{ .protocol | default "TCP" }}
{{- end }}
readinessProbe:
{{- if .Values.timeline.readinessProbe }}
{{- toYaml .Values.timeline.readinessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /healthz
port: 8892
initialDelaySeconds: 1
periodSeconds: 2
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 15
{{- end }}
{{- if .Values.timeline.nodeSelector }}
nodeSelector:
{{- toYaml .Values.timeline.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.timeline.affinity }}
affinity:
{{- toYaml .Values.timeline.affinity | nindent 8 }}
{{- end }}
{{- if .Values.timeline.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.timeline.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.timeline.tolerations }}
tolerations:
{{- toYaml .Values.timeline.tolerations | nindent 8 }}
{{- end }}

{{- end }}
8 changes: 8 additions & 0 deletions charts/ftl/templates/timeline-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.timeline.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.timeline.serviceAccountName }}
namespace: {{ .Release.Namespace }}

{{- end }}
24 changes: 24 additions & 0 deletions charts/ftl/templates/timeline-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.timeline.enabled }}
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "ftl.labels" . | nindent 4 }}
name: {{ include "ftl.fullname" . }}-timeline
{{- if .Values.timeline.service.annotations }}
annotations:
{{- toYaml .Values.timeline.service.annotations | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.timeline.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
targetPort: {{ .targetPort }}
{{- end }}
selector:
{{- include "ftl-timeline.selectorLabels" . | nindent 4 }}
type: {{ .Values.timeline.service.type | default "ClusterIP" }}

{{- end }}
Loading

0 comments on commit 83f018f

Please sign in to comment.