Advanced settings in kubeconfig

kubeconfig is a configuration file that manages cluster, context, and authentication settings in Kubernetes, on the client side. Using the kubeconfig file, we are able to set different cluster credentials, users, and namespaces to switch between clusters or contexts within a cluster. It can be configured via the command line using the kubectl config subcommand or by updating a configuration file directly. In this section, we'll describe how to use kubectl config to manipulate kubeconfig and how to input a kubeconfig file directly.

If you have gone through the Working with namespace recipe in Chapter 2, Walking through Kubernetes Concepts, where we first mentioned kubeconfig, you will know of its basic concepts. Let's review some key points:

kubeconfig contains three parameters: user, cluster, and context

From the preceding diagram, we can note the following:

  • There are three parameters in kubeconfig: User, cluster, and context—user has its own authentication, while cluster determines the specific API server with dedicated computing resources. Context is both user and cluster.
  • Building multiple contexts for various combinations of settings: Users and clusters can be shared across different contexts.
  • Namespace can be aligned in one context: The current context of a namespace sets up the rules. Any requests should follow the mapping user and cluster in the current  context.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.163.158