Skip to content

Commit c45c03b

Browse files
committed
helm: fix oauth2-proxy namespace names
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
1 parent 79c3ee2 commit c45c03b

8 files changed

Lines changed: 24 additions & 49 deletions

File tree

experimental/helm/charts/oauth2-proxy/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Install foundation, cert-manager, and Istio first. The `kubeflow-namespaces`
1010
foundation chart creates `Namespace/oauth2-proxy`; this chart stores Helm
1111
release metadata in that same workload namespace.
1212

13+
## Namespace names
14+
15+
Namespace names are fixed to match the Kustomize baseline and `kubeflow-namespaces` foundation chart. oauth2-proxy workloads use `oauth2-proxy`, Istio auth resources use `istio-system`, and gateway references use `kubeflow`. These names are not configurable.
16+
1317
```bash
1418
helm install oauth2-proxy ./experimental/helm/charts/oauth2-proxy \
1519
--namespace oauth2-proxy \

experimental/helm/charts/oauth2-proxy/templates/_helpers.tpl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
{{/*
2-
oauth2-proxy workload namespace.
3-
*/}}
4-
{{- define "oauth2-proxy.namespace" -}}
5-
{{- .Values.global.oauth2ProxyNamespace -}}
6-
{{- end -}}
7-
8-
{{/*
9-
Istio namespace.
10-
*/}}
11-
{{- define "oauth2-proxy.istioNamespace" -}}
12-
{{- .Values.global.istioNamespace -}}
13-
{{- end -}}
14-
15-
{{/*
16-
Kubeflow namespace.
17-
*/}}
18-
{{- define "oauth2-proxy.kubeflowNamespace" -}}
19-
{{- .Values.global.kubeflowNamespace -}}
20-
{{- end -}}
21-
221
{{/*
232
Render a JWT rule for Istio RequestAuthentication.
243
*/}}

experimental/helm/charts/oauth2-proxy/templates/cluster-jwks-proxy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ metadata:
55
labels:
66
app.kubernetes.io/name: cluster-jwks-proxy
77
name: cluster-jwks-proxy
8-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
8+
namespace: istio-system
99
---
1010
apiVersion: v1
1111
kind: Service
1212
metadata:
1313
labels:
1414
app.kubernetes.io/name: cluster-jwks-proxy
1515
name: cluster-jwks-proxy
16-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
16+
namespace: istio-system
1717
spec:
1818
ports:
1919
- name: http
@@ -28,7 +28,7 @@ metadata:
2828
labels:
2929
app.kubernetes.io/name: cluster-jwks-proxy
3030
name: cluster-jwks-proxy
31-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
31+
namespace: istio-system
3232
spec:
3333
replicas: 1
3434
selector:

experimental/helm/charts/oauth2-proxy/templates/istio-external-auth.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: security.istio.io/v1beta1
33
kind: AuthorizationPolicy
44
metadata:
55
name: istio-ingressgateway-oauth2-proxy
6-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
6+
namespace: istio-system
77
spec:
88
action: CUSTOM
99
provider:
@@ -27,7 +27,7 @@ apiVersion: security.istio.io/v1beta1
2727
kind: AuthorizationPolicy
2828
metadata:
2929
name: istio-ingressgateway-require-jwt
30-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
30+
namespace: istio-system
3131
spec:
3232
action: DENY
3333
rules:
@@ -49,7 +49,7 @@ apiVersion: security.istio.io/v1beta1
4949
kind: RequestAuthentication
5050
metadata:
5151
name: dex-jwt
52-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
52+
namespace: istio-system
5353
spec:
5454
jwtRules:
5555
- forwardOriginalToken: true

experimental/helm/charts/oauth2-proxy/templates/m2m.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: security.istio.io/v1beta1
33
kind: RequestAuthentication
44
metadata:
55
name: m2m-token-issuer
6-
namespace: {{ include "oauth2-proxy.istioNamespace" . }}
6+
namespace: istio-system
77
spec:
88
jwtRules:
99
{{ include "oauth2-proxy.m2mJwtRule" (dict "issuer" .Values.m2m.issuer "jwksUri" .Values.m2m.jwksUri) | nindent 2 }}

experimental/helm/charts/oauth2-proxy/templates/networkpolicies.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: networking.k8s.io/v1
33
kind: NetworkPolicy
44
metadata:
55
name: allow-istio-ingressgateway
6-
namespace: {{ include "oauth2-proxy.namespace" . }}
6+
namespace: oauth2-proxy
77
spec:
88
ingress:
99
- from:
@@ -12,7 +12,7 @@ spec:
1212
- key: kubernetes.io/metadata.name
1313
operator: In
1414
values:
15-
- {{ include "oauth2-proxy.istioNamespace" . }}
15+
- istio-system
1616
podSelector:
1717
matchLabels:
1818
app: istio-ingressgateway
@@ -29,7 +29,7 @@ apiVersion: networking.k8s.io/v1
2929
kind: NetworkPolicy
3030
metadata:
3131
name: default-allow-same-namespace-oauth2-proxy
32-
namespace: {{ include "oauth2-proxy.namespace" . }}
32+
namespace: oauth2-proxy
3333
spec:
3434
ingress:
3535
- from:

experimental/helm/charts/oauth2-proxy/templates/oauth2-proxy.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
kind: ServiceAccount
44
metadata:
55
name: oauth2-proxy
6-
namespace: {{ include "oauth2-proxy.namespace" . }}
6+
namespace: oauth2-proxy
77
---
88
apiVersion: v1
99
data:
@@ -12,7 +12,7 @@ data:
1212
kind: ConfigMap
1313
metadata:
1414
name: oauth2-proxy
15-
namespace: {{ include "oauth2-proxy.namespace" . }}
15+
namespace: oauth2-proxy
1616
---
1717
apiVersion: v1
1818
data:
@@ -23,7 +23,7 @@ data:
2323
kind: ConfigMap
2424
metadata:
2525
name: oauth2-proxy-parameters
26-
namespace: {{ include "oauth2-proxy.namespace" . }}
26+
namespace: oauth2-proxy
2727
---
2828
apiVersion: v1
2929
data:
@@ -32,7 +32,7 @@ data:
3232
kind: ConfigMap
3333
metadata:
3434
name: oauth2-proxy-theme
35-
namespace: {{ include "oauth2-proxy.namespace" . }}
35+
namespace: oauth2-proxy
3636
---
3737
apiVersion: v1
3838
data:
@@ -42,14 +42,14 @@ data:
4242
kind: Secret
4343
metadata:
4444
name: oauth2-proxy
45-
namespace: {{ include "oauth2-proxy.namespace" . }}
45+
namespace: oauth2-proxy
4646
type: Opaque
4747
---
4848
apiVersion: v1
4949
kind: Service
5050
metadata:
5151
name: oauth2-proxy
52-
namespace: {{ include "oauth2-proxy.namespace" . }}
52+
namespace: oauth2-proxy
5353
spec:
5454
ports:
5555
- name: http
@@ -66,7 +66,7 @@ metadata:
6666
labels:
6767
app: oauth2-proxy
6868
name: oauth2-proxy
69-
namespace: {{ include "oauth2-proxy.namespace" . }}
69+
namespace: oauth2-proxy
7070
spec:
7171
replicas: 2
7272
selector:
@@ -166,10 +166,10 @@ apiVersion: networking.istio.io/v1alpha3
166166
kind: VirtualService
167167
metadata:
168168
name: oauth2-proxy
169-
namespace: {{ include "oauth2-proxy.namespace" . }}
169+
namespace: oauth2-proxy
170170
spec:
171171
gateways:
172-
- {{ include "oauth2-proxy.kubeflowNamespace" . }}/kubeflow-gateway
172+
- kubeflow/kubeflow-gateway
173173
hosts:
174174
- '*'
175175
http:
@@ -178,7 +178,7 @@ spec:
178178
prefix: /oauth2/
179179
route:
180180
- destination:
181-
host: oauth2-proxy.{{ include "oauth2-proxy.namespace" . }}.svc.cluster.local
181+
host: oauth2-proxy.oauth2-proxy.svc.cluster.local
182182
port:
183183
number: 80
184184
{{- end }}

experimental/helm/charts/oauth2-proxy/values.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Default values for the Kubeflow oauth2-proxy chart.
22

3-
global:
4-
# -- Namespace for oauth2-proxy workloads.
5-
oauth2ProxyNamespace: oauth2-proxy
6-
# -- Namespace for Istio ingress gateway and auth resources.
7-
istioNamespace: istio-system
8-
# -- Namespace containing the Kubeflow gateway.
9-
kubeflowNamespace: kubeflow
10-
113
credentials:
124
# -- OAuth client ID used by oauth2-proxy.
135
clientID: kubeflow-oidc-authservice

0 commit comments

Comments
 (0)