Now when we have installed Docker Desktop along with kubernetes. We are ready to deploy containers on local Kubernetes which we have installed in our laptop.
WAIT!!!!!!
Our real goal is to deploy container at RI.SE ICEKUBE (kubernetes infrastructure) and harness the power of GPUs, to do that we have to modify the config file at our local system to authenticate and access the remote Kubernetes infrastructure (which can be any cloud platform such as AWS, GCP, Azure or on-premise infrastructure like icekube Kubernetes cluster provided by RI.SE)
To make it more simpler, we have keep the config file ready for you at private github link. You can ask any existing group member to add you to the github repository for icekube config file so you can download the config file.
Once you access the repository, you can download or copy the config file from this link.
Steps to follow:
- Take the backup of the existing config file and name it config_backup.
- Now, replace the existing config file with the name config in the folder with the path “C:\Users\sumrak\.kube” with the downloaded config file.
- Now we need to add some lines from the config_backup to the modified config file. Follow the below instructions:
Select lines from the config_backup file and paste them by replacing them in the matching location in the config file.
Again select lines from the config_backup file and paste them by replacing them in the matching location in the config file.
Note
Replace “sumrak” with your Windows username
Once you are done, restart the docker desktop and Kubernetes. Open Windows Power Shell and try kubectl based command to switch context from local to remote Kubernetes. We will explain the different commands below to view the current context, how to switch from local to remote context and vice versa.
Table of Contents
Command to list the current context used.
kubectl config current-context
Command to view all contexts via the config command
kubectl config get-contexts
Note
The * represents the current context. For remote access we are only entitled to use icekube cluster with namespace ltu-default
Command to switch from existing context to icekube context without namespace
kubectl config use-context icekube
Note
Without using the namespace we may not authorized to access all the resource in the icekube cluster so better use below command by mentioning context and namespace together.
Command to switch from existing context to icekube context with ltu-default namespace
kubectl config set-context icekube --namespace=ltu-default OR kubectl config use-context icekube kubectl config set-context --current --namespace=ltu-default
List all the resources for the current context.
Using the kubectl get all command we can list down all the pods, services, statefulsets, etc. in a namespace but not all the resources are listed using this command in a cluster.
List all the resources for the current context at cluster level.
kubectl get all
Note
RI.SE Kubernetes cluster is a multi-tenant, so when we setup the config file for Kubernetes. We can only run kubectl related commands accessible within the namespace.
When we modified the config file inside ./kube/config (we added the config file downloaded from the icekube). The config file is modified to operate at cluster level. But the users linked to ltu-default namespace cannot run kubectl commands at cluster level.
List all the resources for the current context within a namespace.
kubectl get all -n ltu-default