Skip to content

Commit

Permalink
Merge pull request #125 from Calcagiara/krmRoles
Browse files Browse the repository at this point in the history
Krm roles
  • Loading branch information
ffais authored Oct 10, 2024
2 parents 1b24f52 + da70446 commit cf40254
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: core
description: Core backend application for DigitalHub.
type: application
version: 0.2.14
version: 0.2.15
appVersion: "0.8.0-beta4"
maintainers:
- name: ffais
Expand Down
1 change: 1 addition & 0 deletions charts/core/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ data:
DH_AUTH_JWT_CLAIM: {{ .Values.authentication.openId.jwtClaim }}
DH_AUTH_OIDC_ISSUER_URI: {{ .Values.authentication.openId.issuerUri }}
DH_AUTH_OIDC_SCOPE: {{ .Values.authentication.openId.scope }}
DH_AUTH_JWT_USERNAME: {{ .Values.authentication.openId.jwtUsername }}
{{- end }}
{{- if .Values.global.registry.url }}
DOCKER_REGISTRY: {{ .Values.global.registry.url }}
Expand Down
1 change: 1 addition & 0 deletions charts/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ authentication:
externalSecret:
name: ""
key: ""
jwtUsername: ""

events:
enabled: "false"
Expand Down
2 changes: 1 addition & 1 deletion charts/kubernetes-resource-manager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: kubernetes-resource-manager
description: A Helm chart for Kubernetes
type: application
version: 0.2.3
version: 0.2.4
appVersion: "1.2.2"
maintainers:
- name: ffais
Expand Down
10 changes: 10 additions & 0 deletions charts/kubernetes-resource-manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,13 @@ Namespace function
{{- .Values.namespaceValues.defaultValue }}
{{- end }}
{{- end }}

{{/*
Function for setting roles for KRM
*/}}
{{- define "kubernetes-resource-manager.roles" }}
{{- range $i, $roles := .Values.oidc.access.roles }}
ACCESS_ROLES_{{ $i }}_ROLE: {{ $roles.role }}
ACCESS_ROLES_{{ $i }}_RESOURCES: {{ $roles.resources }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/kubernetes-resource-manager/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ data:
{{- if .Values.env.additionalEnv }}
{{- toYaml .Values.env.additionalEnv | nindent 2}}
{{- end }}
{{- if and .Values.oidc.enabled .Values.oidc.access.roles }}
{{- include "kubernetes-resource-manager.roles" . }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/kubernetes-resource-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ oidc:
scope: ""
authType: ""
redirectUrl: ""
access:
roles: []

resourceSelectors:
# list separated by |
Expand Down

0 comments on commit cf40254

Please sign in to comment.