Skip to content

Commit

Permalink
Merge pull request #399 from mesosphere/jr/opsportal-rbac-roles
Browse files Browse the repository at this point in the history
[opsportal] add opsportal and kibana RBAC roles
  • Loading branch information
jr0d authored Feb 4, 2020
2 parents fd59bed + 217fcd8 commit b2b4b1b
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
57 changes: 57 additions & 0 deletions stable/opsportal/templates/ingress-opsportal-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{{- if .Values.opsportalRBAC.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-admin
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
rules:
- nonResourceURLs:
- {{ .Values.opsportalRBAC.path | trimSuffix "/"}}
- {{ .Values.opsportalRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head
- post
- put
- delete

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-view
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
rules:
- nonResourceURLs:
- {{ .Values.opsportalRBAC.path | trimSuffix "/"}}
- {{ .Values.opsportalRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-edit
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
rules:
- nonResourceURLs:
- {{ .Values.opsportalRBAC.path | trimSuffix "/"}}
- {{ .Values.opsportalRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head
- post
- put
{{- end }}
60 changes: 60 additions & 0 deletions stable/opsportal/templates/kibana-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Kibana is deployed from an upstream chart so we must introduce a temporary
## cross application dependency
## This template should be removed in 1.4 https://jira.d2iq.com/browse/D2IQ-63746
{{- if .Values.kibanaRBAC.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-kibana-edit
lables:
app: {{ template "opsportal.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- nonResourceURLs:
- {{ .Values.kibanaRBAC.path | trimSuffix "/"}}
- {{ .Values.kibanaRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head
- post
- put

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-kibana-admin
lables:
app: {{ template "opsportal.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- nonResourceURLs:
- {{ .Values.kibanaRBAC.path | trimSuffix "/"}}
- {{ .Values.kibanaRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head
- post
- put
- delete

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "opsportal.fullname" . }}-kibana-view
lables:
app: {{ template "opsportal.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- nonResourceURLs:
- {{ .Values.kibanaRBAC.path | trimSuffix "/"}}
- {{ .Values.kibanaRBAC.path | trimSuffix "/" }}/*
verbs:
- get
- head
{{- end }}
8 changes: 8 additions & 0 deletions stable/opsportal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ kommander-ui:
traefik.ingress.kubernetes.io/auth-type: forward
traefik.ingress.kubernetes.io/auth-url: http://traefik-forward-auth-kubeaddons.kubeaddons.svc.cluster.local:4181/
traefik.ingress.kubernetes.io/auth-response-headers: X-Forwarded-User

opsportalRBAC:
enabled: true
path: /ops/portal

kibanaRBAC:
enabled: true
path: /ops/portal/kibana

0 comments on commit b2b4b1b

Please sign in to comment.