Few years back when I was new to world of kubernetes and docker, I decided to get my hands dirty and deploy my own set of container inside kubernetes. After some google search got to know about Mini-kube which can be setup over local dev environment. But after spending couple of days & setting up minikube locally, I found myself getting diverted to activities which I didn't want to work at least in my early days of my learning. So I decided to take a look Google Kubernetes Engine (GKE).
To start with I took 300$ credit which google provides for ever new signup thinking that I would at least be able to play with kubernetes for a month time with $300 credit. But to my surprise I was able to use kubernetes cluster environment for more than a period of 8 months having following service up and running for 24 hours and still I had 20$ credit balance.
- Load balancer with static IP
- 100 GB Persistence Storage & 10 GB boot disk.
- g1-small 1 instance deployed in asia-south1-a
- Cloud storage (less than a GB)
This articles assumes that you have already created login to google cloud and your cloud environment is ready for use and you have read & setup cloud sdk environment available here. Cloud SDK will only be required if you wish create a cluster using command prompt. I will still recommend you to configure SDK because it comes handy to push docker image, add / update /delete configuration etc.
OK let us get started
GKE / Google kubernetes Engine provides two options for creating a cluster.
- Web interface from Console.Cloud.google.com
- Command prompt / Shell.
Lets quickly web interface in this post and command prompt / shell in coming up post. For Web interface please login to google cloud console. In the left menu click on
Kubernetes Engine --> Clusters
New screen should show option for creating kubernetes cluster,
This should navigate you to create kubernetes cluster screen, On the left side of the screen you would have multiple options to choose from. By default it is set to standard cluster, since this is R&D project for first timer I would recommend using "Your first cluster" option.
To be cost effected in your first project, I would recommend you make this changes. But in case your confident on default / changing value to some other setting please feel free to do so. Here are values which I have changed.
- Name: Changed from "your-first-cluster-1" to "myrndproject". Please note all the character should be in lower case.
- Location: Select "asia-south1-a". This should allocate me a cluster in Mumbai. You can select cluster based your location. Details are available here
- Disk Size: By default 30 GB disk get allocated, but for running sample app I believe 10 GB is more than enough. For making this changes scroll down to Machine configuration section and click on "More Option"
Look for "Boot disk size (GB)" option just below "CPU Platform and GPU" and change this from 30 GB to 10 GB.
Click on Save. This should bring you back to earlier screen. We are all set for starting our first kubernetes cluster on Google Cloud via web interface. Just cross check all our value and once you are confident please click on "Create" button at the bottom of the screen.
This screen should appear immediately after you click on Create.
On Success this should change to
You can start using your kubernetes cluster. You can now push & deploy your container. In my next post I will show how we can create authenticate & create kubernetes cluster using command prompt.
For creating kubernetes cluster using command line interface / CLI, please click here.
For any queries / help / assignment you can reach out to me at firstname.lastname@example.org