Este conteúdo não está disponível no idioma selecionado.

Chapter 13. Ingress [networking.k8s.io/v1]


Description
Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
Type
object

13.1. Specification

PropertyTypeDescription

apiVersion

string

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

string

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadata

ObjectMeta

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

spec

object

IngressSpec describes the Ingress the user wishes to exist.

status

object

IngressStatus describe the current state of the Ingress.

13.1.1. .spec

Description
IngressSpec describes the Ingress the user wishes to exist.
Type
object
PropertyTypeDescription

defaultBackend

object

IngressBackend describes all endpoints for a given service and port.

ingressClassName

string

ingressClassName is the name of an IngressClass cluster resource. Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive connection (controller IngressClass Ingress resource). Although the kubernetes.io/ingress.class annotation (simple constant name) was never formally defined, it was widely supported by Ingress controllers to create a direct binding between Ingress controller and Ingress resources. Newly created Ingress resources should prefer using the field. However, even though the annotation is officially deprecated, for backwards compatibility reasons, ingress controllers should still honor that annotation if present.

rules

array

rules is a list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.

rules[]

object

IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.

tls

array

tls represents the TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.

tls[]

object

IngressTLS describes the transport layer security associated with an ingress.

13.1.2. .spec.defaultBackend

Description
IngressBackend describes all endpoints for a given service and port.
Type
object
PropertyTypeDescription

resource

TypedLocalObjectReference

resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. This is a mutually exclusive setting with "Service".

service

object

IngressServiceBackend references a Kubernetes Service as a Backend.

13.1.3. .spec.defaultBackend.service

Description
IngressServiceBackend references a Kubernetes Service as a Backend.
Type
object
Required
  • name
PropertyTypeDescription

name

string

name is the referenced service. The service must exist in the same namespace as the Ingress object.

port

object

ServiceBackendPort is the service port being referenced.

13.1.4. .spec.defaultBackend.service.port

Description
ServiceBackendPort is the service port being referenced.
Type
object
PropertyTypeDescription

name

string

name is the name of the port on the Service. This is a mutually exclusive setting with "Number".

number

integer

number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with "Name".

13.1.5. .spec.rules

Description
rules is a list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.
Type
array

13.1.6. .spec.rules[]

Description
IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.
Type
object
PropertyTypeDescription

host

string

host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in RFC 3986: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress. 2. The : delimiter is not respected because ports are not allowed. Currently the port of an Ingress is implicitly :80 for http and :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.

host can be "precise" which is a domain name without the terminating dot of a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. ".foo.com"). The wildcard character '' must appear by itself as the first DNS label and matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*"). Requests will be matched against the Host field in the following way: 1. If host is precise, the request matches this rule if the http host header is equal to Host. 2. If host is a wildcard, then the request matches this rule if the http host header is to equal to the suffix (removing the first label) of the wildcard rule.

http

object

HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://<host>/<path>?<searchpart> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.

13.1.7. .spec.rules[].http

Description
HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://<host>/<path>?<searchpart> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.
Type
object
Required
  • paths
PropertyTypeDescription

paths

array

paths is a collection of paths that map requests to backends.

paths[]

object

HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.

13.1.8. .spec.rules[].http.paths

Description
paths is a collection of paths that map requests to backends.
Type
array

13.1.9. .spec.rules[].http.paths[]

Description
HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.
Type
object
Required
  • pathType
  • backend
PropertyTypeDescription

backend

object

IngressBackend describes all endpoints for a given service and port.

path

string

path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional "path" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value "Exact" or "Prefix".

pathType

string

pathType determines the interpretation of the path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is done on a path element by element basis. A path element refers is the list of labels in the path split by the '/' separator. A request is a match for path p if every p is an element-wise prefix of p of the request path. Note that if the last element of the path is a substring of the last element in request path, it is not a match (e.g. /foo/bar matches /foo/bar/baz, but does not match /foo/barbaz). * ImplementationSpecific: Interpretation of the Path matching is up to the IngressClass. Implementations can treat this as a separate PathType or treat it identically to Prefix or Exact path types. Implementations are required to support all path types.

