A machine-readable index of this documentation for AI agents is available at https://kubevela.io/llms.txt. Markdown versions of documentation pages are available by appending .md to their URLs.
Skip to main content
Version: Cluster Gateway Next

API

Cluster Gateway serves the cluster.core.oam.dev/v1alpha1 API group through the APIService v1alpha1.cluster.core.oam.dev. Every resource is cluster-scoped and read-only: the gateway builds each object from a cluster Secret when it is read, and there is no create, update, delete or watch.

ResourceVerbsSubresources
clustergatewaysget, listproxy, health
virtualclustersget, listnone

ClusterGateway​

apiVersion: cluster.core.oam.dev/v1alpha1
kind: ClusterGateway
metadata:
name: member # the Secret's name
spec:
provider: ""
access:
endpoint:
type: Const # or ClusterProxy
const:
address: https://member.example.com:6443
caBundle: <base64 CA> # or insecure: true, when the Secret has no ca.crt
proxy-url: socks5://proxy:1080
credential:
type: ServiceAccountToken # or X509Certificate, or Dynamic
serviceAccountToken: <token>
x509:
certificate: <base64>
privateKey: <base64>
status:
healthy: false
healthyReason: ""
FieldFrom the Secret
spec.access.endpoint.typeThe cluster.core.oam.dev/cluster-endpoint-type label; Const when it's missing.
spec.access.endpoint.const.addressendpoint
spec.access.endpoint.const.caBundle, .insecureca.crt or ca; insecure: true when neither is there.
spec.access.endpoint.const.proxy-urlproxy-url
spec.access.credential.typeThe cluster.core.oam.dev/cluster-credential-type label. A Dynamic cluster always shows Dynamic, whatever its command printed.
spec.access.credential.serviceAccountToken, .x509token; tls.crt and tls.key; or the output of exec for Dynamic.
status.healthy, status.healthyReasonThe status.cluster.core.oam.dev/healthy and healthy-reason annotations, with HealthinessCheck on.

spec.provider is never set from a Secret.

The object includes the credential, so get on clustergateways is as sensitive as reading the Secret.

kubectl get clustergateways prints:

ColumnShows
PROVIDERspec.provider, so empty
CREDENTIAL-TYPEspec.access.credential.type
ENDPOINT-TYPEspec.access.endpoint.type
HEALTHYstatus.healthy: false unless something writes the health annotations

clustergateways/proxy​

/apis/cluster.core.oam.dev/v1alpha1/clustergateways/<cluster>/proxy/<path>

Any HTTP method. The request, from <path> on, is sent to the cluster's kube-apiserver with the cluster's credential, and the response is streamed back. Connection upgrades are passed through, so exec, attach, port-forward and watches work. On the hub, the call is authorized as the HTTP verb on clustergateways/proxy for that cluster's name. How the identity travels is in The Proxy Path.

clustergateways/health​

get returns the ClusterGateway; update with a status writes status.healthy and status.healthyReason back to the Secret's annotations. The gateway doesn't probe clusters: a controller such as the OCM addon writes the status, and status only shows it with the HealthinessCheck feature gate on.

VirtualCluster​

A plainer view of the same clusters, without credentials, for clients that only need to know what exists:

kubectl get virtualclusters
Field or columnWhat it shows
metadata.nameThe cluster's name. The hub itself is listed as local, unless the gateway runs with --virtual-clutser-with-control-plane=false.
spec.aliasThe cluster.core.oam.dev/cluster-alias annotation on the Secret.
spec.credential-typeThe credential type label; Internal for local, ManagedCluster for OCM clusters.
spec.endpointThe Secret's endpoint, or the cluster.core.oam.dev/cluster-endpoint-type label's value (such as ClusterProxy) whenever the Secret has that label; - for local. A Secret with neither is left out.
spec.acceptedWhether the cluster is accepted: always true for a Secret, and the hub's acceptance for an OCM ManagedCluster.
metadata.labelsThe Secret's labels, without the gateway's own (cluster.core.oam.dev/*), plus cluster.core.oam.dev/control-plane, true only for local.

list takes a label selector, so kubectl get virtualclusters -l region=eu lists the clusters whose Secret carries region=eu.

ClusterGatewayProxyConfiguration​

Not served by the API: it's the format of the file passed with --cluster-gateway-proxy-config, and of the per-cluster annotation. See Identity Exchange.

apiVersion: cluster.core.oam.dev/v1alpha1
kind: ClusterGatewayProxyConfiguration
spec:
clientIdentityExchanger:
rules:
- name: <rule name>
type: PrivilegedIdentityExchanger | StaticMappingIdentityExchanger
source: # every field given must match
user: <name>
group: <name>
uid: <uid>
cluster: <cluster>
userPattern: <regexp>
groupPattern: <regexp>
clusterPattern: <regexp>
target: # StaticMappingIdentityExchanger only
user: <name>
groups: [<name>]
uid: <uid>