Skip to content

Commit e050215

Browse files
skrobulsyedhaseebahmed
authored andcommitted
feat: add oidc-rbac component for service account issuer discovery
Allow unauthenticated access to OIDC discovery endpoints by deploying the oidc-reviewer ClusterRoleBinding to all site and global clusters.
1 parent 0162f02 commit e050215

5 files changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if or (eq (include "understack.isEnabled" (list $.Values.global "oidc_rbac")) "true") (eq (include "understack.isEnabled" (list $.Values.site "oidc_rbac")) "true") }}
2+
---
3+
apiVersion: argoproj.io/v1alpha1
4+
kind: Application
5+
metadata:
6+
name: {{ printf "%s-%s" $.Release.Name "oidc-rbac" }}
7+
finalizers:
8+
- resources-finalizer.argocd.argoproj.io
9+
annotations:
10+
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
11+
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
12+
spec:
13+
destination:
14+
namespace: kube-system
15+
server: {{ $.Values.cluster_server }}
16+
project: understack-infra
17+
sources:
18+
- path: components/oidc-rbac
19+
ref: understack
20+
repoURL: {{ include "understack.understack_url" $ }}
21+
targetRevision: {{ include "understack.understack_ref" $ }}
22+
syncPolicy:
23+
automated:
24+
prune: true
25+
selfHeal: true
26+
syncOptions:
27+
- ServerSideApply=true
28+
- RespectIgnoreDifferences=true
29+
- ApplyOutOfSyncOnly=true
30+
{{- end }}

charts/argocd-understack/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ global:
166166
# @default -- false
167167
enabled: false
168168

169+
# -- OIDC RBAC (ClusterRoleBindings for OIDC service account issuer discovery)
170+
oidc_rbac:
171+
# -- Enable/disable deploying OIDC RBAC
172+
# @default -- true
173+
enabled: true
174+
169175
# -- OpenEBS
170176
openebs:
171177
# -- Enable/disable deploying OpenEBS
@@ -505,6 +511,12 @@ site:
505511
# @default -- false
506512
enabled: false
507513

514+
# -- OIDC RBAC (ClusterRoleBindings for OIDC service account issuer discovery)
515+
oidc_rbac:
516+
# -- Enable/disable deploying OIDC RBAC
517+
# @default -- true
518+
enabled: true
519+
508520
# -- OpenEBS
509521
openebs:
510522
# -- Enable/disable deploying OpenEBS
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- oidc-reviewer.yaml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: oidc-reviewer
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: system:service-account-issuer-discovery
9+
subjects:
10+
- apiGroup: rbac.authorization.k8s.io
11+
kind: Group
12+
name: system:unauthenticated
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
kustomize_paths:
3+
- components/oidc-rbac
4+
deploy_overrides:
5+
helm:
6+
mode: none
7+
kustomize:
8+
mode: none
9+
---
10+
11+
# oidc-rbac
12+
13+
OIDC RBAC configuration for Kubernetes service account issuer discovery.
14+
15+
## Deployment Scope
16+
17+
- Cluster scope: global, site
18+
- Values key: `global.oidc_rbac`, `site.oidc_rbac`
19+
- ArgoCD Application template: `charts/argocd-understack/templates/application-oidc-rbac.yaml`
20+
21+
## How ArgoCD Builds It
22+
23+
{{ component_argocd_builds() }}
24+
25+
## How to Enable
26+
27+
This component is enabled by default. To disable it:
28+
29+
```yaml title="$CLUSTER_NAME/deploy.yaml"
30+
global:
31+
oidc_rbac:
32+
enabled: false
33+
site:
34+
oidc_rbac:
35+
enabled: false
36+
```
37+
38+
## Deployment Repo Content
39+
40+
{{ secrets_disclaimer }}
41+
42+
Required or commonly required items:
43+
44+
- None for this Application today. It deploys the shared `components/oidc-rbac` base directly and does not consume deploy-repo values or overlay manifests.

0 commit comments

Comments
 (0)