Setting Up Icekube Config File

521

Now when we have installed Docker Desktop along with Kubernetes and other related tools. We are ready to deploy containers on local Kubernetes which we have installed on our laptop.

WAIT!!!!!!

Our fundamental goal is to deploy the 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 simpler, we have kept the config file ready for you at the 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.

Take the backup of the existing config file. Now, you can simply replace the existing config file in the folder with the path “/home/sumit/.kube” with the downloaded config file.

Note

Replace “sumit” with your linux username

Once you are done, restart the docker desktop and Kubernetes. Open Bash  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.

Command to list the current context used.

$ kubectl config current-context
Command to check the current context used.
Command to check the current context used.

 

Command to view all contexts via the config command

$ kubectl config get-contexts

 

 

View all contexts via the config command
View all contexts via the config command

 

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

 

Command to switch from existing context to another context without namespace
Command to switch from existing context to another context without namespace

 

Note

Without using the namespace we may not authorize to access all the resources in the icekube cluster so better use the 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

 

 

Command to switch from existing context to another remote context with namespace
Command to switch from existing context to another remote context with namespace

 

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

 

 

List all the resources for the current context at the cluster level.
List all the resources for the current context at the cluster level.

 

Note

RI.SE Kubernetes cluster is a multi-tenant, so when we set up the config file for Kubernetes. We can only run kubectl-related commands accessible within the namespace.
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 the cluster level. But the users linked to the ltu-default namespace cannot run kubectl commands at the cluster level.

 

List all the resources for the current context within a namespace.

$ kubectl get all -n ltu-default

 

List all the resources for the current context within a namespace.
List all the resources for the current context within a namespace.