From fb4a1a2d0933ba7d6b227d10c7918051fd0fddbf Mon Sep 17 00:00:00 2001 From: alecthomas Date: Wed, 16 Oct 2024 03:01:18 +0000 Subject: [PATCH] Update charts --- charts/ftl/Chart.yaml | 4 +- charts/ftl/templates/_helpers.tpl | 5 ++ charts/ftl/templates/controller.yaml | 1 + charts/ftl/templates/ingress.yaml | 20 ++++- .../ftl/templates/provisioner-services.yaml | 26 +++++++ charts/ftl/templates/provisioner.yaml | 78 +++++++++++++++++++ charts/ftl/values.yaml | 55 ++++++++++++- 7 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 charts/ftl/templates/provisioner-services.yaml create mode 100644 charts/ftl/templates/provisioner.yaml diff --git a/charts/ftl/Chart.yaml b/charts/ftl/Chart.yaml index 5a294d5..96306f9 100644 --- a/charts/ftl/Chart.yaml +++ b/charts/ftl/Chart.yaml @@ -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 diff --git a/charts/ftl/templates/_helpers.tpl b/charts/ftl/templates/_helpers.tpl index b4c6059..f447922 100644 --- a/charts/ftl/templates/_helpers.tpl +++ b/charts/ftl/templates/_helpers.tpl @@ -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 -}} \ No newline at end of file diff --git a/charts/ftl/templates/controller.yaml b/charts/ftl/templates/controller.yaml index a55c8c9..f39df5e 100644 --- a/charts/ftl/templates/controller.yaml +++ b/charts/ftl/templates/controller.yaml @@ -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 }} diff --git a/charts/ftl/templates/ingress.yaml b/charts/ftl/templates/ingress.yaml index 784185f..d204a35 100644 --- a/charts/ftl/templates/ingress.yaml +++ b/charts/ftl/templates/ingress.yaml @@ -17,8 +17,24 @@ 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 }} @@ -26,7 +42,7 @@ spec: pathType: {{ .pathType }} backend: service: - name: {{ $fullName }}-controller + name: {{ $host.service.name }} port: number: {{ $host.service.port }} {{- end }} diff --git a/charts/ftl/templates/provisioner-services.yaml b/charts/ftl/templates/provisioner-services.yaml new file mode 100644 index 0000000..090e356 --- /dev/null +++ b/charts/ftl/templates/provisioner-services.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/ftl/templates/provisioner.yaml b/charts/ftl/templates/provisioner.yaml new file mode 100644 index 0000000..df0fa82 --- /dev/null +++ b/charts/ftl/templates/provisioner.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/ftl/values.yaml b/charts/ftl/values.yaml index 85fee92..def4e54 100644 --- a/charts/ftl/values.yaml +++ b/charts/ftl/values.yaml @@ -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)" @@ -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 @@ -136,7 +189,7 @@ runner: tolerations: null harbor: - enabled: true + enabled: false expose: tls: enabled: false