k8s-sqs-autoscaler
k8s-sqs-autoscaler copied to clipboard
RBAC errors
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
...
thanks for this man