In this blog, we will learn about
- Registering clusters with Anthos
- Create service account, role, and role binding
Kubectl controls the Kubernetes Cluster. It is one of the key components of Kubernetes which runs on the workstation on any machine when the setup is done. It has the capability to manage the nodes in the cluster.
- Displays nodes in the cluster
- Kubectl get nodes
- Displays all the pods
- Kubectl get pods
- It has the capability to configure a resource by file
- Kubectl apply -f <filename>
- Displays the deployment in the cluster
- Kubectl get deployment
- Displays the current-context
- Kubectl config current-context
- Displays the services in the cluster
- Kubectl get services
- Deletes the specified deployment
- Kubectl delete deployment <deployment name>
- Deletes the specified service
- Kubectl delete service <service name>
Kubectx is a utility to manage and switch between kubectl contexts. It helps you switch between clusters back and forth.
- list the contexts
- switch to context <NAME>
- kubectx <NAME>
- show the current context name
- kubectx -c, — current
Step 1: Registering Clusters with Anthos
Step 2: Check if the clusters are registered with Anthos
Step 3: Run the below commands to create the service account, role, and role binding.
In Azure — Create a file called node-reader. YAML
The below commands create the service account, role, and role binding.
Step 4: The secret associated with the anthos-user service account
Step 5: Paste the token in GCP-Login
Access the Anthos dashboard and click on the cluster name and click on the login button.
Under the Token, paste the string copied in the previous step and click the Login button.
Now, you can access the GCP cluster information from Anthos. Repeat the above steps with the AKS context to enable access to it.
Congratulations! You have successfully registered two clusters with Anthos.