Class GRPCRouteRule

  • All Implemented Interfaces:
    io.fabric8.kubernetes.api.builder.Editable<GRPCRouteRuleBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource, Serializable

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class GRPCRouteRule
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<GRPCRouteRuleBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    GRPCRouteRule defines the semantics for matching a gRPC request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
    See Also:
    Serialized Form
    • Method Detail

      • getBackendRefs

        public List<GRPCBackendRef> getBackendRefs()
        BackendRefs defines the backend(s) where matching requests should be sent.


        Failure behavior here depends on how many BackendRefs are specified and how many are invalid.


        If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive an `UNAVAILABLE` status.


        See the GRPCBackendRef definition for the rules about what makes a single GRPCBackendRef invalid.


        When a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive an `UNAVAILABLE` status.


        For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status. Implementations may choose how that 50 percent is determined.


        Support: Core for Kubernetes Service


        Support: Implementation-specific for any other resource


        Support for weight: Core

      • setBackendRefs

        public void setBackendRefs​(List<GRPCBackendRef> backendRefs)
        BackendRefs defines the backend(s) where matching requests should be sent.


        Failure behavior here depends on how many BackendRefs are specified and how many are invalid.


        If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive an `UNAVAILABLE` status.


        See the GRPCBackendRef definition for the rules about what makes a single GRPCBackendRef invalid.


        When a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive an `UNAVAILABLE` status.


        For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status. Implementations may choose how that 50 percent is determined.


        Support: Core for Kubernetes Service


        Support: Implementation-specific for any other resource


        Support for weight: Core

      • getFilters

        public List<GRPCRouteFilter> getFilters()
        Filters define the filters that are applied to requests that match this rule.


        The effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage.


        Conformance-levels at this level are defined based on the type of filter:


        - ALL core filters MUST be supported by all implementations that support

        GRPCRoute.

        - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across

        implementations.


        Specifying the same filter multiple times is not supported unless explicitly indicated in the filter.


        If an implementation can not support a combination of filters, it must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error.


        Support: Core

      • setFilters

        public void setFilters​(List<GRPCRouteFilter> filters)
        Filters define the filters that are applied to requests that match this rule.


        The effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage.


        Conformance-levels at this level are defined based on the type of filter:


        - ALL core filters MUST be supported by all implementations that support

        GRPCRoute.

        - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across

        implementations.


        Specifying the same filter multiple times is not supported unless explicitly indicated in the filter.


        If an implementation can not support a combination of filters, it must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error.


        Support: Core

      • getMatches

        public List<GRPCRouteMatch> getMatches()
        Matches define conditions used for matching the rule against incoming gRPC requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied.


        For example, take the following matches configuration:


        ``` matches: - method:

        service: foo.bar

        headers:

        values:

        version: 2

        - method:

        service: foo.bar.v2

        ```


        For a request to match against this rule, it MUST satisfy EITHER of the two conditions:


        - service of foo.bar AND contains the header `version: 2` - service of foo.bar.v2


        See the documentation for GRPCRouteMatch on how to specify multiple match conditions to be ANDed together.


        If no matches are specified, the implementation MUST match every gRPC request.


        Proxy or Load Balancer routing configuration generated from GRPCRoutes MUST prioritize rules based on the following criteria, continuing on ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes. Precedence MUST be given to the rule with the largest number of:


        * Characters in a matching non-wildcard hostname. * Characters in a matching hostname. * Characters in a matching service. * Characters in a matching method. * Header matches.


        If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties:


        * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by

        "{namespace}/{name}".


        If ties still exist within the Route that has been given precedence, matching precedence MUST be granted to the first matching rule meeting the above criteria.

      • setMatches

        public void setMatches​(List<GRPCRouteMatch> matches)
        Matches define conditions used for matching the rule against incoming gRPC requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied.


        For example, take the following matches configuration:


        ``` matches: - method:

        service: foo.bar

        headers:

        values:

        version: 2

        - method:

        service: foo.bar.v2

        ```


        For a request to match against this rule, it MUST satisfy EITHER of the two conditions:


        - service of foo.bar AND contains the header `version: 2` - service of foo.bar.v2


        See the documentation for GRPCRouteMatch on how to specify multiple match conditions to be ANDed together.


        If no matches are specified, the implementation MUST match every gRPC request.


        Proxy or Load Balancer routing configuration generated from GRPCRoutes MUST prioritize rules based on the following criteria, continuing on ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes. Precedence MUST be given to the rule with the largest number of:


        * Characters in a matching non-wildcard hostname. * Characters in a matching hostname. * Characters in a matching service. * Characters in a matching method. * Header matches.


        If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties:


        * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by

        "{namespace}/{name}".


        If ties still exist within the Route that has been given precedence, matching precedence MUST be granted to the first matching rule meeting the above criteria.

      • getName

        public String getName()
        Name is the name of the route rule. This name MUST be unique within a Route if it is set.


        Support: Extended <gateway:experimental>

      • setName

        public void setName​(String name)
        Name is the name of the route rule. This name MUST be unique within a Route if it is set.


        Support: Extended <gateway:experimental>

      • getSessionPersistence

        public SessionPersistence getSessionPersistence()
        GRPCRouteRule defines the semantics for matching a gRPC request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
      • setSessionPersistence

        public void setSessionPersistence​(SessionPersistence sessionPersistence)
        GRPCRouteRule defines the semantics for matching a gRPC request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)