Skip to content

Commit 105f738

Browse files
authored
Kustomise files for daily (#256)
1 parent 40be886 commit 105f738

21 files changed

+6781
-0
lines changed

deploy/kustomize/daily/README.adoc

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
= Installing the Runtime Component Operator using kustomize
2+
3+
This directory contains kustomize files that can be used to install the operator
4+
in your cluster in various different configurations, and also some example overlays
5+
which show how the installation can be customized
6+
7+
== base
8+
The simplest configuration will install the operator into the default namespace, and the operator
9+
will watch for RuntimeComponent instances only in its own namespace. To install, run:
10+
`kubectl apply -k base`
11+
and to uninstall, run:
12+
`kubectl delete -k base`
13+
14+
== examples/watch-own-namespace
15+
This example overlay demonstrates how to modify the base configuration to install/watch a
16+
namespace other than 'default'. The example installs the operator to a namespace called
17+
'rco-ns' which should already exist. To install, run `kubectl apply -k examples/watch-own-namespace`
18+
19+
== overlays/watch-another-namespace
20+
This overlay installs the operator into the namespace 'rco-ns', but configures it to
21+
watch for RuntimeComponent instances in a different namespace called 'rco-watched-ns'. As
22+
this overlay install resources into two different namespaces, the namespace must not be specified
23+
in the kustomize.yaml file. To install, run `kubectl apply -k overlays/watch-another-namespace`
24+
25+
26+
== examples/watch-another-namespace
27+
This example overlay builds on the previous one, but demonstrates how to change the
28+
install and watched namespaces. In this case, the operator is installed into 'rco-ns2'
29+
and it will watch for resources in 'rco-watched-ns2'. To install run `kubectl apply -k
30+
examples/watch-another-namespace`
31+
32+
== overlays/watch-all-namespaces
33+
This overlay installs the operator into the default namespace, but configures it
34+
to watch for RuntimeComponent instances in any namespace. Compared to the base,
35+
this requires additional ClusterRoles and ClusterRoleBindings. To install run:
36+
`kubectl apply -k overlays/watch-all-namespaces`
37+
38+
== examples/watch-all-namespaces
39+
This example overlay builds on the previous one, and demonstrates how to change
40+
which namespace the operator is installed into. In this example, the operator
41+
is installed into a namespace called 'rco-ns', and will still watch for
42+
RuntimeComponent instances in any namespace. To install, run:
43+
`kubectl apply -k examples/watch-all-namespaces`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: default
5+
6+
resources:
7+
- runtime-component-crd.yaml
8+
- runtime-component-operator.yaml
9+

deploy/kustomize/daily/base/runtime-component-crd.yaml

+5,884
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
labels:
6+
app.kubernetes.io/instance: runtime-component-operator
7+
app.kubernetes.io/managed-by: olm
8+
app.kubernetes.io/name: runtime-component-operator
9+
name: rco-controller-manager
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: Role
13+
metadata:
14+
labels:
15+
app.kubernetes.io/instance: runtime-component-operator
16+
app.kubernetes.io/managed-by: olm
17+
app.kubernetes.io/name: runtime-component-operator
18+
name: rco-leader-election-role
19+
rules:
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- configmaps
24+
verbs:
25+
- get
26+
- list
27+
- watch
28+
- create
29+
- update
30+
- patch
31+
- delete
32+
- apiGroups:
33+
- ""
34+
resources:
35+
- configmaps/status
36+
verbs:
37+
- get
38+
- update
39+
- patch
40+
- apiGroups:
41+
- ""
42+
resources:
43+
- events
44+
verbs:
45+
- create
46+
- patch
47+
- apiGroups:
48+
- coordination.k8s.io
49+
resources:
50+
- leases
51+
verbs:
52+
- get
53+
- list
54+
- watch
55+
- create
56+
- update
57+
- patch
58+
- delete
59+
---
60+
apiVersion: rbac.authorization.k8s.io/v1
61+
kind: Role
62+
metadata:
63+
creationTimestamp: null
64+
labels:
65+
app.kubernetes.io/instance: runtime-component-operator
66+
app.kubernetes.io/managed-by: olm
67+
app.kubernetes.io/name: runtime-component-operator
68+
name: rco-manager-role
69+
rules:
70+
- apiGroups:
71+
- apps
72+
resources:
73+
- deployments
74+
- statefulsets
75+
verbs:
76+
- '*'
77+
- apiGroups:
78+
- apps
79+
resources:
80+
- deployments/finalizers
81+
- statefulsets
82+
verbs:
83+
- update
84+
- apiGroups:
85+
- autoscaling
86+
resources:
87+
- horizontalpodautoscalers
88+
verbs:
89+
- '*'
90+
- apiGroups:
91+
- ""
92+
resources:
93+
- configmaps
94+
- secrets
95+
- serviceaccounts
96+
- services
97+
verbs:
98+
- '*'
99+
- apiGroups:
100+
- ""
101+
resources:
102+
- pods
103+
- pods/exec
104+
verbs:
105+
- '*'
106+
- apiGroups:
107+
- image.openshift.io
108+
resources:
109+
- imagestreams
110+
- imagestreamtags
111+
verbs:
112+
- get
113+
- list
114+
- watch
115+
- apiGroups:
116+
- monitoring.coreos.com
117+
resources:
118+
- servicemonitors
119+
verbs:
120+
- '*'
121+
- apiGroups:
122+
- networking.k8s.io
123+
resources:
124+
- ingresses
125+
verbs:
126+
- '*'
127+
- apiGroups:
128+
- rc.app.stacks
129+
resources:
130+
- runtimecomponents
131+
- runtimecomponents/finalizers
132+
- runtimecomponents/status
133+
verbs:
134+
- '*'
135+
- apiGroups:
136+
- rc.app.stacks
137+
resources:
138+
- runtimeoperations
139+
- runtimeoperations/finalizers
140+
- runtimeoperations/status
141+
verbs:
142+
- '*'
143+
- apiGroups:
144+
- route.openshift.io
145+
resources:
146+
- routes
147+
- routes/custom-host
148+
verbs:
149+
- '*'
150+
- apiGroups:
151+
- serving.knative.dev
152+
resources:
153+
- services
154+
verbs:
155+
- '*'
156+
---
157+
apiVersion: rbac.authorization.k8s.io/v1
158+
kind: RoleBinding
159+
metadata:
160+
labels:
161+
app.kubernetes.io/instance: runtime-component-operator
162+
app.kubernetes.io/managed-by: olm
163+
app.kubernetes.io/name: runtime-component-operator
164+
name: rco-leader-election-rolebinding
165+
roleRef:
166+
apiGroup: rbac.authorization.k8s.io
167+
kind: Role
168+
name: rco-leader-election-role
169+
subjects:
170+
- kind: ServiceAccount
171+
name: rco-controller-manager
172+
---
173+
apiVersion: rbac.authorization.k8s.io/v1
174+
kind: RoleBinding
175+
metadata:
176+
labels:
177+
app.kubernetes.io/instance: runtime-component-operator
178+
app.kubernetes.io/managed-by: olm
179+
app.kubernetes.io/name: runtime-component-operator
180+
name: rco-manager-rolebinding
181+
roleRef:
182+
apiGroup: rbac.authorization.k8s.io
183+
kind: Role
184+
name: rco-manager-role
185+
subjects:
186+
- kind: ServiceAccount
187+
name: rco-controller-manager
188+
---
189+
apiVersion: apps/v1
190+
kind: Deployment
191+
metadata:
192+
labels:
193+
app.kubernetes.io/instance: runtime-component-operator
194+
app.kubernetes.io/managed-by: olm
195+
app.kubernetes.io/name: runtime-component-operator
196+
control-plane: controller-manager
197+
name: rco-controller-manager
198+
spec:
199+
replicas: 1
200+
selector:
201+
matchLabels:
202+
app.kubernetes.io/instance: runtime-component-operator
203+
app.kubernetes.io/managed-by: olm
204+
app.kubernetes.io/name: runtime-component-operator
205+
control-plane: controller-manager
206+
template:
207+
metadata:
208+
labels:
209+
app.kubernetes.io/instance: runtime-component-operator
210+
app.kubernetes.io/managed-by: olm
211+
app.kubernetes.io/name: runtime-component-operator
212+
control-plane: controller-manager
213+
spec:
214+
containers:
215+
- args:
216+
- --enable-leader-election
217+
command:
218+
- /manager
219+
env:
220+
- name: OPERATOR_NAMESPACE
221+
valueFrom:
222+
fieldRef:
223+
fieldPath: metadata.namespace
224+
- name: WATCH_NAMESPACE
225+
value: default
226+
# valueFrom:
227+
# fieldRef:
228+
# fieldPath: metadata.annotations['olm.targetNamespaces']
229+
image: applicationstacks/operator:daily
230+
imagePullPolicy: Always
231+
name: manager
232+
resources:
233+
limits:
234+
cpu: 200m
235+
memory: 256Mi
236+
requests:
237+
cpu: 100m
238+
memory: 20Mi
239+
serviceAccountName: rco-controller-manager
240+
terminationGracePeriodSeconds: 10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: rco-ns
5+
6+
bases:
7+
- ../../overlays/watch-all-namespaces
8+
9+
patchesStrategicMerge:
10+
- rco-ns.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: rco-leader-election-cluster-rolebinding
6+
subjects:
7+
- kind: ServiceAccount
8+
name: rco-controller-manager
9+
namespace: rco-ns
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: ClusterRoleBinding
13+
metadata:
14+
name: rco-manager-cluster-rolebinding
15+
subjects:
16+
- kind: ServiceAccount
17+
name: rco-controller-manager
18+
namespace: rco-ns
19+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
5+
bases:
6+
- ../../overlays/watch-another-namespace
7+
8+
patchesStrategicMerge:
9+
- rco-deployment.yaml
10+
- rco-roles.yaml
11+
- rco-sa.yaml
12+
- watched-roles.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: rco-controller-manager
5+
namespace: rco-ns2
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: manager
11+
env:
12+
- name: WATCH_NAMESPACE
13+
value: rco-watched-ns2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
name: rco-leader-election-role
5+
namespace: rco-ns2
6+
---
7+
apiVersion: rbac.authorization.k8s.io/v1
8+
kind: Role
9+
metadata:
10+
name: rco-manager-role
11+
namespace: rco-ns2
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: RoleBinding
15+
metadata:
16+
name: rco-leader-election-rolebinding
17+
namespace: rco-ns2
18+
subjects:
19+
- kind: ServiceAccount
20+
name: rco-controller-manager
21+
namespace: rco-ns2
22+
---
23+
apiVersion: rbac.authorization.k8s.io/v1
24+
kind: RoleBinding
25+
metadata:
26+
name: rco-manager-rolebinding
27+
namespace: rco-ns2
28+
subjects:
29+
- kind: ServiceAccount
30+
name: rco-controller-manager
31+
namespace: rco-ns2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: rco-controller-manager
5+
namespace: rco-ns2

0 commit comments

Comments
 (0)