Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skaffold not creating namespace for helm release #8515

Open
michaelmohamed opened this issue Mar 9, 2023 · 8 comments
Open

skaffold not creating namespace for helm release #8515

michaelmohamed opened this issue Mar 9, 2023 · 8 comments
Assignees
Labels
area/namespaces deploy/helm kind/bug Something isn't working kind/friction Issues causing user pain that do not have a workaround needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug priority/p2 May take a couple of releases
Milestone

Comments

@michaelmohamed
Copy link
Contributor

michaelmohamed commented Mar 9, 2023

Expected behavior

Redis deploy successfully

Actual behavior

Error from server (NotFound): error when creating "STDIN": namespaces "redis" not found

Works if I create the namespace manually.

Information

  • Skaffold version: 2.2.0
  • Operating system: Mac Monterey 12.4
  • Installed via: Homebrew
  • Contents of skaffold.yaml:

Steps to reproduce the behavior

skaffold dev

apiVersion: skaffold/v4beta2
kind: Config
metadata:
  name: redis
manifests:
  helm:
    releases:
    - name: redis
      createNamespace: true
      repo: https://charts.bitnami.com/bitnami 
      remoteChart: redis
      namespace: redis

profiles:
  - name: dev
    activation:
      - command: dev
@aaron-prindle
Copy link
Contributor

aaron-prindle commented Mar 9, 2023

Thanks for flagging this @mm-fsai. This is an issue with Skaffold, the manifests.helm.releases[].createNamespace field should not actually exist (created #8533 tracking removing it) and instead deploy.helm.releases[].createNamespace should be used. In your case I believe something like:

apiVersion: skaffold/v4beta2
kind: Config
metadata:
  name: redis
deploy: # <------changed from manifests
  helm:
    releases:
    - name: redis
      createNamespace: true
      repo: https://charts.bitnami.com/bitnami 
      remoteChart: redis
      namespace: redis

profiles:
  - name: dev
    activation:
      - command: dev

should work here

@michaelmohamed
Copy link
Contributor Author

Thanks! What's the difference with and without deploy?

@aaron-prindle aaron-prindle added kind/question User question priority/p2 May take a couple of releases kind/bug Something isn't working kind/friction Issues causing user pain that do not have a workaround deploy/helm area/namespaces and removed kind/question User question labels Mar 13, 2023
@krumware
Copy link

krumware commented Apr 3, 2023

For others landing here. I was also facing this issue, alongside one where the helm chart's kubeVersion check was reflecting a different helm version than what was actually running on the cluster.
Moving the remote chart releases to deploy instead of manifests resolved that.

apiVersion: skaffold/v4beta2
kind: Config
metadata:
  name: cert-manager
deploy: # <------changed from manifests
  helm:
    releases:
    - name: cert-manager
      repo: https://charts.jetstack.io
      remoteChart: cert-manager
      namespace: cert-manager
      createNamespace: true
      setValues:
        installCRDs: true

@ericzzzzzzz
Copy link
Contributor

The difference is in the doc,
In Skaffold v2 the primary difference between the helm renderer (manifest.helm.*) and the helm deployer (deploy.helm.*) is the use of helm template vs helm install

more info can be found here. https://skaffold.dev/docs/deployers/helm/

@AndreasBergmeier6176
Copy link
Contributor

AndreasBergmeier6176 commented Jun 27, 2023

I am using deploy.helm.releases.*.createNamespace but am getting the same error.

@Richard87
Copy link

Hi, I'm also getting this error, just upgraded from 1.39.4 to 2.6.0 and got this error:

Helm release eportal not installed. Installing...
Error: INSTALLATION FAILED: create: failed to create: namespaces "staging-224" not found

@renzodavid9 renzodavid9 modified the milestones: v2.7.0, fix-it Jun 29, 2023
@plumpy plumpy reopened this Jul 12, 2023
@jagathprakash
Copy link

assign @jagathprakash

@ericzzzzzzz ericzzzzzzz added the needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug label Jul 20, 2023
@pydolan
Copy link

pydolan commented Oct 7, 2023

The above suggested fix works for me for OP's original config, but I switched to the latest API version (skaffold/v4beta7) and am using v2.8.0 of the CLI app (on minikube):

apiVersion: skaffold/v4beta7
kind: Config
metadata:
  name: redis
deploy:
  helm:
    releases:
      - name: redis
        createNamespace: true
        repo: https://charts.bitnami.com/bitnami
        remoteChart: redis
        namespace: redis

profiles:
  - name: dev
    activation:
      - command: dev

For those still having the error, ensure you're including createNamespace – or share your full yaml config for the skaffold devs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/namespaces deploy/helm kind/bug Something isn't working kind/friction Issues causing user pain that do not have a workaround needs-reproduction needs reproduction from the maintainers to validate the issue is truly a skaffold bug priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

10 participants