# RBAC for swarm variant namespaces # Grants the CI runner ServiceAccount permission to deploy to swarm-* namespaces. # Mirrors the pattern used for neuron-dev/stage deployments. # The CI runner runs in the `ci` namespace as the `default` ServiceAccount. --- # swarm-alpha apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: swarm-deployer namespace: swarm-alpha rules: - apiGroups: ["apps"] resources: ["deployments"] verbs: ["get", "list", "watch", "create", "update", "patch"] - apiGroups: [""] resources: ["configmaps", "services", "pods", "pods/log"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: ["batch"] resources: ["jobs"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: ci-runner-swarm-alpha namespace: swarm-alpha subjects: - kind: ServiceAccount name: default namespace: ci roleRef: kind: Role name: swarm-deployer apiGroup: rbac.authorization.k8s.io --- # swarm-beta apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: swarm-deployer namespace: swarm-beta rules: - apiGroups: ["apps"] resources: ["deployments"] verbs: ["get", "list", "watch", "create", "update", "patch"] - apiGroups: [""] resources: ["configmaps", "services", "pods", "pods/log"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: ["batch"] resources: ["jobs"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: ci-runner-swarm-beta namespace: swarm-beta subjects: - kind: ServiceAccount name: default namespace: ci roleRef: kind: Role name: swarm-deployer apiGroup: rbac.authorization.k8s.io --- # swarm-gamma apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: swarm-deployer namespace: swarm-gamma rules: - apiGroups: ["apps"] resources: ["deployments"] verbs: ["get", "list", "watch", "create", "update", "patch"] - apiGroups: [""] resources: ["configmaps", "services", "pods", "pods/log"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: ["batch"] resources: ["jobs"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: ci-runner-swarm-gamma namespace: swarm-gamma subjects: - kind: ServiceAccount name: default namespace: ci roleRef: kind: Role name: swarm-deployer apiGroup: rbac.authorization.k8s.io