# RBAC configuration for scraper pod to control worker scaling # Allows the scraper to read and scale the scraper-worker statefulset apiVersion: v1 kind: ServiceAccount metadata: name: scraper-sa namespace: dispensary-scraper --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: worker-scaler namespace: dispensary-scraper rules: # Allow reading deployment and statefulset status - apiGroups: ["apps"] resources: ["deployments", "statefulsets"] verbs: ["get", "list"] # Allow scaling deployments and statefulsets - apiGroups: ["apps"] resources: ["deployments/scale", "statefulsets/scale"] verbs: ["get", "patch", "update"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: scraper-worker-scaler namespace: dispensary-scraper subjects: - kind: ServiceAccount name: scraper-sa namespace: dispensary-scraper roleRef: kind: Role name: worker-scaler apiGroup: rbac.authorization.k8s.io