Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Using ingress control for a MicroShift node
Use the ingress controller options in the MicroShift configuration file to make pods and services accessible outside the node.
5.1. Using ingress control in MicroShift Copiar enlaceEnlace copiado en el portapapeles!
When you create your MicroShift node, each pod and service running on the node is allocated an IP address. These IP addresses are accessible to other pods and services running nearby by default, but are not accessible to external clients. MicroShift uses a minimal implementation of the OpenShift Container Platform IngressController API to enable external access to node services.
With more configuration options, you can fine-tune ingress to meet your specific needs. To use enhanced ingress control, update the parameters in the MicroShift configuration file and restart the service. Ingress configuration is useful in a variety of ways, for example:
-
If your application starts processing requests from clients but the connection is closed before it can respond, you can set the
ingress.tuningOptions.serverTimeoutparameter in the configuration file to a higher value to accommodate the speed of the response from the server. -
If the router has many connections open because an application running on the cluster does not close connections properly, you can set the
ingress.tuningOptions.serverTimeoutandspec.tuningOptions.serverFinTimeoutparameters to a lower value, forcing those connections to close sooner.
5.2. Configuring ingress control in MicroShift Copiar enlaceEnlace copiado en el portapapeles!
To apply detailed ingress control such as timeouts, TLS, and logging in MicroShift, you can update the config.yaml file or add a configuration snippet in the /etc/microshift/config.d/ directory. Replace the default values in the ingress section and restart the service.
Prerequisites
-
You installed the OpenShift CLI (
oc). - You have root access to the node.
- Your node uses the OVN-Kubernetes Container Network Interface (CNI) plugin.
Procedure
Apply ingress control settings in one of the two following ways:
Update the MicroShift
config.yamlconfiguration file by making a copy of the providedconfig.yaml.defaultfile in the/etc/microshift/directory, naming itconfig.yamland keeping it in the source directory.-
After you create it, the
config.yamlfile takes precedence over built-in settings. The configuration file is read every time the MicroShift service starts.
-
After you create it, the
Use a configuration snippet to apply the ingress control settings you want. To do this, create a configuration snippet YAML file and put it in the
/etc/microshift/config.d/configuration directory.-
Configuration snippet YAMLs take precedence over both built-in settings and a
config.yamlconfiguration file. See the Additional resources links for more information.
-
Configuration snippet YAMLs take precedence over both built-in settings and a
Replace the default values in the
networksection of the MicroShift YAML with your valid values, or create a configuration snippet file with the sections you need.Ingress controller configuration fields with default values
apiServer: # ... ingress: defaultHTTPVersion: 1 forwardedHeaderPolicy: Append httpCompression: mimeTypes: - "" httpEmptyRequestsPolicy: Respond # ... logEmptyRequests: Log # ... tuningOptions: clientFinTimeout: 1s clientTimeout: 30s headerBufferBytes: 0 headerBufferMaxRewriteBytes: 0 healthCheckInterval: 5s maxConnections: 0 serverFinTimeout: 1s serverTimeout: 30s threadCount: 4 tlsInspectDelay: 5s tunnelTimeout: 1h # ...See "Ingress controller configuration fields in MicroShift" for more information about each field.
Complete any other configurations you require, then start or restart MicroShift by running one the following commands:
$ sudo systemctl start microshift$ sudo systemctl restart microshift
Verification
After making ingress configuration changes and restarting MicroShift, you can check the age of the router pod to ensure that changes have been applied.
To check the status of the router pod, run the following command:
$ oc get pods -n openshift-ingressExample output
NAME READY STATUS RESTARTS AGE router-default-8649b5bf65-w29cn 1/1 Running 0 6m10s
5.2.1. Ingress controller configuration fields in MicroShift Copiar enlaceEnlace copiado en el portapapeles!
The following table lists and defines the ingress controller configuration parameters in the MicroShift config.yaml file. You use these parameters when you configure access logging, TLS, timeouts, route admission, and other ingress options.
| Parameter | Description |
|---|---|
|
|
Sets the HTTP version for the ingress controller. Default value is |
|
|
Specifies when and how the ingress controller sets the
|
|
| Defines the policy for HTTP traffic compression.
|
|
|
Describes how HTTP connections are handled if the connection times out before a request is received. Allowed values for this field are
Usually, empty request connections come from load balancer health probes or web browser preconnects and can be safely ignored. However, network errors and port scans can also create these empty requests, so setting this field to |
|
|
Specifies connections for which no request is received and logged. Usually, these empty requests come from load balancer health probes or web browser speculative connections such as preconnects. Logging these types of empty requests can be undesirable. However, network errors and port scans can also create empty requests, so setting this field to The following are valid values:
|
|
| Specifies options for tuning the performance of ingress controller pods.
|