Skip to content

Commit

Permalink
Add service account for operator-companion (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Frédéric Collonval <[email protected]>
  • Loading branch information
fcollonval and fcollonval authored Sep 10, 2024
1 parent 2c055da commit 050cd9e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions charts/datalayer-operator/templates/companion-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: datalayer-jupyter
name: datalayer-operator-companion
labels:
k8s-app: datalayer-operator-companion
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get"]
13 changes: 13 additions & 0 deletions charts/datalayer-operator/templates/companion-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-pods
namespace: datalayer-jupyter
subjects:
- kind: ServiceAccount
name: datalayer-operator-companion
namespace: datalayer-jupyter
roleRef:
kind: Role
name: datalayer-operator-companion
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: datalayer-operator-companion
namespace: datalayer-jupyter
# Opt out of auto API credentials to prevent all containers
# to use the service account
automountServiceAccountToken: false

0 comments on commit 050cd9e

Please sign in to comment.