GoogleContainerTools / GoogleContainerTools/skaffold

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

Open
#8,475 2 comments 4 reactions 0 assignees View on GitHub
kind/friction priority/p1
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Repro:
[Agones Helm chart](https://agones.dev/site/docs/installation/install-agones/helm/) 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](https://github.com/GoogleContainerTools/skaffold/blob/6e4c7a92693be2dacc31bc27cff121ef9467a651/pkg/skaffold/deploy/kubectl/cli.go#L196) 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.