vcluster_kubeconfig
Export a virtual cluster's kubeconfig to a private temporary file and return its path, leaving your current kube context untouched. Use the file as credentials for kubectl or Helm.
Instructions
Export a vcluster kubeconfig to a file without switching contexts.
Use this when you need credentials to hand to another tool, for example
kubectl --kubeconfig <path> or a Helm invocation. Unlike vcluster_call,
it leaves the caller's current kube context untouched.
The kubeconfig is written to a private (0600) temporary file and the path is returned rather than the contents, because the file holds client credentials. The caller owns that file and should delete it after use.
Args: name: The name of the vcluster to export credentials for. namespace: Optional namespace where the vcluster is located. If not provided, defaults to the vcluster name. server: Optional API server address to record in the kubeconfig. Set this when the vcluster is reached through an ingress or load balancer rather than a local port forward. insecure: If True, the generated kubeconfig skips TLS verification. kubeconfig_path: Optional path to a kubeconfig file. If not provided, the default kubeconfig from the environment will be used.
Returns: Union[Dict[str, str], str]: A dict with kubeconfig_path, context and server on success, or error object if failed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| server | No | ||
| insecure | No | ||
| namespace | No | ||
| kubeconfig_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |