Skip to content

Commit

Permalink
Update charts
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Nov 25, 2024
1 parent 1853a2b commit 5f59354
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 39 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.399.0
appVersion: 0.399.0
version: 0.400.0
appVersion: 0.400.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 @@ -51,4 +51,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: cron
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ftl-http-ingress.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ftl.fullname" . }}
app.kubernetes.io/component: http-ingress
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
22 changes: 0 additions & 22 deletions charts/ftl/templates/controller-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,3 @@ spec:
selector:
{{- include "ftl-controller.selectorLabels" . | nindent 4 }}
type: {{ .Values.controller.service.type | default "ClusterIP" }}
---
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "ftl.labels" . | nindent 4 }}
name: {{ include "ftl.fullname" . }}-controller-ingress
{{- if .Values.controller.ingressService.annotations }}
annotations:
{{- toYaml .Values.controller.ingressService.annotations | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.controller.ingressService.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol | default "TCP" }}
targetPort: {{ .targetPort }}
{{- end }}
selector:
{{- include "ftl-controller.selectorLabels" . | nindent 4 }}
type: {{ .Values.controller.ingressService.type | default "ClusterIP" }}
File renamed without changes.
83 changes: 83 additions & 0 deletions charts/ftl/templates/http-ingress-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{{- if .Values.ingress.enabled }}
{{ $version := printf "v%s" .Chart.Version -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ftl.fullname" . }}-http-ingress
labels:
{{- include "ftl.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.ingress.replicas }}
revisionHistoryLimit: {{ .Values.ingress.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "ftl-http-ingress.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ftl-http-ingress.selectorLabels" . | nindent 8 }}
{{- if .Values.ingress.podAnnotations }}
annotations:
{{- toYaml .Values.ingress.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.ingress.serviceAccountName }}
containers:
- name: app
image: "{{ .Values.ingress.image.repository }}:{{ .Values.ingress.image.tag | default $version }}"
imagePullPolicy: {{ .Values.ingress.image.pullPolicy }}
resources:
limits:
cpu: "{{ .Values.ingress.resources.limits.cpu }}"
memory: "{{ .Values.ingress.resources.limits.memory }}"
requests:
cpu: "{{ .Values.ingress.resources.requests.cpu }}"
memory: "{{ .Values.ingress.resources.requests.memory }}"
{{- if .Values.ingress.envFrom }}
envFrom:
{{- if .Values.ingress.envFrom }}
{{- toYaml .Values.ingress.envFrom | nindent 12 }}
{{- end }}
{{- end }}
env:
{{- if .Values.ingress.env }}
{{- toYaml .Values.ingress.env | nindent 12 }}
{{- end }}

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

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

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

{{- end }}
6 changes: 3 additions & 3 deletions charts/ftl/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "ftl.fullname" . }}-controller
name: {{ include "ftl.fullname" . }}-ingress
annotations:
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- toYaml .Values.ingress.ingressAnnotations | nindent 4 }}
spec:
rules:
- http:
Expand All @@ -21,7 +21,7 @@ spec:
pathType: Prefix
backend:
service:
name: ftl-controller-ingress
name: ftl-http-ingress
port:
number: 8891
- path: /xyz.block.ftl.v1beta1.provisioner.ProvisionerService/
Expand Down
80 changes: 68 additions & 12 deletions charts/ftl/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
fullnameOverride: ""
nameOverride: ""

ingress:
enabled: false
annotations:
kubernetes.io/ingress.class: nginx

secrets:
logEncryptionKey: null
Expand Down Expand Up @@ -46,12 +42,8 @@ controller:
fieldPath: status.podIP
- name: FTL_CONTROLLER_BIND
value: "http://$(MY_POD_IP):8892"
- name: FTL_CONTROLLER_INGRESS_BIND
value: "http://$(MY_POD_IP):8891"
- name: FTL_CONTROLLER_ADVERTISE
value: "http://$(MY_POD_IP):8892"
- name: FTL_CONTROLLER_ALLOW_ORIGIN
value: "*"
- name: LOG_LEVEL
value: "debug"
- name: LOG_JSON
Expand All @@ -66,9 +58,6 @@ controller:
# value: "env=ftlDefault"

ports:
- name: ingress
containerPort: 8891
protocol: TCP
- name: http
containerPort: 8892
protocol: TCP
Expand Down Expand Up @@ -250,4 +239,71 @@ istio:
registry:
repository: ""
allowInsecure: false
create: false
create: false


ingress:
enabled: false
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FTL_ENDPOINT
value: "http://ftl-controller:8892"
- name: FTL_INGRESS_BIND
value: "http://$(MY_POD_IP):8891"
- name: FTL_INGRESS_ALLOW_ORIGIN
value: "*"
- name: LOG_LEVEL
value: "debug"
- name: LOG_JSON
value: "true"
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
ports:
- name: ingress
containerPort: 8891
protocol: TCP
port: 8891

ingressAnnotations:
kubernetes.io/ingress.class: nginx
replicas: 2
revisionHistoryLimit: 0

image:
repository: "ftl0/ftl-http-ingress"
pullPolicy: IfNotPresent

resources:
requests:
memory: 512Mi
cpu: 10m
limits:
memory: 512Mi
cpu: 2

envFrom: null
serviceAccountName: ftl-http-ingress

readinessProbe: null

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

podAnnotations:
proxy.istio.io/config: |
holdApplicationUntilProxyStarts: true
nodeSelector: null
affinity: null
topologySpreadConstraints: null
tolerations: null

0 comments on commit 5f59354

Please sign in to comment.