apache / apisix-helm-chart

Apache APISIX Helm Chart
https://apisix.apache.org/
Apache License 2.0
230 stars 208 forks source link

the ClusterRole and ClusterRoleBinding are conflict when install multi ingress controller by helm #429

Open huweihuang opened 1 year ago

huweihuang commented 1 year ago

problem:

I cannot install multiple ingress controllers in the same K8S cluster through the helm. Because the ClusterRole and ClusterRoleBinding are conflicting.

 helm install apisix-ingress-controller ./apisix-ingress-controller/ -n apisix
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "apisix-ingress-controller-clusterrole" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "apisix": current value is "test"

kubectl get ClusterRoleBinding apisix-ingress-controller-clusterrolebinding -oyaml

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  annotations:
    meta.helm.sh/release-name: apisix-ingress-controller
    meta.helm.sh/release-namespace: test
  creationTimestamp: "2022-12-28T08:55:58Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: apisix-ingress-controller-clusterrolebinding
  resourceVersion: "63052421"
  uid: 1cbf1aa5-22f5-4240-bd37-7661c27e73c9
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: apisix-ingress-controller-clusterrole
subjects:
- kind: ServiceAccount
  name: apisix-ingress-controller
  namespace: test
danielmlc commented 1 month ago

How to solve this problem I also encountered