Skip to content

Commit 3ffe1fb

Browse files
authored
Merge pull request #21079 from openshift-cherrypick-robot/cherry-pick-20591-to-enterprise-4.4
[enterprise-4.4] Add overriding proxy for OLM
2 parents 2c3e5e5 + 5ffb781 commit 3ffe1fb

File tree

2 files changed

+99
-1
lines changed

2 files changed

+99
-1
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/olm-adding-operators-to-cluster.adoc
4+
5+
[id="olm-overriding-proxy-settings_{context}"]
6+
= Overriding an Operator's proxy settings
7+
8+
If a cluster-wide egress proxy is configured, applications created from
9+
Operators using the Operator Lifecycle Manager (OLM) inherit the cluster-wide
10+
proxy settings on their Deployments and Pods. Cluster administrators can also
11+
override these proxy settings by configuring the Operator's Subscription.
12+
13+
.Prerequisites
14+
15+
- Access to an {product-title} cluster using an account with
16+
ifdef::openshift-enterprise,openshift-webscale,openshift-origin[]
17+
`cluster-admin` permissions.
18+
endif::[]
19+
ifdef::openshift-dedicated[]
20+
`dedicated-admins-cluster` permissions.
21+
endif::[]
22+
23+
.Procedure
24+
25+
. Navigate in the web console to the *Operators → OperatorHub* page.
26+
27+
. Select the Operator and click *Install*.
28+
29+
. On the *Create Operator Subscription* page, modify the Subscription object's
30+
YAML to include one or more of the following environment variables in the
31+
`spec` section:
32+
+
33+
--
34+
* `HTTP_PROXY`
35+
* `HTTPS_PROXY`
36+
* `NO_PROXY`
37+
--
38+
+
39+
For example:
40+
+
41+
.Subscription object with proxy setting overrides
42+
[source,yaml]
43+
----
44+
apiVersion: operators.coreos.com/v1alpha1
45+
kind: Subscription
46+
metadata:
47+
name: etcd-config-test
48+
namespace: openshift-operators
49+
spec:
50+
config:
51+
env:
52+
- name: HTTP_PROXY
53+
value: test_http
54+
- name: HTTPS_PROXY
55+
value: test_https
56+
- name: NO_PROXY
57+
value: test
58+
channel: clusterwide-alpha
59+
installPlanApproval: Automatic
60+
name: etcd
61+
source: community-operators
62+
sourceNamespace: openshift-marketplace
63+
startingCSV: etcdoperator.v0.9.4-clusterwide
64+
----
65+
+
66+
[NOTE]
67+
====
68+
These environment variables can also be unset using an empty value to remove any
69+
previously set cluster-wide or custom proxy settings.
70+
====
71+
+
72+
OLM handles these environment variables as a unit; if at least one of them is
73+
set, all three are considered overridden and the cluster-wide defaults are not
74+
used for the subscribed Operator's Deployments.
75+
76+
. Click *Subscribe* to make the Operator available to the selected namespaces.
77+
78+
. After the Operator's CSV appears in the relevant namespace, you can verify that
79+
custom proxy environment variables are set in the Deployment. For example, using
80+
the CLI:
81+
+
82+
----
83+
$ oc get deployment -n openshift-operators etcd-operator -o yaml | grep -i "PROXY" -A 2
84+
85+
- name: HTTP_PROXY
86+
value: test_http
87+
- name: HTTPS_PROXY
88+
value: test_https
89+
- name: NO_PROXY
90+
value: test
91+
image: quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21088a98b93838e284a6086b13917f96b0d9c
92+
...
93+
----

operators/olm-adding-operators-to-cluster.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include::modules/common-attributes.adoc[]
66
toc::[]
77

88
This guide walks cluster administrators through installing Operators to an
9-
{product-title} cluster.
9+
{product-title} cluster and subscribing Operators to namespaces.
1010

1111
include::modules/olm-installing-operators-from-operatorhub.adoc[leveloffset=+1]
1212
include::modules/olm-installing-from-operatorhub-using-web-console.adoc[leveloffset=+2]
@@ -15,4 +15,9 @@ include::modules/olm-installing-from-operatorhub-using-cli.adoc[leveloffset=+2]
1515
.Additional resources
1616

1717
* xref:../operators/understanding_olm/olm-understanding-operatorgroups.adoc#olm-operatorgroups-about_olm-understanding-operatorgroups[About OperatorGroups]
18+
19+
include::modules/olm-overriding-proxy-settings.adoc[leveloffset=+1]
20+
.Additional resources
21+
22+
* xref:../networking/enable-cluster-wide-proxy.adoc#enable-cluster-wide-proxy[Configuring the cluster-wide proxy]
1823
endif::[]

0 commit comments

Comments
 (0)