-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding RBAC for Betydb Helm components #4
base: main
Are you sure you want to change the base?
Changes from all commits
671db44
163595d
7f70c58
8c8026e
b6e74b3
d4aefb9
078a013
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ maintainers: | |
email: [email protected] | ||
- name: Aju Tamang | ||
email: [email protected] | ||
- name: Sagar Utekar | ||
email: [email protected] | ||
|
||
# location of source code | ||
sources: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "betydb.fullname" . }}-hooks | ||
labels: | ||
{{- include "betydb.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: | ||
- list | ||
- watch | ||
- get | ||
- apiGroups: ["batch"] | ||
resources: ["jobs"] | ||
verbs: ["get", "list", "watch"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "betydb.fullname" . }}-hooks | ||
labels: | ||
{{- include "betydb.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ include "betydb.fullname" . }}-hooks | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "betydb.fullname" . }}-hooks |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "betydb.fullname" . }}-hooks | ||
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,21 @@ | ||||||
apiVersion: rbac.authorization.k8s.io/v1 | ||||||
kind: Role | ||||||
metadata: | ||||||
name: {{ include "betydb.fullname" . }} | ||||||
labels: | ||||||
{{- include "betydb.labels" . | nindent 4 }} | ||||||
rules: | ||||||
- apiGroups: [""] | ||||||
resources: ["pods", "endpoints", "Services", "configmaps"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed extra permissions from bety hook role |
||||||
verbs: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need any permissions? I don't think right now BETY needs permissions to any of these endpoints services. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Endpoint access added for BETY role as we're accessing them in ingress config and readiness probe. |
||||||
- list | ||||||
- watch | ||||||
- get | ||||||
- apiGroups: | ||||||
- networking.k8s.io | ||||||
resources: | ||||||
- ingresses | ||||||
verbs: | ||||||
- list | ||||||
- watch | ||||||
- get |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "betydb.fullname" . }} | ||
labels: | ||
{{- include "betydb.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ include "betydb.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "betydb.fullname" . }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "betydb.fullname" . }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this service account be used in the deployment file (and maybe others). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need a separate account for the hooks? Not sure we need all the permissions listed below for the hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using separate service account as permissions required for bety and bety hooks are different.
Will remove endpoint, service access from bety hook role.