Skip to main content
Version: Next

Kubernetes Controller Config

This article introduces Kubernetes Controller configuration.

Enable HTTPS

To enable HTTPS, you need to configure the sni protocol in the application.yml file of the gateway:

shenyu:
netty:
http:
sni:
enabled: true
mod: k8s #k8s mode applies
defaultK8sSecretNamespace: shenyu-ingress #The namespace of the default secret resource
defaultK8sSecretName: default-cert #default secret resource name

Among them, the default secret resource must be available, but it will not be actually used at present.

Ingress configuration

ShenYu Kubernetes Controller implements the K8s native Ingress standard, see K8s official documentation for the use of the native standard

In addition, Apache ShenYu has expanded based on the Annotation field of Ingress, and the configuration is shown in the following tables:

General

| Name | Default | Required | Description | | --------------------------- | ------ | -------- | ----- --- | | kubernetes.io/ingress.class | | Yes | Fill in shenyu |

Divide plugin (HTTP proxy)

| Name | Default | Required | Description | | ------------------------------------- | ------ | ------- - | ------------------------------------------------ ------------ | | shenyu.apache.org/loadbalancer | random | No | Load balancing algorithm, optional hash, random, roundRobin, leastActive, p2c, shortestResponse | | shenyu.apache.org/retry | 3 | No | Number of failed retries | | shenyu.apache.org/timeout | 3000 | No | Backend request timeout, in milliseconds | | shenyu.apache.org/header-max-size | 10240 | No | The maximum size of the request header, unit byte | | shenyu.apache.org/request-max-size | 102400 | No | Maximum request body size, unit byte |

Dubbo plugin

NameDefaultRequired or notDescription
shenyu.apache.org/loadbalancerrandomNoLoad balancing algorithm, optional hash, random, roundRobin, lastActive, p2c, shortestResponse
shenyu.apache.org/retry3NoNumber of failed retries
shenyu.apache.org/timeout3000noBackend request timeout in milliseconds
shenyu.apache.org/header-max-size10240NoMaximum request header size in bytes
shenyu.apache.org/request-max-size102400NoMaximum request body size in bytes
shenyu.apache.org/upstreams-protocoldubbo://NoSpecify the protocol protocol used by upstream
shenyu.apache.org/plugin-dubbo-enabledNoDetermines if the dubbo plugin is enabled
shenyu.apache.org/zookeeper-register-addressYesSpecify zookeeper address
shenyu.apache.org/plugin-dubbo-app-nameYesSpecify the metadata application name
shenyu.apache.org/plugin-dubbo-pathYesSpecify the request path for metadata
shenyu.apache.org/plugin-dubbo-rpc-typeYesSpecify the rpc type for metadata (dubbo, sofa, tars, springCloud, motan, grpc)
shenyu.apache.org/plugin-dubbo-service-nameYesSpecify the interface name for the metadata
shenyu.apache.org/plugin-dubbo-method-nameYesSpecifies the method name for metadata
shenyu.apache.org/plugin-dubbo-rpc-expandNoSpecifies the rpc expansion parameter (json object) for the metadata
shenyu.apache.org/plugin-dubbo-parameter-typesYesSpecify parameter types for metadata

Motan plugin

NameDefaultRequired or notDescription
shenyu.apache.org/loadbalancerrandomNoLoad balancing algorithm, optional hash, random, roundRobin, lastActive, p2c, shortestResponse
shenyu.apache.org/retry3NoNumber of failed retries
shenyu.apache.org/timeout3000NoBack-end request timeout in milliseconds
shenyu.apache.org/header-max-size10240NoMaximum request header size in bytes
shenyu.apache.org/request-max-size102400NoMaximum request body size in bytes
shenyu.apache.org/plugin-motan-enabledNoYesDetermines if the motan plugin is enabled
shenyu.apache.org/zookeeper-register-addressYesSpecify zookeeper address
shenyu.apache.org/plugin-motan-app-nameYesSpecify the metadata application name
shenyu.apache.org/plugin-motan-pathYesSpecify the request path for metadata
shenyu.apache.org/plugin-motan-rpc-typeYesSpecify the rpc type for metadata (dubbo, sofa, tars, springCloud, motan, grpc)
shenyu.apache.org/plugin-motan-service-nameYesSpecify the interface name for the metadata
shenyu.apache.org/plugin-motan-method-nameYesSpecifies the method name for metadata
shenyu.apache.org/plugin-motan-rpc-expandNoSpecifies the rpc extension parameter (json object) for the metadata
shenyu.apache.org/plugin-motan-parameter-typesYesSpecify parameter types for metadata

SpringCloud plugin

NameDefaultRequired or notDescription
shenyu.apache.org/loadbalancerrandomNoLoad balancing algorithm, optional hash, random, roundRobin, lastActive, p2c, shortestResponse
shenyu.apache.org/retry3NoNumber of failed retries
shenyu.apache.org/timeout3000NoBackend request timeout in milliseconds
shenyu.apache.org/header-max-size10240NoMaximum request header size in bytes
shenyu.apache.org/request-max-size102400NoMaximum request body size in bytes
shenyu.apache.org/plugin-spring-cloud-enabledYesDetermines whether to start the springCloud plugin
shenyu.apache.org/zookeeper-register-addressYesSpecify the zookeeper address
shenyu.apache.org/plugin-spring-cloud-app-nameYesSpecify the metadata application name
shenyu.apache.org/plugin-spring-cloud-pathYesSpecify the request path for metadata
shenyu.apache.org/plugin-spring-cloud-rpc-typeYesSpecify the rpc type (dubbo, sofa, tars, springCloud, motan, grpc) of the metadata
shenyu.apache.org/plugin-spring-cloud-service-nameYesSpecify the interface name for metadata
shenyu.apache.org/plugin-spring-cloud-method-nameYesSpecifies the method name for metadata
shenyu.apache.org/plugin-spring-cloud-rpc-expandNoSpecifies the rpc extension parameter (json object) for the metadata
shenyu.apache.org/plugin-spring-cloud-parameter-typesYesSpecify parameter types for metadata

WebSocket plugin

NameDefaultRequired or notDescription
shenyu.apache.org/loadbalancerrandomNoLoad balancing algorithm, optional hash, random, roundRobin, lastActive, p2c, shortestResponse
shenyu.apache.org/retry3NoNumber of failed retries
shenyu.apache.org/timeout3000NoBack-end request timeout in milliseconds
shenyu.apache.org/header-max-size10240NoMaximum request header size in bytes
shenyu.apache.org/request-max-size102400NoMaximum size of request body in byte