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

[HELM] failed to create: namespaces "csi-proxmox" not found #95

Closed
LeoShivas opened this issue Oct 17, 2023 · 4 comments
Closed

[HELM] failed to create: namespaces "csi-proxmox" not found #95

LeoShivas opened this issue Oct 17, 2023 · 4 comments

Comments

@LeoShivas
Copy link

Bug Report

Description

When deploying by Helm, I encounter an error related to the namespace creation.

Logs

[myuser@mynode ~]$ helm upgrade -i --namespace=csi-proxmox -f proxmox-csi.yaml proxmox-csi-plugin oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
Release "proxmox-csi-plugin" does not exist. Installing it now.
Pulled: ghcr.io/sergelogvinov/charts/proxmox-csi-plugin:0.1.9
Digest: sha256:80d14bf2be80eea479837b60462f98e36f1f3e433ebc949091020abe6492d1f8
Error: create: failed to create: namespaces "csi-proxmox" not found

Parameters used

# proxmox-csi.yaml
config:
  clusters:
    - url: https://myserver.com:8006/api2/json
      insecure: false
      token_id: "kubernetes-csi@pve!csi"
      token_secret: "xxxxxxxxxxxxxxxxxxxxxxxxx"
      region: main
node:
  nodeSelector:
  tolerations:
    - operator: Exists
nodeSelector:
  node-role.kubernetes.io/control-plane: ""
tolerations:
  - key: node-role.kubernetes.io/control-plane
    effect: NoSchedule
storageClass:
  - name: proxmox-data
    storage: local
    reclaimPolicy: Delete
    fstype: ext4
    cache: none

Environment

  • Plugin version: 0.1.9
  • Kubernetes version:
Client Version: v1.27.3
Kustomize Version: v5.0.1
Server Version: v1.27.6

Additional infos

  • Before installing, I ensure that the namespace csi-proxmox doesn't exist
  • When I create the name before the Helm install, the installation succeeds
    Here the file I used for creating the namespace :
# csi-ns.yml
apiVersion: v1
kind: Namespace
metadata:
  name: csi-proxmox
  labels:
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/audit: baseline
    pod-security.kubernetes.io/warn: baseline
    app.kubernetes.io/managed-by: Helm
  annotations:
    meta.helm.sh/release-name: proxmox-csi-plugin
    meta.helm.sh/release-namespace: csi-proxmox
  • When I add the --create-namespace=true, the namespace is created but I have another error :
[myuser@mynode ~]$ helm upgrade --create-namespace=csi-proxmox -i --namespace=csi-proxmox -f proxmox-csi.yaml proxmox-csi-plugin oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
Error: invalid argument "csi-proxmox" for "--create-namespace" flag: strconv.ParseBool: parsing "csi-proxmox": invalid syntax
[jlnadm@kube-cp-1 ~]$ helm upgrade --create-namespace=true -i --namespace=csi-proxmox -f proxmox-csi.yaml proxmox-csi-plugin oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
Release "proxmox-csi-plugin" does not exist. Installing it now.
Pulled: ghcr.io/sergelogvinov/charts/proxmox-csi-plugin:0.1.9
Digest: sha256:80d14bf2be80eea479837b60462f98e36f1f3e433ebc949091020abe6492d1f8
Error: 1 error occurred:
        * namespaces "csi-proxmox" already exists

@LeoShivas
Copy link
Author

FYI, I also use Ansible to deploy my Kubernetes assets. Here is my functionnal deployment :

  - name: Install Proxmox CCM chart
    kubernetes.core.helm:
      name: proxmox-cloud-controller-manager
      namespace: kube-system
      chart_ref: oci://ghcr.io/sergelogvinov/charts/proxmox-cloud-controller-manager
      values:
        config:
          clusters:
            - url: "{{ proxmox_url }}"
              insecure: false
              token_id: "kubernetes@pve!ccm"
              token_secret: "xxxxxxxxxxxxxxxxxxx"
              region: main

  - name: Create Proxmox CSI namespace
    kubernetes.core.k8s:
      state: present
      definition:
        api_version: v1
        kind: Namespace
        metadata:
          name: csi-proxmox
          labels:
            app.kubernetes.io/managed-by: Helm
          annotations:
            meta.helm.sh/release-name: proxmox-csi-plugin
            meta.helm.sh/release-namespace: csi-proxmox

  - name: Install Proxmox CSI chart
    kubernetes.core.helm:
      name: proxmox-csi-plugin
      namespace: csi-proxmox
#      create_namespace: true
      chart_ref: oci://ghcr.io/sergelogvinov/charts/proxmox-csi-plugin
      values:
        config:
          clusters:
            - url: "{{ proxmox_url }}"
              insecure: false
              token_id: "kubernetes-csi@pve!csi"
              token_secret: "yyyyyyyyyyyyyyyy"
              region: main
        node:
          nodeSelector:
          tolerations:
            - operator: Exists
        nodeSelector:
          node-role.kubernetes.io/control-plane: ""
        tolerations:
          - key: node-role.kubernetes.io/control-plane
            effect: NoSchedule
        storageClass:
          - name: proxmox-data
            storage: local
            reclaimPolicy: Delete
            fstype: ext4
            cache: none

@LeoShivas
Copy link
Author

I want to remove the "create namespace" part as you do it with your chart.

@sergelogvinov
Copy link
Owner

@LeoShivas Thank you for the good solution. Yep, creating a namespace with Helm can be a bit tricky. helm/helm#3503

I had the same paint with it. So we can add disable option like

createNamespace: false

@sergelogvinov
Copy link
Owner

helm install checked - done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants