1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/microshift-cri-o-container-runtime.adoc
2024-02-19 13:07:28 +00:00

71 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * microshift_networking/microshift-networking.adoc
:_mod-docs-content-type: PROCEDURE
[id="microshift-CRI-O-container-engine_{context}"]
= Using a proxy in the CRI-O container runtime
To use an HTTP or HTTPS 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.
.Procedure
. Create the directory for the configuration file if it does not exist:
+
[source,terminal]
----
$ sudo mkdir /etc/systemd/system/crio.service.d/
----
. Add the following settings to the `/etc/systemd/system/crio.service.d/00-proxy.conf` file:
+
[source,config]
----
[Service]
Environment=NO_PROXY="localhost,127.0.0.1"
Environment=HTTP_PROXY="http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_PORT/"
Environment=HTTPS_PROXY="http://$PROXY_USER:$PROXY_PASSWORD@$PROXY_SERVER:$PROXY_PORT/"
----
+
[IMPORTANT]
====
You must define the `Service` section of the configuration file for the environment variables or the proxy settings fail to apply.
====
. Reload the configuration settings:
+
[source,terminal]
----
$ sudo systemctl daemon-reload
----
. Restart the CRI-O service:
+
[source,terminal]
----
$ sudo systemctl restart crio
----
. Restart the {microshift-short} service to apply the settings:
+
[source,terminal]
----
$ sudo systemctl restart microshift
----
.Verification
. Verify that pods are started by running the following command and examining the output:
+
[source,terminal]
----
$ oc get all -A
----
. Verify that {microshift-short} is able to pull container images by running the following command and examining the output:
+
[source,terminal]
----
$ sudo crictl images
----