Skip to content

Commit

Permalink
Update charts
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Oct 16, 2024
1 parent 6356f75 commit fb4a1a2
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 5 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.383.1
appVersion: 0.383.1
version: 0.384.0
appVersion: 0.384.0
dependencies:
- name: postgresql
version: 15.5.38
Expand Down
5 changes: 5 additions & 0 deletions charts/ftl/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: runner
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ftl-provisioner.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: provisioner
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
1 change: 1 addition & 0 deletions charts/ftl/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
containers:
- name: app
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default $version }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
{{- if .Values.controller.envFrom }}
envFrom:
{{- if .Values.controller.envFrom }}
Expand Down
20 changes: 18 additions & 2 deletions charts/ftl/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,32 @@ spec:
name: ftl-controller
port:
number: 8892
- path: /ingress/
pathType: Prefix
backend:
service:
name: ftl-controller-ingress
port:
number: 8891
{{- if .Values.provisioner.enabled }}
- path: /xyz.block.ftl.v1beta1.provisioner.ProvisionerService/
pathType: Prefix
backend:
service:
name: ftl-provisioner
port:
number: 8893
{{- end }}
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host.host }}
- host: "{{ $host.host }}"
http:
paths:
{{- range $host.paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $fullName }}-controller
name: {{ $host.service.name }}
port:
number: {{ $host.service.port }}
{{- end }}
Expand Down
26 changes: 26 additions & 0 deletions charts/ftl/templates/provisioner-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.provisioner.enabled }}
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "ftl.labels" . | nindent 4 }}
name: {{ include "ftl.fullname" . }}-provisioner
{{- if .Values.provisioner.service.annotations }}
annotations:
{{- toYaml .Values.provisioner.service.annotations | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.provisioner.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
{{- if .appProtocol }}
appProtocol: {{ .appProtocol }}
{{- end }}
targetPort: {{ .targetPort }}
{{- end }}
selector:
{{- include "ftl-provisioner.selectorLabels" . | nindent 4 }}
type: {{ .Values.provisioner.service.type | default "ClusterIP" }}
{{- end }}
78 changes: 78 additions & 0 deletions charts/ftl/templates/provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{- if .Values.provisioner.enabled }}
{{ $version := printf "v%s" .Chart.Version -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ftl.fullname" . }}-provisioner
labels:
{{- include "ftl.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.provisioner.replicas }}
revisionHistoryLimit: {{ .Values.provisioner.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "ftl-provisioner.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ftl-provisioner.selectorLabels" . | nindent 8 }}
{{- if .Values.provisioner.podAnnotations }}
annotations:
{{- toYaml .Values.provisioner.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.provisioner.serviceAccountName }}
containers:
- name: app
image: "{{ .Values.provisioner.image.repository }}:{{ .Values.provisioner.image.tag | default $version }}"
imagePullPolicy: {{ .Values.provisioner.image.pullPolicy }}
{{- if .Values.provisioner.envFrom }}
envFrom:
{{- if .Values.provisioner.envFrom }}
{{- toYaml .Values.provisioner.envFrom | nindent 12 }}
{{- end }}
{{- else if or .Values.secrets.logEncryptionKey .Values.secrets.asyncEncryptionKey }}
envFrom:
- secretRef:
name: {{ include "ftl.fullname" . }}-secrets
{{- end }}
env:
{{- if .Values.provisioner.env }}
{{- toYaml .Values.provisioner.env | nindent 12 }}
{{- end }}
ports:
{{- range .Values.provisioner.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
protocol: {{ .protocol | default "TCP" }}
{{- end }}
readinessProbe:
{{- if .Values.provisioner.readinessProbe }}
{{- toYaml .Values.provisioner.readinessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /healthz
port: 8893
initialDelaySeconds: 1
periodSeconds: 2
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 15
{{- end }}
{{- if .Values.provisioner.nodeSelector }}
nodeSelector:
{{- toYaml .Values.provisioner.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.provisioner.affinity }}
affinity:
{{- toYaml .Values.provisioner.affinity | nindent 8 }}
{{- end }}
{{- if .Values.provisioner.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.provisioner.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.provisioner.tolerations }}
tolerations:
{{- toYaml .Values.provisioner.tolerations | nindent 8 }}
{{- end }}
{{- end }}
55 changes: 54 additions & 1 deletion charts/ftl/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ controller:

image:
repository: "ftl0/ftl-controller"
pullPolicy: IfNotPresent

envFrom: null
dbConnectionString: "postgres://$(endpoint):$(port)/tbd?sslmode=disable&user=$(username)&password=$(password)"
Expand Down Expand Up @@ -86,6 +87,58 @@ controller:
topologySpreadConstraints: null
tolerations: null

provisioner:
enabled: false
replicas: 1
revisionHistoryLimit: 0

image:
repository: "ftl0/ftl-provisioner"
pullPolicy: IfNotPresent

envFrom: null
serviceAccountName: ftl

env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_PROVISIONER_BIND
value: "http://$(MY_POD_IP):8893"
- name: FTL_ENDPOINT
value: "http://ftl-controller:8892"
- name: LOG_LEVEL
value: "debug"
- name: LOG_JSON
value: "true"
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP

ports:
- name: http
containerPort: 8893
protocol: TCP

readinessProbe: null

service:
type: ClusterIP
annotations: null
ports:
- name: "http-8893"
port: 80
protocol: TCP
targetPort: 8893

podAnnotations: null
nodeSelector: null
affinity: null
topologySpreadConstraints: null
tolerations: null

runner:
revisionHistoryLimit: 0

Expand Down Expand Up @@ -136,7 +189,7 @@ runner:
tolerations: null

harbor:
enabled: true
enabled: false
expose:
tls:
enabled: false
Expand Down

0 comments on commit fb4a1a2

Please sign in to comment.