Skip to content

Instantly share code, notes, and snippets.

@cnolanminich
Created June 28, 2024 00:50
Show Gist options
  • Save cnolanminich/cf6df3475330c8a107bba8f305e3287c to your computer and use it in GitHub Desktop.
Save cnolanminich/cf6df3475330c8a107bba8f305e3287c to your computer and use it in GitHub Desktop.
Permissions needed for cross-namespace
# give the created service account cross namespace permissions (cluster role)
extraManifests:
- kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: extra-cluster-role
rules:
- apiGroups: ["batch"]
resources: ["jobs", "jobs/status"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["deployments", "deployments/status", "deployments/revision"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/status", "services"]
verbs: ["*"]
- kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: extra-cluster-rolebinding
subjects:
- kind: ServiceAccount
name: user-cloud-dagster-cloud-agent
namespace: agent
- kind: ServiceAccount
name: user-cloud-dagster-cloud-agent
namespace: target-namespace
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: extra-cluster-role
# the pod created in the target-namespace will try to bind this, so create it
- kind: ServiceAccount
apiVersion: v1
metadata:
name: user-cloud-dagster-cloud-agent
namespace: target-namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment