SUSE Support

Here When You Need Us

What is the kube_config_cluster.yml file that is created after provisioning a cluster with the Rancher Kubernetes Engine (RKE) CLI?

This document (000020139) is provided subject to the disclaimer at the end of this document.

Situation

Question

The Rancher Kubernetes Engine (RKE) documentation references a file kube_config_cluster.yml that is generated after running rke up, this article explains what this file is and how to use it.

Pre-requisites

  • A Rancher Kubernetes Engine (RKE) CLI provisioned Kubernetes cluster
  • kubectl installed

Answer

When you provision a Kubernetes cluster using RKE, a kubeconfig file is automatically generated for your cluster.

This file is created and saved as kube_config_<cluster>.yml, where <cluster> is the filename of your cluster configuration YAML file. This kubeconfig defines the connection and authentication details to interact with your cluster, using tools such as kubectl.

By default, kubectl checks ~/.kube/config for a kubeconfig file, but you can specify a different kubeconfig file using the --kubeconfig flag. For example:

kubectl --kubeconfig /custom/path/rke/kube_config_cluster.yml get pods

Or you can export the config path into the KUBECONFIG environment variable, removing the requirement to specify the --kubeconfig flag each time you run kubectl:

export KUBECONFIG="/custom/path/rke/kube_config_cluster.yml"

Further Reading

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020139
  • Creation Date: 06-May-2021
  • Modified Date:06-May-2021
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.