Skip to content

Commit 438a834

Browse files
committed
update templates to include admission registration
1 parent 181e8e4 commit 438a834

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

artifacts/install/apiserver-template.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ parameters:
77
value: namespace-reservation-server:latest
88
- name: NAMESPACE
99
value: openshift-namespace-reservation
10+
- name: SERVICE_SERVING_CERT_CA
1011
- name: LOGLEVEL
1112
value: "0"
1213
objects:
@@ -95,4 +96,27 @@ objects:
9596
# singular name to be used as an alias on the CLI and for display
9697
singular: namespacereservation
9798
# kind is normally the CamelCased singular type. Your resource manifests use this.
98-
kind: NamespaceReservation
99+
kind: NamespaceReservation
100+
101+
# register to intercept projectrequest creates
102+
- apiVersion: admissionregistration.k8s.io/v1alpha1
103+
kind: ExternalAdmissionHookConfiguration
104+
metadata:
105+
name: namespacereservations.admission.online.openshift.io
106+
externalAdmissionHooks:
107+
- name: namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations
108+
clientConfig:
109+
service:
110+
namespace: ${NAMESPACE}
111+
name: server
112+
caBundle: ${SERVICE_SERVING_CERT_CA}
113+
rules:
114+
- operations:
115+
- CREATE
116+
apiGroups:
117+
- project.openshift.io
118+
apiVersions:
119+
- "*"
120+
resources:
121+
- projectrequests
122+
failurePolicy: Fail

artifacts/install/rbac-template.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,23 @@ objects:
2222
namespace: ${NAMESPACE}
2323
name: server
2424

25-
# to have the template service broker powers
25+
# to let the admission server read the namespace reservations
26+
- apiVersion: rbac.authorization.k8s.io/v1beta1
27+
kind: ClusterRole
28+
metadata:
29+
annotations:
30+
name: system:openshift:online:namespace-reservation-server
31+
rules:
32+
- apiGroups:
33+
- online.openshift.io
34+
resources:
35+
- namespacereservations
36+
verbs:
37+
- get
38+
list
39+
watch
40+
41+
# to let the admission server read the namespace reservations
2642
- apiVersion: rbac.authorization.k8s.io/v1beta1
2743
kind: ClusterRoleBinding
2844
metadata:

0 commit comments

Comments
 (0)