From fbd71964a82edd30b55be3e1a3d3cf5acaef6099 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 7 Mar 2025 09:56:24 +1100 Subject: [PATCH 1/2] chore: move k3d specifics into a seperate chart --- charts/ftl-k3d/Chart.lock | 9 ++++++ charts/ftl-k3d/Chart.yaml | 15 ++++++++++ .../{ftl => ftl-k3d}/templates/ingress.yaml | 25 ++-------------- charts/{ftl => ftl-k3d}/templates/istio.yaml | 2 -- .../{ftl => ftl-k3d}/templates/registry.yaml | 11 ++----- charts/ftl-k3d/values.yaml | 20 +++++++++++++ charts/ftl/Chart.yaml | 7 +---- charts/ftl/templates/secrets.yaml | 12 ++++---- charts/ftl/values.yaml | 19 +----------- deployment/Justfile | 3 +- deployment/values.yaml | 29 +++++-------------- 11 files changed, 67 insertions(+), 85 deletions(-) create mode 100644 charts/ftl-k3d/Chart.lock create mode 100644 charts/ftl-k3d/Chart.yaml rename charts/{ftl => ftl-k3d}/templates/ingress.yaml (56%) rename charts/{ftl => ftl-k3d}/templates/istio.yaml (96%) rename charts/{ftl => ftl-k3d}/templates/registry.yaml (66%) create mode 100644 charts/ftl-k3d/values.yaml diff --git a/charts/ftl-k3d/Chart.lock b/charts/ftl-k3d/Chart.lock new file mode 100644 index 0000000000..6c063af851 --- /dev/null +++ b/charts/ftl-k3d/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 15.5.38 +- name: ftl + repository: file://../ftl + version: 0.0.1 +digest: sha256:2363f84fe0a4a43b5cb3d48325f3db617d60b32b7488a09aa874364f56fc4233 +generated: "2025-03-07T09:50:45.346116+11:00" diff --git a/charts/ftl-k3d/Chart.yaml b/charts/ftl-k3d/Chart.yaml new file mode 100644 index 0000000000..33e0d2b106 --- /dev/null +++ b/charts/ftl-k3d/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +name: ftl-k3d +description: | + A Helm chart for Kubernetes that deploys supplimental dependencies for k3d +home: https://github.com/block/ftl +version: 0.0.1 +appVersion: 0.0.1 +dependencies: + - name: postgresql + version: 15.5.38 + repository: oci://registry-1.docker.io/bitnamicharts + condition: postgresql.enabled + - name: ftl + version: 0.0.1 + repository: file://../ftl \ No newline at end of file diff --git a/charts/ftl/templates/ingress.yaml b/charts/ftl-k3d/templates/ingress.yaml similarity index 56% rename from charts/ftl/templates/ingress.yaml rename to charts/ftl-k3d/templates/ingress.yaml index 00e4dc8e8a..a3544b1cf7 100644 --- a/charts/ftl/templates/ingress.yaml +++ b/charts/ftl-k3d/templates/ingress.yaml @@ -1,11 +1,10 @@ -{{- if .Values.ingress.enabled }} -{{ $fullName := include "ftl.fullname" . -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "ftl.fullname" . }}-ingress + name: ftl-ingress annotations: - {{- toYaml .Values.ingress.ingressAnnotations | nindent 4 }} + ingress.kubernetes.io/ssl-redirect: "false" + kubernetes.io/ingress.class: traefik spec: rules: - http: @@ -38,21 +37,3 @@ spec: name: ftl-admin port: number: 8892 - {{- range $host := .Values.ingress.hosts }} - - host: "{{ $host.host }}" - http: - paths: - {{- range $host.paths }} - - path: {{ .path }} - pathType: {{ .pathType }} - backend: - service: - name: {{ $host.service.name }} - port: - number: {{ $host.service.port }} - {{- end }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: {{- toYaml .Values.ingress.tls | nindent 4 }} - {{- end }} -{{- end }} diff --git a/charts/ftl/templates/istio.yaml b/charts/ftl-k3d/templates/istio.yaml similarity index 96% rename from charts/ftl/templates/istio.yaml rename to charts/ftl-k3d/templates/istio.yaml index 288474b580..4490bd103a 100644 --- a/charts/ftl/templates/istio.yaml +++ b/charts/ftl-k3d/templates/istio.yaml @@ -1,4 +1,3 @@ -{{- if .Values.istio.enabled }} apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: @@ -34,4 +33,3 @@ spec: operation: MERGE value: http2_protocol_options: {} -{{- end }} \ No newline at end of file diff --git a/charts/ftl/templates/registry.yaml b/charts/ftl-k3d/templates/registry.yaml similarity index 66% rename from charts/ftl/templates/registry.yaml rename to charts/ftl-k3d/templates/registry.yaml index 8a43b6d3e4..e1db71be7c 100644 --- a/charts/ftl/templates/registry.yaml +++ b/charts/ftl-k3d/templates/registry.yaml @@ -1,4 +1,3 @@ -{{- if .Values.registry.create }} apiVersion: apps/v1 kind: Deployment metadata: @@ -24,12 +23,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: {{ include "ftl.fullname" . }}-registry - - {{- if .Values.registry.service.annotations }} - annotations: - {{- toYaml .Values.registry.service.annotations | nindent 4 }} - {{- end }} + name: ftl-registry spec: ports: - name: http @@ -38,5 +32,4 @@ spec: targetPort: 5000 selector: app: registry - type: "ClusterIP" -{{- end }} \ No newline at end of file + type: "ClusterIP" \ No newline at end of file diff --git a/charts/ftl-k3d/values.yaml b/charts/ftl-k3d/values.yaml new file mode 100644 index 0000000000..31d066e1d8 --- /dev/null +++ b/charts/ftl-k3d/values.yaml @@ -0,0 +1,20 @@ +postgresql: + enabled: false + architecture: standalone + primary: + resources: + requests: + memory: 1024Mi + limits: + memory: 1024Mi + global: + postgresql: + auth: + username: ftl + password: ftl + database: ftl + +ftl: + registry: + repository: "ftl-registry:5000/ftl-artefacts" + allowInsecure: "true" \ No newline at end of file diff --git a/charts/ftl/Chart.yaml b/charts/ftl/Chart.yaml index 801204abd0..2a38c0dee8 100644 --- a/charts/ftl/Chart.yaml +++ b/charts/ftl/Chart.yaml @@ -4,9 +4,4 @@ description: | A Helm chart for Kubernetes that deploys FTL home: https://github.com/block/ftl version: 0.0.1 -appVersion: 0.0.1 -dependencies: - - name: postgresql - version: 15.5.38 - repository: oci://registry-1.docker.io/bitnamicharts - condition: postgresql.enabled +appVersion: 0.0.1 \ No newline at end of file diff --git a/charts/ftl/templates/secrets.yaml b/charts/ftl/templates/secrets.yaml index 12479b6cbf..1d49b3d788 100644 --- a/charts/ftl/templates/secrets.yaml +++ b/charts/ftl/templates/secrets.yaml @@ -6,9 +6,9 @@ metadata: {{- include "ftl.labels" . | nindent 4 }} type: Opaque stringData: - FTL_LOG_ENCRYPTION_KEY: {{ .Values.secrets.logEncryptionKey }} - FTL_ASYNC_ENCRYPTION_KEY: {{ .Values.secrets.asyncEncryptionKey }} - FTL_CONTROLLER_REGISTRY_USERNAME: {{ .Values.secrets.controllerRegistryUsername }} - FTL_CONTROLLER_REGISTRY_PASSWORD: {{ .Values.secrets.controllerRegistryPassword }} - FTL_RUNNER_REGISTRY_USERNAME: {{ .Values.secrets.runnerRegistryUsername }} - FTL_RUNNER_REGISTRY_PASSWORD: {{ .Values.secrets.runnerRegistryPassword }} \ No newline at end of file + FTL_LOG_ENCRYPTION_KEY: "{{ .Values.secrets.logEncryptionKey }}" + FTL_ASYNC_ENCRYPTION_KEY: "{{ .Values.secrets.asyncEncryptionKey }}" + FTL_CONTROLLER_REGISTRY_USERNAME: "{{ .Values.secrets.controllerRegistryUsername }}" + FTL_CONTROLLER_REGISTRY_PASSWORD: "{{ .Values.secrets.controllerRegistryPassword }}" + FTL_RUNNER_REGISTRY_USERNAME: "{{ .Values.secrets.runnerRegistryUsername }}" + FTL_RUNNER_REGISTRY_PASSWORD: "{{ .Values.secrets.runnerRegistryPassword }}" \ No newline at end of file diff --git a/charts/ftl/values.yaml b/charts/ftl/values.yaml index 3f134e22c3..ff742b33be 100644 --- a/charts/ftl/values.yaml +++ b/charts/ftl/values.yaml @@ -1,4 +1,4 @@ -fullnameOverride: "" +fullnameOverride: "ftl" nameOverride: "" logLevel: debug @@ -172,22 +172,6 @@ cron: memory: 128Mi cpu: 2 -postgresql: - enabled: false - architecture: standalone - primary: - resources: - requests: - memory: 1024Mi - limits: - memory: 1024Mi - global: - postgresql: - auth: - username: ftl - password: ftl - database: ftl - istio: enabled: false # set to true to have this chart install the grpc config to enable trailers holdApplicationUntilProxyStarts: true @@ -200,7 +184,6 @@ registry: annotations: null ingress: - enabled: false allowOrigin: "*" env: null diff --git a/deployment/Justfile b/deployment/Justfile index 6f48756e75..4e863ea284 100644 --- a/deployment/Justfile +++ b/deployment/Justfile @@ -102,7 +102,8 @@ teardown: teardown-cluster teardown-registry # Apply Helm chart for FTL deployment apply: kubectl delete job --ignore-not-found=true ftl-dbmig-latest - helm upgrade --install ftl ../charts/ftl -f values.yaml + helm dependency build ../charts/ftl-k3d + helm upgrade --install ftl-k3d ../charts/ftl-k3d -f values.yaml # Deploy specific version of FTL from Helm repository deploy-version version: setup-istio-cluster diff --git a/deployment/values.yaml b/deployment/values.yaml index c49cd149b1..8bcbddb45a 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -1,25 +1,12 @@ -fullnameOverride: "ftl" -image: - tag: "latest" - pullPolicy: Always - base: "ftl:5000" +ftl: + runner: + podAnnotations: + sidecar.istio.io/logLevel: "debug" + image: + tag: "latest" + pullPolicy: Always + base: "ftl:5000" -ingress: - enabled: true - ingressAnnotations: - ingress.kubernetes.io/ssl-redirect: "false" - kubernetes.io/ingress.class: traefik -runner: - podAnnotations: - sidecar.istio.io/logLevel: "debug" - -istio: - enabled: true - -registry: - repository: "ftl-registry:5000/ftl-artefacts" - allowInsecure: "true" - create: true From cbf76a321db630817cd488d24b999c8971ac057e Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 7 Mar 2025 12:06:12 +1100 Subject: [PATCH 2/2] tmp --- charts/ftl-k3d/Chart.lock | 7 ++----- charts/ftl-k3d/Chart.yaml | 4 ---- charts/ftl-k3d/values.yaml | 15 --------------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/charts/ftl-k3d/Chart.lock b/charts/ftl-k3d/Chart.lock index 6c063af851..96db4645a1 100644 --- a/charts/ftl-k3d/Chart.lock +++ b/charts/ftl-k3d/Chart.lock @@ -1,9 +1,6 @@ dependencies: -- name: postgresql - repository: oci://registry-1.docker.io/bitnamicharts - version: 15.5.38 - name: ftl repository: file://../ftl version: 0.0.1 -digest: sha256:2363f84fe0a4a43b5cb3d48325f3db617d60b32b7488a09aa874364f56fc4233 -generated: "2025-03-07T09:50:45.346116+11:00" +digest: sha256:c1db1cd9b05146c2404cae0a8cabe17ceb8f91a852948fe8f7a0312ea24d82dd +generated: "2025-03-07T12:05:56.43938+11:00" diff --git a/charts/ftl-k3d/Chart.yaml b/charts/ftl-k3d/Chart.yaml index 33e0d2b106..6b70053e76 100644 --- a/charts/ftl-k3d/Chart.yaml +++ b/charts/ftl-k3d/Chart.yaml @@ -6,10 +6,6 @@ home: https://github.com/block/ftl version: 0.0.1 appVersion: 0.0.1 dependencies: - - name: postgresql - version: 15.5.38 - repository: oci://registry-1.docker.io/bitnamicharts - condition: postgresql.enabled - name: ftl version: 0.0.1 repository: file://../ftl \ No newline at end of file diff --git a/charts/ftl-k3d/values.yaml b/charts/ftl-k3d/values.yaml index 31d066e1d8..c6d22465d6 100644 --- a/charts/ftl-k3d/values.yaml +++ b/charts/ftl-k3d/values.yaml @@ -1,18 +1,3 @@ -postgresql: - enabled: false - architecture: standalone - primary: - resources: - requests: - memory: 1024Mi - limits: - memory: 1024Mi - global: - postgresql: - auth: - username: ftl - password: ftl - database: ftl ftl: registry: