GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.08k stars 1.63k forks source link

Skaffold `apply` fails for `helm` renderer with multiple namespace resources #8475

Open gsquared94 opened 1 year ago

gsquared94 commented 1 year ago

Repro: Agones Helm chart deploys to multiple namespaces agones-system and kube-system.

helm repo add agones https://agones.dev/chart/stable
helm repo update
helm install my-release --namespace agones-system --create-namespace agones/agones

If we setup this in Skaffold, the skaffold.yaml looks like:

apiVersion: skaffold/v2beta29
kind: Config
deploy:
  helm:
    releases:
    - name: agones
      repo: https://agones.dev/chart/stable/
      remoteChart: agones
      namespace: agones-system

Running skaffold render --output render.yaml creates a rendered manifest file, but trying to deploy using skaffold apply command fails with the error:

the namespace from the provided object does not match the namespace agones-system

This failure happens on every repeat deployment excluding the first time deployment. This command invoked by Skaffold here fails if there are multiple namespaces in the rendered manifests and the resources already exist:

kubectl --context kind-kind --namespace agones-system create --dry-run=client -oyaml -f render.yaml
mazzy89 commented 1 year ago

I'm having this exact issue but in my case I use kustomize rather than helm.

mazzy89 commented 1 year ago

https://github.com/GoogleContainerTools/skaffold/pull/8623 - it should be fixed but seems not...