Skip to content

Commit f448187

Browse files
mprahlopenshift-merge-robot
authored andcommitted
Use the consolidated sync controller
This uses the new governance-policy-framework-addon controller which replaces the separate containers for spec-sync, status-sync, and template-sync. Relates: stolostron/backlog#25999 Signed-off-by: mprahl <[email protected]>
1 parent 78c5dcf commit f448187

File tree

8 files changed

+56
-212
lines changed

8 files changed

+56
-212
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ e2e-run-instrumented: e2e-build-instrumented
272272
-KUBECONFIG=$(KIND_KUBECONFIG) kubectl create ns $(CONTROLLER_NAMESPACE)
273273
CONFIG_POLICY_CONTROLLER_IMAGE="$(REGISTRY)/config-policy-controller:$(TAG)" \
274274
KUBE_RBAC_PROXY_IMAGE="registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.10" \
275-
GOVERNANCE_POLICY_SPEC_SYNC_IMAGE="$(REGISTRY)/governance-policy-spec-sync:$(TAG)" \
276-
GOVERNANCE_POLICY_STATUS_SYNC_IMAGE="$(REGISTRY)/governance-policy-status-sync:$(TAG)" \
277-
GOVERNANCE_POLICY_TEMPLATE_SYNC_IMAGE="$(REGISTRY)/governance-policy-template-sync:$(TAG)" \
275+
GOVERNANCE_POLICY_FRAMEWORK_ADDON_IMAGE="$(REGISTRY)/governance-policy-framework-addon:$(TAG)" \
278276
./build/_output/bin/$(IMG)-instrumented -test.v -test.run="^TestRunMain$$" -test.coverprofile=$(COVERAGE_E2E_OUT) \
279277
--kubeconfig="$(KIND_KUBECONFIG)" &>build/_output/controller.log &
280278

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ The addons managed by this controller are:
2121
- The "config-policy-controller" consisting of the
2222
[Configuration Policy Controller](https://github.com/open-cluster-management-io/config-policy-controller).
2323
- The "governance-policy-framework" consisting of the
24-
[Policy Spec Sync](https://github.com/open-cluster-management-io/governance-policy-spec-sync), the
25-
[Policy Status Sync](https://github.com/open-cluster-management-io/governance-policy-status-sync), and the
26-
[Policy Template Sync](https://github.com/open-cluster-management-io/governance-policy-template-sync).
24+
[Governance Policy Framework Addon](https://github.com/open-cluster-management-io/governance-policy-framework-addon).
2725

2826
Go to the [Contributing guide](CONTRIBUTING.md) to learn how to get involved.
2927

config/manager/manager.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ spec:
4242
value: quay.io/open-cluster-management/config-policy-controller:latest
4343
- name: KUBE_RBAC_PROXY_IMAGE
4444
value: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.10
45-
- name: GOVERNANCE_POLICY_SPEC_SYNC_IMAGE
46-
value: quay.io/open-cluster-management/governance-policy-spec-sync:latest
47-
- name: GOVERNANCE_POLICY_STATUS_SYNC_IMAGE
48-
value: quay.io/open-cluster-management/governance-policy-status-sync:latest
49-
- name: GOVERNANCE_POLICY_TEMPLATE_SYNC_IMAGE
50-
value: quay.io/open-cluster-management/governance-policy-template-sync:latest
45+
- name: GOVERNANCE_POLICY_FRAMEWORK_ADDON_IMAGE
46+
value: quay.io/open-cluster-management/governance-policy-framework-addon:latest
5147
name: manager
5248
securityContext:
5349
allowPrivilegeEscalation: false

pkg/addon/policyframework/agent_addon.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ func getValues(cluster *clusterv1.ManagedCluster,
4747
ImagePullPolicy: "IfNotPresent",
4848
ImagePullSecret: "open-cluster-management-image-pull-credentials",
4949
ImageOverrides: map[string]string{
50-
"governance_policy_spec_sync": os.Getenv("GOVERNANCE_POLICY_SPEC_SYNC_IMAGE"),
51-
"governance_policy_status_sync": os.Getenv("GOVERNANCE_POLICY_STATUS_SYNC_IMAGE"),
52-
"governance_policy_template_sync": os.Getenv("GOVERNANCE_POLICY_TEMPLATE_SYNC_IMAGE"),
50+
"governance_policy_framework_addon": os.Getenv("GOVERNANCE_POLICY_FRAMEWORK_ADDON_IMAGE"),
5351
},
5452
NodeSelector: map[string]string{},
5553
ProxyConfig: map[string]string{

pkg/addon/policyframework/manifests/managedclusterchart/templates/deployment.yaml

Lines changed: 13 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -30,113 +30,35 @@ spec:
3030
heritage: {{ .Release.Service }}
3131
spec:
3232
containers:
33-
{{- if not .Values.onMulticlusterHub }}
34-
- name: spec-sync
35-
image: "{{ .Values.global.imageOverrides.governance_policy_spec_sync }}"
33+
- name: governance-policy-framework-addon
34+
image: "{{ .Values.global.imageOverrides.governance_policy_framework_addon }}"
3635
imagePullPolicy: "{{ .Values.global.imagePullPolicy }}"
37-
command: ["governance-policy-spec-sync"]
38-
args:
39-
- '--hub-cluster-configfile=/var/run/klusterlet/kubeconfig'
40-
- '--health-probe-bind-address=:8081'
41-
{{- if semverCompare "< 1.14.0" .Capabilities.KubeVersion.Version }}
42-
- --legacy-leader-elect=true
43-
{{- end }}
44-
- --log-encoder={{ .Values.args.logEncoder }}
45-
- --log-level={{ .Values.args.logLevel }}
46-
- --v={{ .Values.args.pkgLogLevel }}
47-
{{- if eq .Values.installMode "Hosted" }}
48-
- --target-namespace={{ .Release.Namespace }}
49-
{{- end }}
50-
env:
51-
- name: WATCH_NAMESPACE
52-
value: {{ .Values.clusterName }}
53-
- name: POD_NAME
54-
valueFrom:
55-
fieldRef:
56-
fieldPath: metadata.name
57-
- name: OPERATOR_NAME
58-
value: "governance-policy-spec-sync"
59-
{{- if .Values.global.proxyConfig }}
60-
- name: HTTP_PROXY
61-
value: {{ .Values.global.proxyConfig.HTTP_PROXY }}
62-
- name: HTTPS_PROXY
63-
value: {{ .Values.global.proxyConfig.HTTPS_PROXY }}
64-
- name: NO_PROXY
65-
value: {{ .Values.global.proxyConfig.NO_PROXY }}
66-
{{- end }}
67-
livenessProbe:
68-
httpGet:
69-
path: /healthz
70-
port: 8081
71-
failureThreshold: 3
72-
periodSeconds: 10
73-
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
74-
initialDelaySeconds: 300
75-
{{- end }}
76-
readinessProbe:
77-
httpGet:
78-
path: /readyz
79-
port: 8081
80-
failureThreshold: 3
81-
periodSeconds: 10
82-
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
83-
initialDelaySeconds: 300
84-
{{- end }}
85-
{{- if semverCompare ">= 1.20.0" .Capabilities.KubeVersion.Version }}
86-
{{- /* startupProbe became stable in k8s 1.20 */}}
87-
startupProbe:
88-
httpGet:
89-
path: /readyz
90-
port: 8081
91-
failureThreshold: 30
92-
periodSeconds: 10
93-
{{- end }}
94-
resources: {{- toYaml .Values.resources | nindent 10 }}
95-
securityContext:
96-
allowPrivilegeEscalation: false
97-
capabilities:
98-
drop:
99-
- ALL
100-
privileged: false
101-
readOnlyRootFilesystem: true
102-
volumeMounts:
103-
- name: klusterlet-config
104-
mountPath: /var/run/klusterlet
105-
{{- end }}
106-
- name: status-sync
107-
image: "{{ .Values.global.imageOverrides.governance_policy_status_sync }}"
108-
imagePullPolicy: "{{ .Values.global.imagePullPolicy }}"
109-
command: ["governance-policy-status-sync"]
36+
command: ["governance-policy-framework-addon"]
11037
args:
11138
- '--enable-lease=true'
11239
- '--hub-cluster-configfile=/var/run/klusterlet/kubeconfig'
113-
- '--health-probe-bind-address=:8082'
11440
{{- if semverCompare "< 1.14.0" .Capabilities.KubeVersion.Version }}
11541
- --legacy-leader-elect=true
11642
{{- end }}
11743
- --log-encoder={{ .Values.args.logEncoder }}
11844
- --log-level={{ .Values.args.logLevel }}
11945
- --v={{ .Values.args.pkgLogLevel }}
46+
{{- if .Values.onMulticlusterHub }}
47+
- --disable-spec-sync=true
48+
{{- end }}
12049
{{- if eq .Values.installMode "Hosted" }}
50+
- --cluster-namespace={{ .Release.Namespace }}
51+
- --cluster-namespace-on-hub={{ .Values.clusterName }}
52+
{{- else }}
12153
- --cluster-namespace={{ .Values.clusterName }}
12254
{{- end }}
12355
env:
124-
- name: WATCH_NAMESPACE
125-
{{- if eq .Values.installMode "Hosted" }}
126-
value: {{ .Release.Namespace }}
127-
{{- else }}
128-
value: {{ .Values.clusterName }}
129-
{{- end }}
13056
- name: POD_NAME
13157
valueFrom:
13258
fieldRef:
13359
fieldPath: metadata.name
13460
- name: OPERATOR_NAME
135-
value: "governance-policy-status-sync"
136-
{{- if .Values.onMulticlusterHub }}
137-
- name: ON_MULTICLUSTERHUB
138-
value: "true"
139-
{{- end }}
61+
value: "governance-policy-framework-addon"
14062
{{- if .Values.global.proxyConfig }}
14163
- name: HTTP_PROXY
14264
value: {{ .Values.global.proxyConfig.HTTP_PROXY }}
@@ -148,7 +70,7 @@ spec:
14870
livenessProbe:
14971
httpGet:
15072
path: /healthz
151-
port: 8082
73+
port: 8080
15274
failureThreshold: 3
15375
periodSeconds: 10
15476
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
@@ -157,7 +79,7 @@ spec:
15779
readinessProbe:
15880
httpGet:
15981
path: /readyz
160-
port: 8082
82+
port: 8080
16183
failureThreshold: 3
16284
periodSeconds: 10
16385
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
@@ -168,7 +90,7 @@ spec:
16890
startupProbe:
16991
httpGet:
17092
path: /readyz
171-
port: 8082
93+
port: 8080
17294
failureThreshold: 30
17395
periodSeconds: 10
17496
{{- end }}
@@ -183,74 +105,6 @@ spec:
183105
volumeMounts:
184106
- name: klusterlet-config
185107
mountPath: /var/run/klusterlet
186-
- name: template-sync
187-
image: "{{ .Values.global.imageOverrides.governance_policy_template_sync }}"
188-
imagePullPolicy: "{{ .Values.global.imagePullPolicy }}"
189-
command: ["governance-policy-template-sync"]
190-
args:
191-
{{- if semverCompare "< 1.14.0" .Capabilities.KubeVersion.Version }}
192-
- --legacy-leader-elect=true
193-
{{- end }}
194-
- --log-encoder={{ .Values.args.logEncoder }}
195-
- --log-level={{ .Values.args.logLevel }}
196-
- --v={{ .Values.args.pkgLogLevel }}
197-
- --health-probe-bind-address=:8083
198-
env:
199-
- name: WATCH_NAMESPACE
200-
{{- if eq .Values.installMode "Hosted" }}
201-
value: {{ .Release.Namespace }}
202-
{{- else }}
203-
value: {{ .Values.clusterName }}
204-
{{- end }}
205-
- name: POD_NAME
206-
valueFrom:
207-
fieldRef:
208-
fieldPath: metadata.name
209-
- name: OPERATOR_NAME
210-
value: "governance-policy-template-sync"
211-
{{- if .Values.global.proxyConfig }}
212-
- name: HTTP_PROXY
213-
value: {{ .Values.global.proxyConfig.HTTP_PROXY }}
214-
- name: HTTPS_PROXY
215-
value: {{ .Values.global.proxyConfig.HTTPS_PROXY }}
216-
- name: NO_PROXY
217-
value: {{ .Values.global.proxyConfig.NO_PROXY }}
218-
{{- end }}
219-
livenessProbe:
220-
httpGet:
221-
path: /healthz
222-
port: 8083
223-
failureThreshold: 3
224-
periodSeconds: 10
225-
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
226-
initialDelaySeconds: 300
227-
{{- end }}
228-
readinessProbe:
229-
httpGet:
230-
path: /readyz
231-
port: 8083
232-
failureThreshold: 3
233-
periodSeconds: 10
234-
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
235-
initialDelaySeconds: 300
236-
{{- end }}
237-
{{- if semverCompare ">= 1.20.0" .Capabilities.KubeVersion.Version }}
238-
{{- /* startupProbe became stable in k8s 1.20 */}}
239-
startupProbe:
240-
httpGet:
241-
path: /readyz
242-
port: 8083
243-
failureThreshold: 30
244-
periodSeconds: 10
245-
{{- end }}
246-
resources: {{- toYaml .Values.resources | nindent 10 }}
247-
securityContext:
248-
allowPrivilegeEscalation: false
249-
capabilities:
250-
drop:
251-
- ALL
252-
privileged: false
253-
readOnlyRootFilesystem: true
254108
volumes:
255109
- name: klusterlet-config
256110
secret:

pkg/addon/policyframework/manifests/managedclusterchart/templates/leader_election_role.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,3 @@ rules:
4444
verbs:
4545
- create
4646
- patch
47-
# Used for the health check by status-sync
48-
- apiGroups:
49-
- ""
50-
resources:
51-
- pods
52-
verbs:
53-
- get
54-
- list

pkg/addon/policyframework/manifests/managedclusterchart/values.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ global:
3737
imagePullPolicy: IfNotPresent
3838
imagePullSecret: open-cluster-management-image-pull-credentials
3939
imageOverrides:
40-
governance_policy_spec_sync: quay.io/open-cluster-management/governance-policy-spec-sync:latest
41-
governance_policy_status_sync: quay.io/open-cluster-management/governance-policy-status-sync:latest
42-
governance_policy_template_sync: quay.io/open-cluster-management/governance-policy-template-sync:latest
40+
governance_policy_framework_addon: quay.io/open-cluster-management/governance-policy-framework-addon:latest
4341
nodeSelector: {}
4442
proxyConfig:
4543
HTTP_PROXY: null

0 commit comments

Comments
 (0)