|
| 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 | +---- |
0 commit comments