Kubernetes Clusters
Directory Structure
|-- k8s/
|-- k8s-clusters-1.yaml
|-- k8s-clusters-2.yaml
|-- ...
Each yaml file can contain one or more Kubernetes clusters.
Configuration Description
Parameter | Data Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the K8s cluster, also the unique identifier of the K8s cluster |
host | string | Yes | API address of the K8s cluster |
port | string | Yes | API port of the K8s cluster, e.g., 6443 |
token | string | Yes | API Token to access the K8s cluster |
ssl_verify | string | No | Whether to perform SSL verification, default is False |
connect_timeout | string | Yes | Connection timeout for the K8s cluster, default is 30 seconds |
read_timeout | string | Yes | Read timeout for information from the K8s cluster, default is 30 seconds |
send_timeout | string | Yes | Send timeout for information to the K8s cluster, default is 30 seconds |
Configuration Example
- name: k8s_cluster_name1
host: 192.168.1.2
port: 6443
ssl_verify: false
connect_timeout: 30
read_timeout: 30
send_timeout: 30
token: eyJhbGciOiJSUzI1NiIsImtpZCI6ImVPWmtTOExjbDNjTmxidEp1cERHWjBzbjd6eGstN2ExbUNKMDM0aWJHUDAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im9wZW5yZXN0eS1lZGdlLXNlY3JldCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJvcGVucmVzdHktZWRnZS1zZXJ2aWNlYWNjb3VudCIsImt1YmVybmV0xXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6Ijg5ODc4ZDI1LWNmNGUtNDY5NS05N2UyLWZlYzIxYmQ0YzkwMyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0Om9wZW5yZXN0eS1lZGdlLXNlcnZpY2VhY2NvdW50In0.iwwJPn-PYf0-cI6GG9iANqUHlbfWwjyHkB3XC7PdKqgrM98lLd9bvurY7v6p9PjaX18rc_HwZrmlHHyxy0O5iZ2-FVrog-0_e1XWWarpkdHf9hE8qpo6NsCWOWiJC3IUn2nla625vZxjtvngW6n07XYIv1kKUppquDvysHWLNhCJOc5vsd4Y5z4OOFH3XWsFlwyOEWscBjq0rDBZayPVvSUiwLRWkcnU6oVhpNcJdo74xqNQF4dksnmxr2es2JunKPV5AFi56_RZBD0ZC5UPElv25mIk4tgDKeamhwc_Y469qmfrI9O7LZB4aeJ62eNeWGLmO164E4GeCnLpW8_wIg
The above configuration defines
Usage Example
Update configuration to OpenResty Edge:
edge-config https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -l k8s -i /root/oredge-configs
Export configuration from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -E -l k8s
In the examples, -l k8s
is used to specify importing/exporting only Kubernetes cluster-related configurations.
Also note that for security reasons, the token will not be exported when exporting configurations.