Skip to content

Commit

Permalink
add bns role to list and patch CR
Browse files Browse the repository at this point in the history
Why?
We want the notebook-service to be able to watch sparkapp CR and add
annotations `bigdata.spot.io/kill-requested-at` in them and let
spark-watcher kill the app.
This will happen at each kernel shutdown handled by bns
  • Loading branch information
Emmanuel Pignot committed Aug 29, 2024
1 parent bab1ea7 commit 821d408
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/bigdata-notebook-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: bigdata-notebook-service
description: A Helm chart for the Spot Big Data Notebook Service
type: application
version: 0.4.1
version: 0.4.2
appVersion: 0.83.0
home: https://github.com/spotinst/charts
icon: https://docs.spot.io/_media/images/spot_mark.png
Expand Down
13 changes: 13 additions & 0 deletions charts/bigdata-notebook-service/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ rules:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "bigdata-notebook-service.fullname" . }}-killer
rules:
- apiGroups:
- sparkoperator.k8s.io
resources:
- '*'
verbs:
- 'list'
- 'patch'
13 changes: 13 additions & 0 deletions charts/bigdata-notebook-service/templates/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ subjects:
- kind: ServiceAccount
name: {{ include "bigdata-notebook-service.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "bigdata-notebook-service.fullname" . }}-killer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "bigdata-notebook-service.fullname" . }}-killer
subjects:
- kind: ServiceAccount
name: {{ include "bigdata-notebook-service.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}

0 comments on commit 821d408

Please sign in to comment.