This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Este contenido no está disponible en el idioma seleccionado.
Chapter 11. Configuring the cluster-wide proxy
Production environments can deny direct access to the Internet and instead have an HTTP or HTTPS proxy available. You can configure OpenShift Container Platform to use a proxy by modifying the Proxy object for existing clusters or by configuring the proxy settings in the install-config.yaml
file for new clusters.
The cluster-wide proxy is only supported if you used a user-provisioned infrastructure installation for a supported provider.
Prerequisites
Review the sites that your cluster requires access to and determine whether any of them must bypass the proxy. By default, all cluster egress traffic is proxied, including calls to the cloud provider API for the cloud that hosts your cluster. Add sites to the Proxy object’s
spec.noProxy
field to bypass the proxy if necessary.NoteThe Proxy object’s
status.noProxy
field is populated by default with the instance metadata endpoint (169.254.169.254
) and with the values of thenetworking.machineCIDR
,networking.clusterNetwork.cidr
, andnetworking.serviceNetwork
fields from your installation configuration.
11.1. Enabling the cluster-wide proxy Copiar enlaceEnlace copiado en el portapapeles!
The Proxy object is used to manage the cluster-wide egress proxy. When a cluster is installed or upgraded without the proxy configured, a Proxy object is still generated but it will have a nil spec
. For example:
A cluster administrator can configure the proxy for OpenShift Container Platform by modifying this cluster
Proxy object.
Only the Proxy object named cluster
is supported, and no additional proxies can be created.
Prerequisites
- Cluster administrator permissions
-
OpenShift Container Platform
oc
CLI tool installed
Procedure
Create a ConfigMap that contains any additional CA certificates required for proxying HTTPS connections.
NoteYou can skip this step if the proxy’s identity certificate is signed by an authority from the RHCOS trust bundle.
Create a file called
user-ca-bundle.yaml
with the following contents, and provide the values of your PEM-encoded certificates:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the ConfigMap from this file:
oc create -f user-ca-bundle.yaml
$ oc create -f user-ca-bundle.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Use the
oc edit
command to modify the Proxy object:oc edit proxy/cluster
$ oc edit proxy/cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the necessary fields for the proxy:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- A proxy URL to use for creating HTTP connections outside the cluster. The URL scheme must be
http
. - 2
- A proxy URL to use for creating HTTPS connections outside the cluster. If this is not specified, then
httpProxy
is used for both HTTP and HTTPS connections. The URL scheme must behttp
;https
is currently not supported. - 3
- A comma-separated list of destination domain names, domains, IP addresses or other network CIDRs to exclude proxying. Preface a domain with
.
to include all subdomains of that domain. Use*
to bypass proxy for all destinations. Note that if you scale up workers not included innetworking.machineCIDR
from the installation configuration, you must add them to this list to prevent connection issues. - 4
- One or more URLs external to the cluster to use to perform a readiness check before writing the
httpProxy
andhttpsProxy
values to status. - 5
- A reference to the ConfigMap in the
openshift-config
namespace that contains additional CA certificates required for proxying HTTPS connections. Note that the ConfigMap must already exist before referencing it here. This field is required unless the proxy’s identity certificate is signed by an authority from the RHCOS trust bundle.
- Save the file to apply the changes.
11.2. Removing the cluster-wide proxy Copiar enlaceEnlace copiado en el portapapeles!
The cluster
Proxy object cannot be deleted. To remove the proxy from a cluster, remove all spec
fields from the Proxy object.
Prerequisites
- Cluster administrator permissions
-
OpenShift Container Platform
oc
CLI tool installed
Procedure
Use the
oc edit
command to modify the proxy:oc edit proxy/cluster
$ oc edit proxy/cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove all
spec
fields from the Proxy object. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file to apply the changes.