Retrieve Kube Config (Ingress)
If ingress endpoint is configured for the virtual cluster, you can retrieve the kube config for the virtual cluster through this endpoint
Example Virtual Cluster Kube Config
An example Virtual Cluster Kube Config:
apiVersion: management.loft.sh/v1
kind: VirtualClusterInstanceKubeConfig
metadata:
creationTimestamp: null
spec: {}
status:
kubeConfig: |-
apiVersion: v1
kind: Config
clusters:
- cluster:
...
Virtual Cluster Kube Config Reference
kind
required 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
kind
required string apiVersion
required 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
apiVersion
required string metadata
required object
metadata
required object spec
required object
spec
required object status
required object
status
required object Virtual Cluster Kube Config (Get)
If ingress endpoint is configured for the virtual cluster, you can retrieve the kube config for a virtual cluster like shown below.
- kubectl
- curl
Run the following command:
# Exchange my-object in the url below with the name of the Virtual Cluster Kube Config
kubectl get --raw "/kubernetes/management/apis/management.loft.sh/v1/virtualclusterinstances/my-object/kubeconfig"
Run the following curl command:
# Exchange my-object in the url below with the name of the Virtual Cluster Kube Config
curl -s -X GET --insecure \
"https://$LOFT_DOMAIN/kubernetes/management/apis/management.loft.sh/v1/virtualclusterinstances/my-object/kubeconfig" \
-H "Authorization: Bearer $ACCESS_KEY"