This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
/
kube-oidc-proxy.yaml
142 lines (142 loc) · 3.27 KB
/
kube-oidc-proxy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
apiVersion: v1
kind: Namespace
metadata:
name: kube-oidc-proxy
---
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
name: kube-oidc-proxy
namespace: kube-oidc-proxy
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: kube-oidc-proxy
name: kube-oidc-proxy
namespace: kube-oidc-proxy
spec:
replicas: 1
selector:
matchLabels:
app: kube-oidc-proxy
template:
metadata:
labels:
app: kube-oidc-proxy
spec:
serviceAccountName: kube-oidc-proxy
containers:
- image: quay.io/jetstack/kube-oidc-proxy:v0.3.0
ports:
- containerPort: 443
- containerPort: 8080
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
name: kube-oidc-proxy
command: ["kube-oidc-proxy"]
args:
- "--secure-port=443"
- "--tls-cert-file=/etc/oidc/tls/crt.pem"
- "--tls-private-key-file=/etc/oidc/tls/key.pem"
- "--oidc-client-id=$(OIDC_CLIENT_ID)"
- "--oidc-issuer-url=$(OIDC_ISSUER_URL)"
- "--oidc-username-claim=$(OIDC_USERNAME_CLAIM)"
- "--oidc-ca-file=/etc/oidc/oidc-ca.pem"
env:
- name: OIDC_CLIENT_ID
valueFrom:
secretKeyRef:
name: kube-oidc-proxy-config
key: oidc.client-id
- name: OIDC_ISSUER_URL
valueFrom:
secretKeyRef:
name: kube-oidc-proxy-config
key: oidc.issuer-url
- name: OIDC_USERNAME_CLAIM
valueFrom:
secretKeyRef:
name: kube-oidc-proxy-config
key: oidc.username-claim
volumeMounts:
- name: kube-oidc-proxy-config
mountPath: /etc/oidc
readOnly: true
- name: kube-oidc-proxy-tls
mountPath: /etc/oidc/tls
readOnly: true
volumes:
- name: kube-oidc-proxy-config
secret:
secretName: kube-oidc-proxy-config
items:
- key: oidc.ca-pem
path: oidc-ca.pem
- name: kube-oidc-proxy-tls
secret:
secretName: kube-oidc-proxy-tls
items:
- key: tls.crt
path: crt.pem
- key: tls.key
path: key.pem
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: kube-oidc-proxy
name: kube-oidc-proxy
namespace: kube-oidc-proxy
spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
type: LoadBalancer
selector:
app: kube-oidc-proxy
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-oidc-proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-oidc-proxy
subjects:
- kind: ServiceAccount
name: kube-oidc-proxy
namespace: kube-oidc-proxy
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kube-oidc-proxy
rules:
- apiGroups:
- ""
resources:
- "users"
- "groups"
- "serviceaccounts"
verbs:
- "impersonate"
- apiGroups:
- "authentication.k8s.io"
resources:
- "userextras/scopes"
- "userextras/remote-client-ip"
- "tokenreviews"
verbs:
- "create"
- "impersonate"