Simple python script which helps to install microk8s for the local desktop development.

Introduction

we will deploy a microk8s in Linux(ubuntu – 18.04)/MacOs(not tested)and will create the docker image and push it local registry and deploy the same docker in microk8s Kube.

Pre-requisites

Before we get started using the script.

  • Ensure you have installed docker.
  • Snap needs to be installed.
  • Python needs to be installed.

And clone the below script

git clone git@github.com:ahamedyaserarafath/dev_kube_microk8s.git

Installation/commands

  • The below command will install microk8s and enabled DNS, dashboard, and registry
python ./simple_kube.py --install kube 
  • Varies command to stop, start and check the status of microk8s.
python ./simple_kube.py --start/stop/status kube 
  • List the pods running in microk8s
python ./simple_kube.py --list-pods kube 
  • List the deployment running in microk8s
python ./simple_kube.py --list-deployment kube 
  • The below command will create the deployment in microk8s.
python ./simple_kube.py --create-deployment <yaml_path> 
  • The below command will create the docker images and kept locally.
python ./simple_kube.py --create-docker <Docker_file_path> 
  • The below command will create the docker images and push them to the local registry which is enabled in microk8s.
python ./simplekube.py --create-push-docker <Docker_file_path> 
  • show the status docker images.
python ./simple_kube.py --status-docker-image <imagename> 
  • Remove the docker images.
python ./simple_kube.py --remove-docker-image <imagename> 
  • List the Docker images.
python ./simple_kube.py --docker-image list 
  • It will create the docker images and push them to the local registry and deploy the same in microk8s. Note: The above command needs to run where the docker file exists.
python ./simple_kube.py --create-push-deploy <docker_image_name>

https://github.com/ahamedyaserarafath/dev_kube_microk8s

GitHub Link, Please feel free to fork and use it

Categorized in:

Tagged in:

,