Skip to content

Commit

Permalink
[BGD-5797] add bns role to list and patch CR (#224)
Browse files Browse the repository at this point in the history
* add bns role to list and patch CR

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

* doc: bigdata-notebook-service killer clusterrole

---------

Co-authored-by: Emmanuel Pignot <emmanuel.pignot@netapp.com>
  • Loading branch information
epignot and Emmanuel Pignot authored Sep 13, 2024
1 parent 8a63ede commit 92f45be
Show file tree
Hide file tree
Showing 4 changed files with 38 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
11 changes: 11 additions & 0 deletions charts/bigdata-notebook-service/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# bigdata-notebook-service

## Cluster role

### bigdata-notebook-service-bdenv-vXX-killer

This role is used by bigdata-notebook-service to add the following SparkApp CR annotations:
```
bigdata.spot-io/kill-reason
bigdata.spot-io/kill-requested-at
```
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 92f45be

Please sign in to comment.