-
Language:
English
-
Language:
English
Chapter 5. Networking
5.1. DNS configuration details
5.1.1. General DNS setup
The OpenShift cluster managed by CodeReady Containers uses 2 DNS domain names, crc.testing
and apps-crc.testing
. The crc.testing
domain is for core OpenShift services. The apps-crc.testing
domain is for accessing OpenShift applications deployed on the cluster.
For example, the OpenShift API server will be exposed as api.crc.testing
while the OpenShift console is accessed through console-openshift-console.apps-crc.testing
. These DNS domains are served by a dnsmasq
DNS container running inside the CodeReady Containers virtual machine.
Running crc setup
will adjust your system DNS configuration so that it can resolve these domains. Additional checks are done to verify DNS is properly configured when running crc start
.
5.1.2. Linux
On Linux, CodeReady Containers expects the following DNS configuration:
- CodeReady Containers expects NetworkManager to manage networking.
-
NetworkManager uses
dnsmasq
through the/etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf
configuration file. The configuration file for this
dnsmasq
instance is/etc/NetworkManager/dnsmasq.d/crc.conf
:server=/crc.testing/192.168.130.11 server=/apps-crc.testing/192.168.130.11
-
The NetworkManager
dnsmasq
instance forwards requests for thecrc.testing
andapps-crc.testing
domains to the192.168.130.11
DNS server.
-
The NetworkManager
5.1.3. macOS
On macOS, CodeReady Containers expects the following DNS configuration:
-
CodeReady Containers creates a
/etc/resolver/testing
file which instructs macOS to forward all DNS requests for thetesting
domain to the CodeReady Containers virtual machine. -
CodeReady Containers also adds an
api.crc.testing
entry to/etc/hosts
pointing at the VM IP address. Theoc
binary requires this entry. See OpenShift issue #23266 for more information.
5.2. Starting CodeReady Containers behind a proxy
Prerequisites
-
To use an existing
oc
binary on your host machine, export the.testing
domain as part of theno_proxy
environment variable. -
The embedded
oc
binary does not require manual settings. For more information about using the embeddedoc
binary, see Section 3.3.2, “Accessing the OpenShift cluster withoc
”.
Procedure
To start CodeReady Containers behind a proxy:
Define a proxy using the
http_proxy
andhttps_proxy
environment variables or using thecrc config set
command as follows:$ crc config set http-proxy http://example.proxy.com:<port> $ crc config set https-proxy http://example.proxy.com:<port> $ crc config set no-proxy <comma-separated-no-proxy-entries>
The
crc
binary will be able to use the defined proxy once set through environment variables or CodeReady Containers configuration.
- Proxy-related values set in the configuration for CodeReady Containers have priority over values set through environment variables.
- SOCKS proxies are not supported by OpenShift Container Platform.