-
Notifications
You must be signed in to change notification settings - Fork 47
Add cluster-proxy to charts-config.yaml #3220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6a16061
38fc69c
84d3283
7529135
a1786d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1003,6 +1003,7 @@ func (r *MultiClusterEngineReconciler) fetchChartOrCRDPath(component string) str | |
| backplanev1.ClusterManager: toggle.ClusterManagerChartDir, | ||
| backplanev1.ClusterPermission: toggle.ClusterPermissionChartDir, | ||
| backplanev1.ClusterProxyAddon: toggle.ClusterProxyAddonDir, | ||
| backplanev1.ClusterProxy: toggle.ClusterProxyDir, | ||
| backplanev1.ConsoleMCE: toggle.ConsoleMCEChartsDir, | ||
| backplanev1.Discovery: toggle.DiscoveryChartDir, | ||
| backplanev1.Hive: toggle.HiveChartDir, | ||
|
|
@@ -1284,26 +1285,29 @@ func (r *MultiClusterEngineReconciler) ensureToggleableComponents(ctx context.Co | |
| log.Info(messages.SkippingExternallyManaged, "component", backplanev1.ServerFoundation) | ||
| } | ||
|
|
||
| if !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxyAddon) { | ||
| if backplaneConfig.Enabled(backplanev1.ClusterProxyAddon) && foundation.CanInstallAddons(ctx, r.Client) { | ||
| result, err = r.ensureClusterProxyAddon(ctx, backplaneConfig) | ||
| // Handle ClusterProxyAddon (deprecated) and ClusterProxy - both use same chart | ||
| if !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxyAddon) || | ||
| !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxy) { | ||
| if (backplaneConfig.Enabled(backplanev1.ClusterProxyAddon) || backplaneConfig.Enabled(backplanev1.ClusterProxy)) && | ||
| foundation.CanInstallAddons(ctx, r.Client) { | ||
| result, err = r.ensureClusterProxy(ctx, backplaneConfig) | ||
| if result != (ctrl.Result{}) { | ||
| requeue = true | ||
| } | ||
| if err != nil { | ||
| errs[backplanev1.ClusterProxyAddon] = err | ||
| errs[backplanev1.ClusterProxy] = err | ||
| } | ||
| } else { | ||
| result, err = r.ensureNoClusterProxyAddon(ctx, backplaneConfig) | ||
| result, err = r.ensureNoClusterProxy(ctx, backplaneConfig) | ||
| if result != (ctrl.Result{}) { | ||
| requeue = true | ||
| } | ||
| if err != nil { | ||
| errs[backplanev1.ClusterProxyAddon] = err | ||
| errs[backplanev1.ClusterProxy] = err | ||
| } | ||
| } | ||
| } else { | ||
| log.Info(messages.SkippingExternallyManaged, "component", backplanev1.ClusterProxyAddon) | ||
| log.Info(messages.SkippingExternallyManaged, "component", backplanev1.ClusterProxy) | ||
| } | ||
|
Comment on lines
+1288
to
1311
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Treat the proxy aliases as a single external-management decision. Using 🔧 Suggested fix- if !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxyAddon) ||
- !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxy) {
+ if !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxyAddon) &&
+ !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterProxy) {🤖 Prompt for AI Agents |
||
|
|
||
| if !r.isComponentExternallyManaged(backplaneConfig, backplanev1.ClusterAPI) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Enable service proxy to generate user-deployment and user-service | ||
| enableServiceProxy: true | ||
|
|
||
| # Number of replicas | ||
| replicas: 1 | ||
|
|
||
| # Image registry | ||
| registry: quay.io/open-cluster-management | ||
| image: cluster-proxy | ||
| tag: | ||
|
|
||
| # Enable kube-api-proxy | ||
| enableKubeApiProxy: true | ||
|
|
||
| # Enable impersonation | ||
| enableImpersonation: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v2 | ||
| appVersion: 1.1.0 | ||
| description: A Helm chart for Cluster-Proxy OCM Addon | ||
| name: cluster-proxy | ||
| type: application | ||
| version: '5.0' |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,108 @@ | ||||||||||
| apiVersion: apps/v1 | ||||||||||
| kind: Deployment | ||||||||||
| metadata: | ||||||||||
| labels: | ||||||||||
| component: cluster-proxy-manager | ||||||||||
| name: cluster-proxy-addon-manager | ||||||||||
| spec: | ||||||||||
| replicas: 1 | ||||||||||
| selector: | ||||||||||
| matchLabels: | ||||||||||
| component: cluster-proxy-manager | ||||||||||
| open-cluster-management.io/addon: cluster-proxy | ||||||||||
| template: | ||||||||||
| metadata: | ||||||||||
| labels: | ||||||||||
| component: cluster-proxy-manager | ||||||||||
| ocm-antiaffinity-selector: cluster-proxy-addon-manager | ||||||||||
| open-cluster-management.io/addon: cluster-proxy | ||||||||||
| spec: | ||||||||||
| affinity: | ||||||||||
| podAntiAffinity: | ||||||||||
| preferredDuringSchedulingIgnoredDuringExecution: | ||||||||||
| - podAffinityTerm: | ||||||||||
| labelSelector: | ||||||||||
| matchExpressions: | ||||||||||
| - key: ocm-antiaffinity-selector | ||||||||||
| operator: In | ||||||||||
| values: | ||||||||||
| - cluster-proxy-addon-manager | ||||||||||
| topologyKey: topology.kubernetes.io/zone | ||||||||||
| weight: 70 | ||||||||||
| - podAffinityTerm: | ||||||||||
| labelSelector: | ||||||||||
| matchExpressions: | ||||||||||
| - key: ocm-antiaffinity-selector | ||||||||||
| operator: In | ||||||||||
| values: | ||||||||||
| - cluster-proxy-addon-manager | ||||||||||
| topologyKey: kubernetes.io/hostname | ||||||||||
| weight: 35 | ||||||||||
| containers: | ||||||||||
| - args: | ||||||||||
| - --leader-elect=true | ||||||||||
| - --signer-secret-namespace={{ .Values.global.namespace }} | ||||||||||
| - --enable-kube-api-proxy=true | ||||||||||
| - --enable-service-proxy=true | ||||||||||
| - --image-pull-policy=IfNotPresent | ||||||||||
| - --feature-gates=ClusterProfile=false | ||||||||||
| command: | ||||||||||
| - /manager | ||||||||||
| env: | ||||||||||
| {{- if .Values.global.pullSecret }} | ||||||||||
| - name: AGENT_IMAGE_PULL_SECRET | ||||||||||
| value: {{ .Values.global.pullSecret }} | ||||||||||
| {{- end }} | ||||||||||
| {{- if .Values.hubconfig.proxyConfigs }} | ||||||||||
| - name: HTTP_PROXY | ||||||||||
| value: {{ .Values.hubconfig.proxyConfigs.HTTP_PROXY }} | ||||||||||
| - name: HTTPS_PROXY | ||||||||||
| value: {{ .Values.hubconfig.proxyConfigs.HTTPS_PROXY }} | ||||||||||
| - name: NO_PROXY | ||||||||||
| value: {{ .Values.hubconfig.proxyConfigs.NO_PROXY }} | ||||||||||
| {{- end }} | ||||||||||
| - name: POD_NAMESPACE | ||||||||||
| valueFrom: | ||||||||||
| fieldRef: | ||||||||||
| fieldPath: metadata.namespace | ||||||||||
| image: '{{ .Values.global.imageOverrides.cluster_proxy }}' | ||||||||||
| imagePullPolicy: '{{ .Values.global.pullPolicy }}' | ||||||||||
|
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't template
🛠️ Suggested fix- imagePullPolicy: '{{ .Values.global.pullPolicy }}'
+ imagePullPolicy: '{{ default "IfNotPresent" .Values.global.pullPolicy }}'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| name: manager | ||||||||||
| securityContext: | ||||||||||
| allowPrivilegeEscalation: false | ||||||||||
| capabilities: | ||||||||||
| drop: | ||||||||||
| - ALL | ||||||||||
| privileged: false | ||||||||||
| readOnlyRootFilesystem: true | ||||||||||
| runAsNonRoot: true | ||||||||||
| hostIPC: false | ||||||||||
| hostNetwork: false | ||||||||||
| hostPID: false | ||||||||||
| {{- if .Values.global.pullSecret }} | ||||||||||
| imagePullSecrets: | ||||||||||
| - name: {{ .Values.global.pullSecret }} | ||||||||||
| {{- end }} | ||||||||||
| {{- with .Values.hubconfig.nodeSelector }} | ||||||||||
| nodeSelector: | ||||||||||
| {{ toYaml . | indent 8 }} | ||||||||||
| {{- end }} | ||||||||||
| securityContext: | ||||||||||
| runAsNonRoot: true | ||||||||||
| {{- if .Values.global.deployOnOCP }} | ||||||||||
| {{- if semverCompare ">=4.11.0" .Values.hubconfig.ocpVersion }} | ||||||||||
| seccompProfile: | ||||||||||
| type: RuntimeDefault | ||||||||||
| {{- end }} | ||||||||||
| {{- end }} | ||||||||||
| serviceAccount: cluster-proxy | ||||||||||
| {{- with .Values.hubconfig.tolerations }} | ||||||||||
| tolerations: | ||||||||||
| {{- range . }} | ||||||||||
| - {{ if .Key }} key: {{ .Key }} {{- end }} | ||||||||||
| {{ if .Operator }} operator: {{ .Operator }} {{- end }} | ||||||||||
| {{ if .Value }} value: {{ .Value }} {{- end }} | ||||||||||
| {{ if .Effect }} effect: {{ .Effect }} {{- end }} | ||||||||||
| {{ if .TolerationSeconds }} tolerationSeconds: {{ .TolerationSeconds }} {{- end }} | ||||||||||
| {{- end }} | ||||||||||
| {{- end }} | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Register
cluster-proxyas a valid component.Adding the constant/CRD dir isn't enough on its own:
ClusterProxystill isn't present inAllComponentsorMCEComponents, so validation and any component-gated logic will continue to reject it. IfClusterProxyAddonmust remain for compatibility, keep both entries.🛠️ Suggested fix
var AllComponents = []string{ AssistedService, ClusterAPI, ClusterAPIPreview, ClusterAPIProviderAWS, ClusterAPIProviderAWSPreview, // ClusterAPIProviderAzure, Uncomment until stable release is available ClusterAPIProviderAzurePreview, ClusterAPIProviderMetal, ClusterAPIProviderMetalPreview, ClusterAPIProviderOAPreview, ClusterAPIProviderOA, ClusterLifecycle, ClusterManager, ClusterPermission, ClusterProxyAddon, + ClusterProxy, ConsoleMCE, Discovery, Hive, HyperShift, @@ var MCEComponents = []string{ AssistedService, ClusterAPI, ClusterAPIProviderAWS, // ClusterAPIProviderAzure, Uncomment until stable release is available ClusterAPIProviderAzurePreview, ClusterAPIProviderMetal, ClusterAPIProviderOA, ClusterLifecycle, ClusterManager, ClusterPermission, ClusterProxyAddon, + ClusterProxy, ConsoleMCE, Discovery, Hive, HyperShift,🤖 Prompt for AI Agents