Possible enum values: - "Exact" matches the URL path exactly and with case sensitivity. - "ImplementationSpecific" matching is up to the IngressClass. Implementations can treat this as a separate PathType or treat it identically to Prefix or Exact path types. - "Prefix" matches based on a URL path prefix split by '/'. Matching is case sensitive and done on a path element by element basis. A path element refers to the list of labels in the path split by the '/' separator. A request is a match for path p if every p is an element-wise prefix of p of the request path. Note that if the last element of the path is a substring of the last element in request path, it is not a match (e.g. /foo/bar matches /foo/bar/baz, but does not match /foo/barbaz). If multiple matching paths exist in an Ingress spec, the longest matching path is given priority. Examples: - /foo/bar does not match requests to /foo/barbaz - /foo/bar matches request to /foo/bar and /foo/bar/baz - /foo and /foo/ both match requests to /foo and /foo/. If both paths are present in an Ingress spec, the longest matching path (/foo/) is given priority.

13.1.10. .spec.rules[].http.paths[].backend

Description
IngressBackend describes all endpoints for a given service and port.
Type
object
PropertyTypeDescription

resource

TypedLocalObjectReference

resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. This is a mutually exclusive setting with "Service".

service

object

IngressServiceBackend references a Kubernetes Service as a Backend.

13.1.11. .spec.rules[].http.paths[].backend.service

Description
IngressServiceBackend references a Kubernetes Service as a Backend.
Type
object
Required
  • name
PropertyTypeDescription

name

string

name is the referenced service. The service must exist in the same namespace as the Ingress object.

port

object

ServiceBackendPort is the service port being referenced.

13.1.12. .spec.rules[].http.paths[].backend.service.port

Description
ServiceBackendPort is the service port being referenced.
Type
object
PropertyTypeDescription

name

string

name is the name of the port on the Service. This is a mutually exclusive setting with "Number".

number

integer

number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with "Name".

13.1.13. .spec.tls

Description
tls represents the TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.
Type
array

13.1.14. .spec.tls[]

Description
IngressTLS describes the transport layer security associated with an ingress.
Type
object
PropertyTypeDescription

hosts

array (string)

hosts is a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.

secretName

string

secretName is the name of the secret used to terminate TLS traffic on port 443. Field is left optional to allow TLS routing based on SNI hostname alone. If the SNI host in a listener conflicts with the "Host" header field used by an IngressRule, the SNI host is used for termination and value of the "Host" header is used for routing.

13.1.15. .status

Description
IngressStatus describe the current state of the Ingress.
Type
object
PropertyTypeDescription

loadBalancer

object

IngressLoadBalancerStatus represents the status of a load-balancer.

13.1.16. .status.loadBalancer

Description
IngressLoadBalancerStatus represents the status of a load-balancer.
Type
object
PropertyTypeDescription

ingress

array

ingress is a list containing ingress points for the load-balancer.

ingress[]

object

IngressLoadBalancerIngress represents the status of a load-balancer ingress point.

13.1.17. .status.loadBalancer.ingress

Description
ingress is a list containing ingress points for the load-balancer.
Type
array

13.1.18. .status.loadBalancer.ingress[]

Description
IngressLoadBalancerIngress represents the status of a load-balancer ingress point.
Type
object
PropertyTypeDescription

hostname

string

hostname is set for load-balancer ingress points that are DNS based.

ip

string

ip is set for load-balancer ingress points that are IP based.

ports

array

ports provides information about the ports exposed by this LoadBalancer.

ports[]

object

IngressPortStatus represents the error condition of a service port

13.1.19. .status.loadBalancer.ingress[].ports

Description
ports provides information about the ports exposed by this LoadBalancer.
Type
array

13.1.20. .status.loadBalancer.ingress[].ports[]

Description
IngressPortStatus represents the error condition of a service port
Type
object
Required
  • port
  • protocol
PropertyTypeDescription

error

string

error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use CamelCase names - cloud provider specific error values must have names that comply with the format foo.example.com/CamelCase.

port

integer

port is the port number of the ingress port.

protocol

string

protocol is the protocol of the ingress port. The supported values are: "TCP", "UDP", "SCTP"

Possible enum values: - "SCTP" is the SCTP protocol. - "TCP" is the TCP protocol. - "UDP" is the UDP protocol.

