-
Notifications
You must be signed in to change notification settings - Fork 527
MG-66: Update egress proxy behaviour for support-log-gather operator #1903
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
Open
praveencodes
wants to merge
2
commits into
openshift:master
Choose a base branch
from
praveencodes:MG-66
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,10 +120,6 @@ type MustGatherSpec struct { | |
| // +optional | ||
| AdditionalConfig *AdditionalConfig `json:"additionalConfig,omitempty"` | ||
|
|
||
| // This represents the proxy configuration to be used. If left empty it will default to the cluster-level proxy configuration. | ||
| // +optional | ||
| ProxyConfig ProxySpec `json:"proxyConfig,omitempty"` | ||
|
|
||
| // A time limit for gather command to complete a floating point number with a suffix: | ||
| // "s" for seconds, "m" for minutes, "h" for hours, or "d" for days. | ||
| // Will default to no time limit. | ||
|
|
@@ -240,21 +236,6 @@ type PersistentVolumeClaimReference struct { | |
| Name string `json:"name"` | ||
| } | ||
|
|
||
| // +k8s:openapi-gen=true | ||
| type ProxySpec struct { | ||
| // httpProxy is the URL of the proxy for HTTP requests. Empty means unset and will not result in an env var. | ||
| // +optional | ||
| HTTPProxy string `json:"httpProxy,omitempty"` | ||
|
|
||
| // httpsProxy is the URL of the proxy for HTTPS requests. Empty means unset and will not result in an env var. | ||
| // +optional | ||
| HTTPSProxy string `json:"httpsProxy,omitempty"` | ||
|
|
||
| // noProxy is the list of domains for which the proxy should not be used. Empty means unset and will not result in an env var. | ||
| // +optional | ||
| NoProxy string `json:"noProxy,omitempty"` | ||
| } | ||
|
|
||
| // MustGatherStatus defines the observed state of MustGather | ||
| type MustGatherStatus struct { | ||
| Status string `json:"status,omitempty"` | ||
|
|
@@ -397,7 +378,64 @@ None, as a day-2 operator dedicated OpenShift and Hosted Clusters are both treat | |
|
|
||
| #### Proxy clusters | ||
|
|
||
| `mustgather.spec.proxyConfig` if set by the user in the CR, will be propagated as pod environment variables to the gather and upload containers of the Job. The configuration set in the resource is given precedence over the cluster-wide proxy settings set on the cluster through `configv1.Proxy` object. Due to the nature of SOCKS proxy protocol and the HTTP "CONNECT" verb in most proxy servers used with OpenShift, the upload process using SFTP's TCP can essentially make a CONNECT request over netcat and intercept to upload the mustgather bundle even when on a airgapped proxy setup. | ||
| The operator inherits cluster-wide proxy settings from the `configv1.Proxy` object via environment variables propagated by OLM and passes them to the upload container of the Job. | ||
|
|
||
| For SFTP uploads through HTTP proxies (common in air-gapped OpenShift environments), the upload process uses an HTTP CONNECT proxy via netcat (`nc --proxy-type http`) as an SSH `ProxyCommand`. This allows SFTP traffic to tunnel through the configured HTTP proxy. | ||
|
|
||
| To customize proxy settings, a cluster administrator can override the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables through the OLM Subscription object. | ||
|
|
||
| ## Configuring egress proxy for Must Gather Operator | ||
|
|
||
| If a cluster wide egress proxy is configured on the OpenShift cluster, OLM automatically update all the operators' deployments with `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` environment variables. | ||
| Those variables are then propagated down to the must gather (operand) controllers by the must gather operator. | ||
|
Member
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. probably, a li'l confusing which "operand controllers" are being referred? |
||
|
|
||
| ### Trusted Certificate Authority | ||
|
|
||
| #### Running operator | ||
|
|
||
| Follow the instructions below to let Must Gather Operator trust a custom Certificate Authority (CA). The operator's OLM subscription has to be already created. | ||
|
Comment on lines
+387
to
+396
Member
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. I don't think we need a doc-style instructions in here, |
||
|
|
||
| 1. Create the configmap containing the CA bundle in `must-gather-operator` namespace. Run the following commands to [inject](https://docs.openshift.com/container-platform/4.12/networking/configuring-a-custom-pki.html#certificate-injection-using-operators_configuring-a-custom-pki) the CA bundle trusted by OpenShift into a configmap: | ||
|
|
||
| ```bash | ||
| oc -n must-gather-operator create configmap trusted-ca | ||
| oc -n must-gather-operator label cm trusted-ca config.openshift.io/inject-trusted-cabundle=true | ||
| ``` | ||
|
|
||
| 2. Consume the created configmap in Must Gather Operator's deployment by updating its subscription: | ||
|
|
||
| ```bash | ||
| oc -n must-gather-operator patch subscription <subscription_name> --type='merge' -p '{"spec":{"config":{"env":[{"name":"TRUSTED_CA_CONFIGMAP_NAME","value":"trusted-ca"}]}}}' | ||
| ``` | ||
|
|
||
| _Note_: Alternatively, you can also patch the `must-gather-operator` deployment in the `must-gather-operator` namespace. | ||
| `bash | ||
| oc set env deployment/must-gather-operator TRUSTED_CA_CONFIGMAP_NAME=trusted-ca | ||
| ` | ||
|
|
||
| 3. Wait for the operator deployment to finish the rollout and verify that CA bundle is added to the existing controller: | ||
|
|
||
| ```bash | ||
| oc get deployment -n must-gather-operator must-gather-operator -o=jsonpath={.spec.template.spec.'containers[0].volumeMounts'} | jq | ||
| [ | ||
| { | ||
| "mountPath": "/etc/pki/tls/certs/must-gather-tls-ca-bundle.crt", | ||
| "name": "trusted-ca", | ||
| "subPath": "ca-bundle.crt" | ||
| } | ||
| ] | ||
|
|
||
| oc get deployment -n must-gather-operator must-gather-operator -o=jsonpath={.spec.template.spec.volumes} | jq | ||
| [ | ||
| { | ||
| "configMap": { | ||
| "defaultMode": 420, | ||
| "name": "trusted-ca" | ||
| }, | ||
| "name": "trusted-ca" | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ## Implementation History | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's also mention that the cluster-wide proxy env vars are propagated/managed through OLM directly. If the user wishes to customise it, a cluster-admin can override the HTTP_PROXY, HTTPS_PROXY, NO_PROXY env vars through the OLM Subscription object.