Ignite on Google Cloud

Subscribe to my newsletter and never miss my upcoming articles

Weave Ignite

Weaveworks on their 5th birthday announced a free and open-source project called IGNITE. As per the docs

Weave Ignite is an open source Virtual Machine (VM) manager with a container UX and built-in GitOps management.

To Elaborate more, Ignite is a VM that runs any Docker image out there as a Virtual machine. You need not build the image using the VM specific tools like .vdi etc, so you just build your docker Image add your modification and directly run it as “ignite run” (just as you would have run a container from an image by docker run). Also, you need not build the image To combine the above explanation you can say that Ignite combines containers and VM’s, Amazon’s firecracker and Docker image. Firecracker is virtualization implementation from AWS which act as micro VM and is secure, fast and reliable. Right now ignite is in alpha stage

Ignite Installation : Ignite runs on any Intel-based linux/amd64 system with KVM support. KVM needs to be enabled and without that ignite would not work so do a kvm-ok to check( if kvm is not installed then you can install it by ‘apt install qemu-kvm’)

Here we will use Google compute from a custom KVM image so that ignite can be installed and run Easily.

  • Login to Google cloud console
  • Open Google cloud shell
  • run the following command to create custom images with KVM enabled
gcloud compute images create nested-virt \
  --source-image-project=ubuntu-os-cloud \
  --source-image-family=ubuntu-1604-lts \
  --licenses="https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
  • Create a compute Engine with the custom image created

Compute instance with custom imageCompute instance with custom image

— ssh into the compute instance and start running the following commands to install Docker and Ignite.

#docker installation
1: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
2: sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
3: sudo apt-get update
4: sudo apt-get install docker-ce docker-ce-cli containerd.io

==================================================================
#Ignite Installation

export VERSION=v0.4.0
curl -fLo ignite https://github.com/weaveworks/ignite/releases/download/${VERSION}/ignite
chmod +x ignite
sudo mv ignite /usr/local/bin
ignite version

ignite versionignite version

Now your ignite is up and running, let's see how we can spin up a VM from Docker image and then a few commands.

Ignite in action :

Ignite cli is just like the standard docker CLI so all the commands you will see with ignite, can be related to the Docker commands. We will be using here the standard guide provided in the official repository itself.

#importing an image
ignite image import weaveworks/ignite-ubuntu
# If we do not specify the tag it will take the latest by default

#Creating a vm out of that image 
ignite create weaveworks/ignite-ubuntu --name my-vm --cpus 2 --memory 1GB --size 6GB --ssh
# ssh flag enable the user to ssh into the instance and the login password will be root/root 
# cpu , memory and size defines the user defined specs for the VM and sets a boundary

Note: current ignite kernel image `would not let you run two vm with partial same name like suppose you create my-vm and my-vm2 you would not be able to run ‘ignite run my-vm’ and it will throw out an error saying ‘ambiguous VM query: “my-vm” matched the following IDs/names: my-vm, my-vm2’ (fix is in the branch and will be in next release).

errorerror

You can start you vm by typing:

ignite start my-vm

Let's run some basic commands and see the output (most of the commands would look like docker commands) :

ignite kernel - the ignite kernel
ignite images - ignite vm images
ignite ps - ignite running vm 
ignite vm ls - ignite running vm

few ignite commandsfew ignite commands

There are two ways to communicate with the created vm

1- attach

ignite attach myvm 
# press enter, type the username and password as root and you should enter the vm
# to get out of that shell press ctrl + P + Q

getting inside vm using attachgetting inside vm using attach

2- ssh into the vm (since we passed — ssh while creating the vm , this allows to ssh into the vm)

ignite ssh my-vm

#commands to remove the mv, images and kernal

#removing running vm
ignite rm my-vm --force

#remove image
ignite rmi weaveworks/ignite-ubuntu

#remove kernel
ignite rmk weaveworks/ignite-kernel:4.19.47

few commands inside vm and then removing itfew commands inside vm and then removing it

Official git repo having the code and documentation: https://github.com/weaveworks/ignite Great work is done by the team putting this up. I am trying to do Gitops with ignite, once done will update the article.

Happy igniting..!!Saiyam Pathak https://www.linkedin.com/in/saiyam-pathak-97685a64/ https://twitter.com/SaiyamPathak

No Comments Yet