purestorage/helm-charts

Failed to initialize service object for metrics: replicasets.apps

Closed this issue · 4 comments

yuha0 commented

With the Role defined in install.sh, the operator logs the following error when starts:

{"level":"info","ts":1581545947.1596415,"logger":"cmd","msg":"failed to initialize service object for metrics: replicasets.apps \"pso-operator-697946fc65\" is forbidden: User \"system:serviceaccount:pure-yuhao:default\" cannot get resource \"replicasets\" in API group \"apps\" in the namespace \"pure-yuhao\"","Namespace":"pure-yuhao"}

I have to give it additional permission to get replicasets:

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: pso-operator
rules:
...
  - apiGroups:
    - apps
    resources:
    - deployments
    - daemonsets
    - statefulsets
    - replicasets <---------- added this
    verbs:
    - "*"
...

Hi @yuha0. Which version of kubernetes are you using?

@yuha0 thanks for catching this! Would you like to open a PR to add this line to both install.sh files?

yuha0 commented

@trevormeiss Sure thing!