Skip to content

Commit

Permalink
feat: configure provisioner through ConfigMap (#3135)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Oct 16, 2024
1 parent 0a53566 commit 0175b61
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.provisioner
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

WORKDIR /plugins/
COPY ftl-provisioner-config.toml .
COPY ftl-provisioner-config.toml /config/config.toml
COPY --from=builder /src/build/release/ftl-provisioner-cloudformation .

WORKDIR /service/
Expand All @@ -45,6 +45,6 @@ EXPOSE 8893

ENV PATH="$PATH:/plugins/"
ENV FTL_PROVISIONER_BIND="http://0.0.0.0:8893"
ENV FTL_PROVISIONER_PLUGIN_CONFIG_FILE="/plugins/config.toml"
ENV FTL_PROVISIONER_PLUGIN_CONFIG_FILE="/config/config.toml"

CMD ["/service/ftl-provisioner"]
16 changes: 16 additions & 0 deletions charts/ftl/templates/provisioner-config-map.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.provisioner.enabled }}
{{- if eq .Values.provisioner.configMap "ftl-provisioner-default-config" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: ftl-provisioner-default-config
namespace: default
data:
config.toml: |
default = "controller"
plugins = [
{ id = "cloudformation", resources = ["postgres"] },
{ id = "controller", resources = ["module"] },
]
{{- end}}
{{- end}}
7 changes: 7 additions & 0 deletions charts/ftl/templates/provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ spec:
successThreshold: 1
failureThreshold: 15
{{- end }}
volumeMounts:
- mountPath: /config
name: config
volumes:
- name: config
configMap:
name: {{ .Values.provisioner.configMap }}
{{- if .Values.provisioner.nodeSelector }}
nodeSelector:
{{- toYaml .Values.provisioner.nodeSelector | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ftl/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ provisioner:
enabled: false
replicas: 1
revisionHistoryLimit: 0

configMap: "ftl-provisioner-default-config"
image:
repository: "ftl0/ftl-provisioner"
pullPolicy: IfNotPresent
Expand Down
3 changes: 1 addition & 2 deletions deployment/Dockerfile.provisioner.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ COPY docker-build/ftl-provisioner-cloudformation /plugins/
COPY docker-build/ftl .
EXPOSE 8893
# Temp hack, this should be a configmap
COPY ftl-provisioner-config.toml /plugins/config.toml
ENV FTL_PROVISIONER_PLUGIN_CONFIG_FILE="/plugins/config.toml"
ENV FTL_PROVISIONER_PLUGIN_CONFIG_FILE="/config/config.toml"
ENV PATH="$PATH:/plugins/"

CMD ["/root/ftl-provisioner"]
2 changes: 1 addition & 1 deletion deployment/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ setup-cluster: setup-registry
fi
kubectl config set-context --current --namespace=default

install-istio:
install-istio: setup-cluster
#!/bin/bash
if [ -z "$(kubectl get namespace | grep istio-system)" ]; then
kubectl create namespace istio-system
Expand Down
5 changes: 0 additions & 5 deletions deployment/ftl-provisioner-config.toml

This file was deleted.

0 comments on commit 0175b61

Please sign in to comment.