Skip to content

Commit 65d9280

Browse files
Merge pull request #1511 from Danil-Grigorev/embed-capio-reconcile
Embed CAPI Operator reconcile inside turtles pod
2 parents 408a775 + 6e71c33 commit 65d9280

File tree

22 files changed

+501
-232
lines changed

22 files changed

+501
-232
lines changed

.github/workflows/test_chart.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ jobs:
5151
- name: Build docker image
5252
run: make docker-build
5353

54-
- name: Add CAPI operator chart repo
55-
run: helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator
56-
5754
- name: Package operator chart
5855
run: make release-chart
5956

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ build-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_RELEASE_DIR) $(CHART_PA
559559
$(KUSTOMIZE) build ./config/operatorchart > $(CHART_DIR)/templates/operator-crds.yaml
560560
$(KUSTOMIZE) build ./exp/day2/config/chart > $(CHART_DIR)/templates/rancher-turtles-exp-day2-components.yaml
561561
$(KUSTOMIZE) build ./exp/clusterclass/config/default > $(CHART_DIR)/templates/rancher-turtles-exp-clusterclass-components.yaml
562-
./scripts/process-manifests.sh embedded-operator $(CHART_DIR)/templates/operator-crds.yaml
563562
./scripts/process-manifests.sh day2operations $(CHART_DIR)/templates/rancher-turtles-exp-day2-components.yaml
564563
./scripts/process-manifests.sh clusterclass-operations $(CHART_DIR)/templates/rancher-turtles-exp-clusterclass-components.yaml
565564
cp -rf $(CHART_DIR)/* $(CHART_RELEASE_DIR)

charts/rancher-turtles/Chart.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ keywords:
1111
- cluster-api
1212
- capi
1313
- provisioning
14-
dependencies:
15-
- name: cluster-api-operator
16-
version: v0.18.1
17-
repository: https://kubernetes-sigs.github.io/cluster-api-operator
18-
condition: cluster-api-operator.enabled
1914
annotations:
2015
catalog.cattle.io/certified: rancher
2116
catalog.cattle.io/display-name: Rancher Turtles - the Cluster API Extension

charts/rancher-turtles/questions.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ questions:
88
show_subquestion_if: true
99
group: "Rancher Turtles Extra Settings"
1010
subquestions:
11-
- variable: cluster-api-operator.cert-manager.enabled
12-
default: false
13-
type: boolean
14-
description: "Flag to enable or disable installation of cert-manager. If set to false then you will need to install cert-manager manually."
15-
label: "Enable Cert Manager"
1611
- variable: turtlesUI.enabled
1712
default: false
1813
type: boolean
@@ -51,9 +46,4 @@ questions:
5146
description: "[ALPHA] Enable ETCD Backup and Restore functionality in Rancher Turtles."
5247
type: boolean
5348
group: "ETCD Backup and Restore Settings"
54-
show_if: "rancherTurtles.features.day2operations.enabled"
55-
- variable: rancherTurtles.features.embedded-operator.enabled
56-
label: "Enable Turtles Embedded Operator"
57-
description: "[ALPHA] Enable Turtles Embedded Operator functionality in Rancher Turtles."
58-
type: boolean
59-
group: "Embedded operator"
49+
show_if: "rancherTurtles.features.day2operations.enabled"
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{{- if index .Values "rancherTurtles" "features" "embedded-operator" "enabled" }}
2-
apiversion: v1
1+
apiVersion: v1
32
kind: ConfigMap
43
metadata:
54
name: clusterctl-config
6-
namespace: '{{ .Values.rancherTurtles.namespace }}'
7-
{{- end}}
5+
namespace: '{{ .Values.rancherTurtles.namespace }}'

charts/rancher-turtles/templates/deployment.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,16 @@ spec:
7171
requests:
7272
cpu: 10m
7373
memory: 128Mi
74-
{{- if index .Values "rancherTurtles" "features" "embedded-operator" "enabled" }}
7574
{{- with .Values.rancherTurtles.volumeMounts.manager }}
7675
volumeMounts:
7776
{{- toYaml . | nindent 12 }}
7877
{{- end }}
79-
{{- end }}
8078
serviceAccountName: rancher-turtles-manager
8179
terminationGracePeriodSeconds: 10
82-
{{- if index .Values "rancherTurtles" "features" "embedded-operator" "enabled" }}
8380
{{- with .Values.rancherTurtles.volumes }}
8481
volumes:
8582
{{- toYaml . | nindent 8 }}
8683
{{- end }}
87-
{{- end }}
8884
tolerations:
8985
- effect: NoSchedule
9086
key: node-role.kubernetes.io/master

charts/rancher-turtles/templates/operator-crds.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if index .Values "rancherTurtles" "features" "embedded-operator" "enabled" }}
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
@@ -21810,4 +21809,17 @@ spec:
2181021809
storage: true
2181121810
subresources:
2181221811
status: {}
21813-
{{- end }}
21812+
---
21813+
apiVersion: rbac.authorization.k8s.io/v1
21814+
kind: ClusterRole
21815+
metadata:
21816+
labels:
21817+
rancher-turtles/aggregate-to-manager: "true"
21818+
name: rancher-turtles-operator-admin
21819+
rules:
21820+
- apiGroups:
21821+
- '*'
21822+
resources:
21823+
- '*'
21824+
verbs:
21825+
- '*'

charts/rancher-turtles/values.schema.json

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,6 @@
128128
}
129129
}
130130
},
131-
"embedded-operator": {
132-
"type": "object",
133-
"description": "Enable embedded operator controller loops.",
134-
"properties": {
135-
"enabled": {
136-
"type": "boolean",
137-
"default": false,
138-
"description": "Turn on or off."
139-
}
140-
}
141-
},
142131
"clusterclass-operations": {
143132
"type": "object",
144133
"description": "Alpha feature. Not ready for testing yet.",
@@ -220,139 +209,6 @@
220209
"type": "object",
221210
"description": "Manages Cluster API components.",
222211
"properties": {
223-
"enabled": {
224-
"type": "boolean",
225-
"default": true,
226-
"description": "Turn on or off."
227-
},
228-
"cert-manager": {
229-
"type": "object",
230-
"properties": {
231-
"enabled": {
232-
"type": "boolean",
233-
"default": false,
234-
"description": "Turn on or off."
235-
}
236-
}
237-
},
238-
"volumes": {
239-
"type": "array",
240-
"description": "Volumes for operator pods (certs, config).",
241-
"items": {
242-
"type": "object",
243-
"oneOf": [
244-
{
245-
"required": ["name", "secret"],
246-
"properties": {
247-
"name": { "type": "string" },
248-
"secret": {
249-
"type": "object",
250-
"properties": {
251-
"defaultMode": {
252-
"type": "integer",
253-
"default": 420,
254-
"description": "File permissions."
255-
},
256-
"secretName": {
257-
"type": "string",
258-
"default": "capi-operator-webhook-service-cert",
259-
"description": "Secret for webhook certs."
260-
}
261-
}
262-
}
263-
}
264-
},
265-
{
266-
"required": ["name", "configMap"],
267-
"properties": {
268-
"name": { "type": "string" },
269-
"configMap": {
270-
"type": "object",
271-
"properties": {
272-
"name": {
273-
"type": "string",
274-
"default": "clusterctl-config",
275-
"description": "ConfigMap for clusterctl."
276-
}
277-
}
278-
}
279-
}
280-
}
281-
]
282-
}
283-
},
284-
"image": {
285-
"type": "object",
286-
"properties": {
287-
"manager": {
288-
"type": "object",
289-
"properties": {
290-
"repository": {
291-
"type": "string",
292-
"default": "registry.rancher.com/rancher/cluster-api-operator",
293-
"description": "Image repo."
294-
}
295-
}
296-
}
297-
}
298-
},
299-
"volumeMounts": {
300-
"type": "object",
301-
"properties": {
302-
"manager": {
303-
"type": "array",
304-
"description": "Mount volumes to pods.",
305-
"items": {
306-
"type": "object",
307-
"properties": {
308-
"mountPath": { "type": "string" },
309-
"name": { "type": "string" },
310-
"readOnly": {
311-
"type": "boolean",
312-
"default": true,
313-
"description": "Mount as read-only."
314-
}
315-
}
316-
}
317-
}
318-
}
319-
},
320-
"resources": {
321-
"type": "object",
322-
"properties": {
323-
"manager": {
324-
"type": "object",
325-
"properties": {
326-
"limits": {
327-
"type": "object",
328-
"properties": {
329-
"cpu": {
330-
"type": "string",
331-
"description": "CPU limit."
332-
},
333-
"memory": {
334-
"type": "string",
335-
"description": "Memory limit."
336-
}
337-
}
338-
},
339-
"requests": {
340-
"type": "object",
341-
"properties": {
342-
"cpu": {
343-
"type": "string",
344-
"description": "CPU request."
345-
},
346-
"memory": {
347-
"type": "string",
348-
"description": "Memory request."
349-
}
350-
}
351-
}
352-
}
353-
}
354-
}
355-
},
356212
"cleanup": {
357213
"type": "boolean",
358214
"default": true,

charts/rancher-turtles/values.yaml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ rancherTurtles:
2525
kubectlImage: registry.k8s.io/kubernetes/kubectl:v1.30.0
2626
# features: Optional and experimental features.
2727
features:
28-
# embedded-operator: Embed operator controller loops.
29-
embedded-operator:
30-
# enabled: Turn on or off.
31-
enabled: false
3228
# day2operations: Alpha feature.
3329
day2operations:
3430
# enabled: Turn on or off.
@@ -70,48 +66,6 @@ rancherTurtles:
7066

7167
# cluster-api-operator: Manages Cluster API components.
7268
cluster-api-operator:
73-
# enabled: Turn on or off.
74-
enabled: true
75-
# cert-manager: Cert-manager integration.
76-
cert-manager:
77-
# enabled: Turn on or off.
78-
enabled: false
79-
# volumes: Volumes for operator pods (certs, config).
80-
volumes:
81-
- name: cert
82-
secret:
83-
# defaultMode: File permissions.
84-
defaultMode: 420
85-
# secretName: Secret for webhook certs.
86-
secretName: capi-operator-webhook-service-cert
87-
- name: clusterctl-config
88-
configMap:
89-
# name: ConfigMap for clusterctl.
90-
name: clusterctl-config
91-
resources:
92-
manager:
93-
limits:
94-
cpu: 100m
95-
memory: 300Mi
96-
requests:
97-
cpu: 100m
98-
memory: 100Mi
99-
# image: Operator manager image.
100-
image:
101-
manager:
102-
# repository: Image repo.
103-
repository: registry.rancher.com/rancher/cluster-api-operator
104-
# volumeMounts: Mount volumes to pods.
105-
volumeMounts:
106-
manager:
107-
- mountPath: /tmp/k8s-webhook-server/serving-certs
108-
name: cert
109-
# readOnly: Mount as read-only.
110-
readOnly: true
111-
- mountPath: /config
112-
name: clusterctl-config
113-
# readOnly: Mount as read-only.
114-
readOnly: true
11569
# cleanup: Enable cleanup tasks.
11670
cleanup: true
11771
# cluster-api: Cluster API component settings.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
labels:
5+
rancher-turtles/aggregate-to-manager: "true"
6+
name: operator-admin
7+
rules:
8+
- apiGroups:
9+
- '*'
10+
resources:
11+
- '*'
12+
verbs:
13+
- '*'

0 commit comments

Comments
 (0)