Skip to content

Commit d4abdae

Browse files
authored
Merge pull request #68465 from ShaunaDiaz/OSDOCS-8836
OSDOCS-8836: bug fix add Service field to proxy config
2 parents d67a0fa + 4d90785 commit d4abdae

File tree

2 files changed

+42
-5
lines changed

2 files changed

+42
-5
lines changed

modules/microshift-cri-o-container-runtime.adoc

+38-2
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,31 @@
66
[id="microshift-CRI-O-container-engine_{context}"]
77
= Using a proxy in the CRI-O container runtime
88

9-
To use an HTTP(S) proxy in `CRI-O`, you need to set the `HTTP_PROXY` and `HTTPS_PROXY` environment variables. You can also set the `NO_PROXY` variable to exclude a list of hosts from being proxied.
9+
To use an HTTP(S) proxy in `CRI-O`, you must add a `Service` section to the configuration file and set the `HTTP_PROXY` and `HTTPS_PROXY` environment variables. You can also set the `NO_PROXY` variable to exclude a list of hosts from being proxied.
1010

1111
.Procedure
1212

13+
. Create the directory for the configuration file if it does not exist:
14+
+
15+
[source,terminal]
16+
----
17+
$ sudo mkdir /etc/systemd/system/crio.service.d/
18+
----
19+
1320
. Add the following settings to the `/etc/systemd/system/crio.service.d/00-proxy.conf` file:
1421
+
1522
[source,config]
1623
----
24+
[Service]
1725
Environment=NO_PROXY="localhost,127.0.0.1"
1826
Environment=HTTP_PROXY="http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_PORT/"
1927
Environment=HTTPS_PROXY="http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_PORT/"
2028
----
29+
+
30+
[IMPORTANT]
31+
====
32+
You must define the `Service` section of the configuration file for the environment variables or the proxy settings fail to apply.
33+
====
2134

2235
. Reload the configuration settings:
2336
+
@@ -26,9 +39,32 @@ Environment=HTTPS_PROXY="http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY
2639
$ sudo systemctl daemon-reload
2740
----
2841

29-
. Restart the CRI-O service to apply the settings:
42+
. Restart the CRI-O service:
3043
+
3144
[source,terminal]
3245
----
3346
$ sudo systemctl restart crio
3447
----
48+
49+
. Restart the {microshift-short} service to apply the settings:
50+
+
51+
[source,terminal]
52+
----
53+
$ sudo systemctl restart microshift
54+
----
55+
56+
.Verification
57+
58+
. Verify that pods are started by running the following command and examining the output:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc get all -A
63+
----
64+
65+
. Verify that {microshift-short} is able to pull container images by running the following command and examining the output:
66+
+
67+
[source,terminal]
68+
----
69+
$ sudo crictl images
70+
----

modules/microshift-rpm-ostree-https.adoc

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
[id="microshift-rpm-ostree-https_{context}"]
77
= Using the RPM-OStree HTTP(S) proxy
88

9-
To use the HTTP(S) proxy in RPM-OStree, set the `http_proxy environment` variable for the `rpm-ostreed` service.
9+
To use the HTTP(S) proxy in RPM-OStree, you must add a `Service` section to the configuration file and set the `http_proxy environment` variable for the `rpm-ostreed` service.
1010

1111
.Procedure
1212

13-
. Add this setting to the `/etc/systemd/system/rpm-ostreed.service.d/00-proxy.conf` file by running the following command:
13+
. Add this setting to the `/etc/systemd/system/rpm-ostreed.service.d/00-proxy.conf` file:
1414
+
1515
[source,terminal]
1616
----
17+
[Service]
1718
Environment="http_proxy=http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_PORT/"
1819
----
1920

@@ -25,7 +26,7 @@ Environment="http_proxy=http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_
2526
----
2627
$ sudo systemctl daemon-reload
2728
----
28-
.. Restart the rpm-ostree service by running the following command:
29+
.. Restart the `rpm-ostreed` service by running the following command:
2930
+
3031
[source,terminal]
3132
----

0 commit comments

Comments
 (0)