sideshowbandana / k8s-sqs-autoscaler

Kubernetes pod autoscaler based on queue size in AWS SQS
71 stars 27 forks source link

RBAC errors #12

Open davidk81 opened 5 years ago

davidk81 commented 5 years ago

Not sure if this is the best way to set RBAC, but I got the API permission errors fixed by applying the following:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: sqs-scaler
  namespace: ${K8S_NAMESPACE}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: sqs-scaler
  namespace: ${K8S_NAMESPACE}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: sqs-scaler
subjects:
- kind: ServiceAccount
  name: sqs-scaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: sqs-scaler
  namespace: ${K8S_NAMESPACE}
rules:
- apiGroups:
  - extensions
  - apps
  resources:
  - deployments
  - replicasets
  verbs:
  - get
  - list
  - watch
  - patch

(In k8s-sqs-autoscaler deployment)

...
    spec:
      serviceAccountName: sqs-scaler
...
rafilkmp3 commented 3 years ago

thanks for this man