diff --git a/Dockerfile.provisioner b/Dockerfile.provisioner index e6f03b7dd1..c15cf01bb4 100644 --- a/Dockerfile.provisioner +++ b/Dockerfile.provisioner @@ -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/ @@ -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"] diff --git a/charts/ftl/templates/provisioner-config-map.yaml b/charts/ftl/templates/provisioner-config-map.yaml new file mode 100644 index 0000000000..4dc70e10b9 --- /dev/null +++ b/charts/ftl/templates/provisioner-config-map.yaml @@ -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}} \ No newline at end of file diff --git a/charts/ftl/templates/provisioner.yaml b/charts/ftl/templates/provisioner.yaml index df0fa82df4..fc970390c5 100644 --- a/charts/ftl/templates/provisioner.yaml +++ b/charts/ftl/templates/provisioner.yaml @@ -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 }} diff --git a/charts/ftl/values.yaml b/charts/ftl/values.yaml index def4e544e1..08fb6bc778 100644 --- a/charts/ftl/values.yaml +++ b/charts/ftl/values.yaml @@ -91,7 +91,7 @@ provisioner: enabled: false replicas: 1 revisionHistoryLimit: 0 - + configMap: "ftl-provisioner-default-config" image: repository: "ftl0/ftl-provisioner" pullPolicy: IfNotPresent diff --git a/deployment/Dockerfile.provisioner.test b/deployment/Dockerfile.provisioner.test index 66da295f34..ca828e3054 100644 --- a/deployment/Dockerfile.provisioner.test +++ b/deployment/Dockerfile.provisioner.test @@ -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"] diff --git a/deployment/Justfile b/deployment/Justfile index 7642d9a498..fcfac310d9 100755 --- a/deployment/Justfile +++ b/deployment/Justfile @@ -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 diff --git a/deployment/ftl-provisioner-config.toml b/deployment/ftl-provisioner-config.toml deleted file mode 100644 index a16761df23..0000000000 --- a/deployment/ftl-provisioner-config.toml +++ /dev/null @@ -1,5 +0,0 @@ -default = "controller" -plugins = [ - { id = "cloudformation", resources = ["postgres"] }, - { id = "controller", resources = ["module"] }, -] \ No newline at end of file