Add Templates to pretty config
This commit is contained in:
parent
815ae64e32
commit
629bb23a79
@ -1,4 +1,9 @@
|
||||
FROM fluxcd/flux-cli as flux-source
|
||||
WORKDIR /out
|
||||
RUN cp $(which flux) .
|
||||
|
||||
FROM ghcr.io/flant/shell-operator:latest
|
||||
RUN apk update && apk add envsubst --no-cache
|
||||
COPY --from=flux-source /out/flux /usr/bin/flux
|
||||
ADD /hooks /hooks
|
||||
ADD /tpls /tpls
|
||||
|
@ -26,6 +26,21 @@ else
|
||||
export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
|
||||
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
||||
export SP_APPLICATION=$(jq -r .[0].object.data.values $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release')
|
||||
envsubst < /tpls/flux-create.yaml | kubectl create -f -
|
||||
|
||||
flux create source helm $SP_APPLICATION \
|
||||
--namespace=$SP_ACCOUNT \
|
||||
--url=oci://registry.badhouseplants.net/softplayer/helm
|
||||
|
||||
flux create helmrelease $SP_APPLICATION \
|
||||
--source=HelmRepository/$SP_APPLICATION \
|
||||
--namespace=$SP_CUSTOMER_ID \
|
||||
--chart=helmrelease \
|
||||
--values-from Secret/$SP_APPLICATION \
|
||||
--kubeconfig-secret-ref=$SP_CUSTOMER_ID-config \
|
||||
--target-namespace=default --export \
|
||||
| yq '.spec.storageNamespace="helm-installations"' \
|
||||
| kubectl create -f -
|
||||
flux reconcile helmrelease --namespace=$SP_ACCOUNT $SP_APPLICATION
|
||||
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user