13.2. API endpoints

The following API endpoints are available:

  • /apis/networking.k8s.io/v1/ingresses

    • GET: list or watch objects of kind Ingress
  • /apis/networking.k8s.io/v1/watch/ingresses

    • GET: watch individual changes to a list of Ingress. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses

    • DELETE: delete collection of Ingress
    • GET: list or watch objects of kind Ingress
    • POST: create an Ingress
  • /apis/networking.k8s.io/v1/watch/namespaces/{namespace}/ingresses

    • GET: watch individual changes to a list of Ingress. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}

    • DELETE: delete an Ingress
    • GET: read the specified Ingress
    • PATCH: partially update the specified Ingress
    • PUT: replace the specified Ingress
  • /apis/networking.k8s.io/v1/watch/namespaces/{namespace}/ingresses/{name}

    • GET: watch changes to an object of kind Ingress. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
  • /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status

    • GET: read status of the specified Ingress
    • PATCH: partially update status of the specified Ingress
    • PUT: replace status of the specified Ingress

13.2.1. /apis/networking.k8s.io/v1/ingresses

HTTP method
GET
Description
list or watch objects of kind Ingress
Table 13.1. HTTP responses
HTTP codeReponse body

200 - OK

IngressList schema

401 - Unauthorized

Empty

13.2.2. /apis/networking.k8s.io/v1/watch/ingresses

HTTP method
GET
Description
watch individual changes to a list of Ingress. deprecated: use the 'watch' parameter with a list operation instead.
Table 13.2. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

13.2.3. /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses

HTTP method
DELETE
Description
delete collection of Ingress
Table 13.3. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

Table 13.4. HTTP responses
HTTP codeReponse body

200 - OK

Status schema

401 - Unauthorized

Empty

HTTP method
GET
Description
list or watch objects of kind Ingress
Table 13.5. HTTP responses
HTTP codeReponse body

200 - OK

IngressList schema

401 - Unauthorized

Empty

HTTP method
POST
Description
create an Ingress
Table 13.6. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13.7. Body parameters
ParameterTypeDescription

body

Ingress schema

 
Table 13.8. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

201 - Created

Ingress schema

202 - Accepted

Ingress schema

401 - Unauthorized

Empty

13.2.4. /apis/networking.k8s.io/v1/watch/namespaces/{namespace}/ingresses

HTTP method
GET
Description
watch individual changes to a list of Ingress. deprecated: use the 'watch' parameter with a list operation instead.
Table 13.9. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

13.2.5. /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}

Table 13.10. Global path parameters
ParameterTypeDescription

name

string

name of the Ingress

HTTP method
DELETE
Description
delete an Ingress
Table 13.11. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

Table 13.12. HTTP responses
HTTP codeReponse body

200 - OK

Status schema

202 - Accepted

Status schema

401 - Unauthorized

Empty

HTTP method
GET
Description
read the specified Ingress
Table 13.13. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update the specified Ingress
Table 13.14. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13.15. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

201 - Created

Ingress schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace the specified Ingress
Table 13.16. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13.17. Body parameters
ParameterTypeDescription

body

Ingress schema

 
Table 13.18. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

201 - Created

Ingress schema

401 - Unauthorized

Empty

13.2.6. /apis/networking.k8s.io/v1/watch/namespaces/{namespace}/ingresses/{name}

Table 13.19. Global path parameters
ParameterTypeDescription

name

string

name of the Ingress

HTTP method
GET
Description
watch changes to an object of kind Ingress. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
Table 13.20. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

13.2.7. /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status

Table 13.21. Global path parameters
ParameterTypeDescription

name

string

name of the Ingress

HTTP method
GET
Description
read status of the specified Ingress
Table 13.22. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update status of the specified Ingress
Table 13.23. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13.24. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

201 - Created

Ingress schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace status of the specified Ingress
Table 13.25. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13.26. Body parameters
ParameterTypeDescription

body

Ingress schema

 
Table 13.27. HTTP responses
HTTP codeReponse body

200 - OK

Ingress schema

201 - Created

Ingress schema

401 - Unauthorized

Empty

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.