diff --git a/charts/ftl/Chart.yaml b/charts/ftl/Chart.yaml index 537f5e7..f6f64c5 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.409.0 -appVersion: 0.409.0 +version: 0.410.0 +appVersion: 0.410.0 dependencies: - name: postgresql version: 15.5.38 diff --git a/charts/ftl/templates/_helpers.tpl b/charts/ftl/templates/_helpers.tpl index 75724c1..88869a3 100644 --- a/charts/ftl/templates/_helpers.tpl +++ b/charts/ftl/templates/_helpers.tpl @@ -67,3 +67,8 @@ app.kubernetes.io/name: {{ include "ftl.fullname" . }} app.kubernetes.io/component: lease app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} +{{- define "ftl-console.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ftl.fullname" . }} +app.kubernetes.io/component: console +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} diff --git a/charts/ftl/templates/console-deployment.yaml b/charts/ftl/templates/console-deployment.yaml new file mode 100644 index 0000000..858e65e --- /dev/null +++ b/charts/ftl/templates/console-deployment.yaml @@ -0,0 +1,85 @@ +{{- if .Values.console.enabled }} +{{ $version := printf "v%s" .Chart.Version -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ftl.fullname" . }}-console + labels: + {{- include "ftl.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.console.replicas }} + revisionHistoryLimit: {{ .Values.console.revisionHistoryLimit }} + selector: + matchLabels: + {{- include "ftl-console.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "ftl-console.selectorLabels" . | nindent 8 }} + {{- if .Values.console.podAnnotations }} + annotations: + {{- toYaml .Values.console.podAnnotations | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ .Values.console.serviceAccountName }} + containers: + - name: app + image: "{{ .Values.console.image.repository }}:{{ .Values.console.image.tag | default $version }}" + imagePullPolicy: {{ .Values.console.image.pullPolicy }} + resources: + limits: + cpu: "{{ .Values.console.resources.limits.cpu }}" + memory: "{{ .Values.console.resources.limits.memory }}" + requests: + cpu: "{{ .Values.console.resources.requests.cpu }}" + memory: "{{ .Values.console.resources.requests.memory }}" + {{- if .Values.console.envFrom }} + envFrom: + {{- if .Values.console.envFrom }} + {{- toYaml .Values.console.envFrom | nindent 12 }} + {{- end }} + {{- end }} + env: + {{- if .Values.console.env }} + {{- toYaml .Values.console.env | nindent 12 }} + {{- end }} + - name: FTL_TIMELINE_ENDPOINT + value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}" + - name: FTL_ENDPOINT + value: "http://ftl-controller:8892" + ports: + {{- range .Values.console.ports }} + - name: {{ .name }} + containerPort: {{ .containerPort }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + readinessProbe: + {{- if .Values.console.readinessProbe }} + {{- toYaml .Values.console.readinessProbe | nindent 12 }} + {{- else }} + httpGet: + path: /healthz + port: 8892 + initialDelaySeconds: 1 + periodSeconds: 2 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 15 + {{- end }} + {{- if .Values.console.nodeSelector }} + nodeSelector: + {{- toYaml .Values.console.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.console.affinity }} + affinity: + {{- toYaml .Values.console.affinity | nindent 8 }} + {{- end }} + {{- if .Values.console.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml .Values.console.topologySpreadConstraints | nindent 8 }} + {{- end }} + {{- if .Values.console.tolerations }} + tolerations: + {{- toYaml .Values.console.tolerations | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/ftl/templates/console-role.yaml b/charts/ftl/templates/console-role.yaml new file mode 100644 index 0000000..5e6d3ad --- /dev/null +++ b/charts/ftl/templates/console-role.yaml @@ -0,0 +1,8 @@ +{{- if .Values.console.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.console.serviceAccountName }} + namespace: {{ .Release.Namespace }} + +{{- end }} diff --git a/charts/ftl/templates/console-services.yaml b/charts/ftl/templates/console-services.yaml new file mode 100644 index 0000000..7344507 --- /dev/null +++ b/charts/ftl/templates/console-services.yaml @@ -0,0 +1,24 @@ +{{- if .Values.console.enabled }} +apiVersion: v1 +kind: Service +metadata: + labels: + {{- include "ftl.labels" . | nindent 4 }} + name: {{ include "ftl.fullname" . }}-console + {{- if .Values.console.service.annotations }} + annotations: + {{- toYaml .Values.console.service.annotations | nindent 4 }} + {{- end }} +spec: + ports: + {{- range .Values.console.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- include "ftl-console.selectorLabels" . | nindent 4 }} + type: {{ .Values.console.service.type | default "ClusterIP" }} + +{{- end }} diff --git a/charts/ftl/templates/runner.yaml b/charts/ftl/templates/runner.yaml index d6370fa..8ee0a4b 100644 --- a/charts/ftl/templates/runner.yaml +++ b/charts/ftl/templates/runner.yaml @@ -66,6 +66,8 @@ data: value: "http://0.0.0.0:{{ (index .Values.runner.ports 0).containerPort }}" - name: FTL_LEASE_ENDPOINT value: http://ftl-lease:8892 + - name: FTL_TIMELINE_ENDPOINT + value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}" - name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE value: "{{ .Values.registry.allowInsecure }}" - name: FTL_ARTEFACT_REGISTRY_USERNAME diff --git a/charts/ftl/values.yaml b/charts/ftl/values.yaml index fbb86a5..9aff207 100644 --- a/charts/ftl/values.yaml +++ b/charts/ftl/values.yaml @@ -358,6 +358,65 @@ timeline: topologySpreadConstraints: null tolerations: null +console: + enabled: true + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: FTL_ENDPOINT + value: "http://ftl-controller:8892" + - name: FTL_BIND + value: "http://$(MY_POD_IP):8892" + - name: HOST_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + + ports: + - name: http + containerPort: 8892 + protocol: TCP + port: 8892 + + replicas: 1 + revisionHistoryLimit: 0 + + image: + repository: "ftl0/ftl-console" + pullPolicy: IfNotPresent + + resources: + requests: + memory: 512Mi + cpu: 10m + limits: + memory: 512Mi + cpu: 2 + + envFrom: null + serviceAccountName: ftl-console + + readinessProbe: null + + service: + type: ClusterIP + annotations: null + ports: + - name: "http-8892" + port: 8892 + protocol: TCP + targetPort: 8892 + + podAnnotations: + proxy.istio.io/config: | + holdApplicationUntilProxyStarts: true + nodeSelector: null + affinity: null + topologySpreadConstraints: null + tolerations: null + lease: env: - name: MY_POD_IP