skaffold
                                
                                 skaffold copied to clipboard
                                
                                    skaffold copied to clipboard
                            
                            
                            
                        skaffold not creating namespace for helm release
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
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
Thanks! What's the difference with and without deploy?
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
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/
I am using deploy.helm.releases.*.createNamespace but am getting the same error.
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
assign @jagathprakash
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