Setting Up Icekube Config File

320

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:

  1. Take the backup of the existing config file and name it config_backup.
  2. 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.
  3. 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.

Select 3 lines under the cluster referring to docker desktop from config_backup file
Select 3 lines under the cluster referring to docker desktop from config_backup file
Paste the lines (copied from config_backup) in config file by replacing the selected three lines as shown in the image.
Paste the lines (copied from config_backup) in the config file by replacing the selected three lines as shown in the image.

Again select lines from the config_backup file and paste them by replacing them in the matching location in the config file.

Select 3 lines under the users: heading referring to docker desktop from config_backup file
Select 3 lines under the users: heading referring to docker desktop from config_backup file

 

Paste the lines (copied from config_backup) in the config file by replacing the selected three lines as shown in the image. 
Paste the lines (copied from config_backup) in the config file by replacing the selected three lines as shown in the image.
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.

Command to list the current context used.

kubectl config current-context

 

Kubectl 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 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

 

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 cluster level.
List all the resources for the current context at cluster level.
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

 

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