fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
990 stars 1.05k forks source link

apps/production/kustomization.yaml: namespace left out by intention? #102

Open johanneskastl opened 1 year ago

johanneskastl commented 1 year ago

There is no namespace in the production file, while it exists in the staging one?

https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/apps/production/kustomization.yaml#L3

vs.

https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/apps/staging/kustomization.yaml#L3

kingdonb commented 1 year ago

I think we've had this conversation elsewhere, reminds me of a thread in Slack.

I don't think this is an error, the production resources already have the production namespace in them, in this case it's podinfo since the app being deployed to production is podinfo, and production might have many apps in it.

https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/apps/base/podinfo/kustomization.yaml

The namespace directive is used in the ../base/podinfo kustomization overlay, and it's overrided in the staging so that staging can live on the same cluster as production. (If there were multiple apps, then staging would need to find a different method.)