hazelcast / hazelcast-operator

Apache License 2.0
10 stars 14 forks source link

add required operator rbac permissions for ingress #15

Closed hasancelik closed 4 years ago

hasancelik commented 4 years ago

Fixes https://github.com/hazelcast/charts/issues/147

If ingress parameter is enabled for Management center at CR spec, operator fails due to insufficient operator rbac permissions:

  mancenter:
    ingress:
      enabled: true
      ....
{"level":"error","ts":1596633227.146617,"logger":"helm.controller","msg":"Release failed","namespace":"hazelcast","name":"hz","apiVersion":"hazelcast.com/v1alpha1","kind":"HazelcastEnterprise","release":"hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/operator-framework/operator-sdk/pkg/helm/controller.HelmOperatorReconciler.Reconcile\n\tsrc/github.com/operator-framework/operator-sdk/pkg/helm/controller/reconcile.go:181\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633227.1520312,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"hazelcastenterprise-controller","request":"hazelcast/hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633235.1784658,"logger":"helm.controller","msg":"Release failed","namespace":"hazelcast","name":"hz","apiVersion":"hazelcast.com/v1alpha1","kind":"HazelcastEnterprise","release":"hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/operator-framework/operator-sdk/pkg/helm/controller.HelmOperatorReconciler.Reconcile\n\tsrc/github.com/operator-framework/operator-sdk/pkg/helm/controller/reconcile.go:181\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633235.18468,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"hazelcastenterprise-controller","request":"hazelcast/hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633248.324764,"logger":"helm.controller","msg":"Release failed","namespace":"hazelcast","name":"hz","apiVersion":"hazelcast.com/v1alpha1","kind":"HazelcastEnterprise","release":"hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/operator-framework/operator-sdk/pkg/helm/controller.HelmOperatorReconciler.Reconcile\n\tsrc/github.com/operator-framework/operator-sdk/pkg/helm/controller/reconcile.go:181\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633248.3300853,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"hazelcastenterprise-controller","request":"hazelcast/hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633271.7209837,"logger":"helm.controller","msg":"Release failed","namespace":"hazelcast","name":"hz","apiVersion":"hazelcast.com/v1alpha1","kind":"HazelcastEnterprise","release":"hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/operator-framework/operator-sdk/pkg/helm/controller.HelmOperatorReconciler.Reconcile\n\tsrc/github.com/operator-framework/operator-sdk/pkg/helm/controller/reconcile.go:181\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1596633271.7272263,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"hazelcastenterprise-controller","request":"hazelcast/hz","error":"failed to install release: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: ingresses.extensions \"hz-hazelcast-enterprise-mancenter\" is forbidden: User \"system:serviceaccount:openshift-operators:hazelcast-enterprise-operator\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"hazelcast\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tpkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tpkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tpkg/mod/k8s.io/apimachinery@v0.17.4/pkg/util/wait/wait.go:88"}