prefapp / firestarter-workflows

Repository with all firestarter workflows
0 stars 0 forks source link

[state-repo] Dejar los artefactos renderizados en la rama deployment #125

Open jalvarezit opened 1 week ago

jalvarezit commented 1 week ago

También habría que crear una rama deployment con una dettached HEAD donde se suben los resultados del helmfile template en su propia carpeta siguiendo el siguiente formato:

apps
└── tenant
    └── app-name
        └── environment
            ├── deployment.yaml
            └── configmap.yaml
sys-services
└── sys-service-name
    └── cluster-name

Tiene que tener la flag de sops_enabled a false para evitar hacer leak de los secretos

Originally posted by @jalvarezit in https://github.com/prefapp/features/issues/284#issuecomment-2332300334

alambike commented 5 days ago

Some interesting details: Helmfile has an output-dir parameter that will allow us to render all the releases artifacts in a folder, for example:

helmfile -e dev template --output-dir dev/artifacts

But, when we apply a kustomization, following this docs, with strategicMergePatches or jsonPatches, the results of the previous helmfile template command is only one compacted file named patched_resources.yaml.

We could apply this yq command to split this file into a file by Kubernetes manifest:

yq -s '.metadata.name' patched_resources.yaml && rm -f patched_resources.yaml