Skip to main content

Getting Started with Kubernetes Engine | GCP

Getting Started with Kubernetes

Objectives

In this lab you create a Kubernetes Engine cluster containing several containers, each containing a web server. You place a load balancer in front of the cluster and view its contents.
In this lab, you learn how to perform the following tasks:
  • Provision a Kubernetes cluster using Kubernetes Engine.
  • Deploy and manage Docker containers using kubectl.Sign in to the Google Cloud Platform (GCP) Console
  1. Make sure that you have access to a standard web browser. The Google Chrome browser is recommended
Sign in to the Google Cloud Platform Console by using the username and password 



Confirm that needed APIs are enabled
  1. Make a note of the name of your GCP project. This value is shown in the top bar of the Google Cloud Platform Console. It will be of the form qwiklabs-gcp-followed by hexadecimal numbers.
  2. In the GCP Console, on the Products & Services () menu, click APIs & services.
  3. Scroll down in the list of enabled APIs, and confirm that both of these APIs are enabled:
  • Google Kubernetes Engine API
  • Google Container Registry API
If either API is missing, click Enable APIs and Services at the top. Search for the above APIs by name and enable each for your current project. (You noted the name of your GCP project above.

Start a Kubernetes Engine cluster
  1. On the Google Cloud Platform menu, click Activate Google Cloud Shell (). If a dialog box appears, click Start Cloud Shell.
  2. For convenience, place the zone that assigned you to into an environment variable called MY_ZONE. At the Cloud Shell prompt, type this partial command:
export MY_ZONE=
followed by the zone that  assigned you to. Your complete command will look like this:
export MY_ZONE=us-central1-f
  1. Start a Kubernetes cluster managed by Kubernetes Engine. Name the cluster webfrontend and configure it to run 2 nodes:
gcloud container clusters create webfrontend --zone $MY_ZONE --num-nodes 2



  1. After the cluster is created, check your installed version of Kubernetes using the kubectl version command:
kubectl version



  1. View your running nodes in the GCP Console. On the Products & Servicesmenu, click Compute Engine > VM Instances.


Run and deploy a container

  1. From your Cloud Shell prompt, launch a single instance of the nginx container. (Nginx is a popular web server.)
kubectl run nginx --image=nginx:1.10.0



  1. View the pod running the nginx container:
kubectl get pods
  1. Expose the nginx container outside Kubernetes:
kubectl expose deployment nginx --port 80 --type LoadBalancer



  1. View the new service:
kubectl get services
You can use the displayed external IP address to test and contact the nginx container remotely.



  1. Open a new web browser tab and paste your cluster's external IP address into the address bar. The default home page of the Nginx browser is displayed.
  2. Scale up the number of pods running on your service:
kubectl scale deployment nginx --replicas 3



  1. Confirm that Kubernetes has updated the number of pods:
kubectl get pods
  1. Confirm that your external IP address has not changed:
kubectl get services
  1. Return to the web browser tab in which you viewed your cluster's external IP address. Refresh the page to confirm that the nginx web server is still responding.

Congratulations!

In this lab you configured a Kubernetes cluster in Kubernetes Engine. You populated the cluster with several pods containing an application, exposed the application, and scaled the application.

Source: Coursera

Comments

Popular posts from this blog

AWS Cheat Sheet

Why Upgrading to Terraform 1.0. Should be a Priority ?

  HashiCorp Terraform version 1.0, released this week, contains few new technical feature updates. But that's actually the point. The company is known for its unconventional philosophy on what constitutes a "version 1.0" product and has spent seven years updating, supporting and marketing the infrastructure-as-code tool without this designation. Other HashiCorp products such as  Nomad  container orchestration and  Vault  secrets management also spent long periods being used in production before reaching version 1.0. Terraform is used to define infrastructure resources using programming code, which DevOps teams can then automatically test and deploy alongside applications using the same processes. Terraform is among the most widely used such tools, with more than 100 million open source downloads to date. The HashiCorp-hosted Terraform Cloud has amassed 120,000 customers. Despite its widespread production use, each new version of Terraform over the last three years came wi

PubG Snow map APK | Vikendi map | PUBG 0.10.0 mobile version | PUBG 0.10.0 USA BETA

Vikendi Map PUBG Beta Mobile Version 0.10 How to Install: Note : Since  PUBG Mobile 0.10.0 version  is available as Beta form, you may get some glitches and problem while playing. So, don’t worry! You will get a better and stable version of PUBG Mobile 0.10 update within a month. The PUBG 0.10 Mobile Beta size is around 1.5 GB. So, make sure you have enough space. Well, you don’t need to root your device or delete the stable PUBG Mobile 0.9.5 version to get the latest  PUBG 0.10.0 mobile version.  Also, you won’t get banned for downloading PUBG Mobile 0.10 beta version. Step #1 : Go to the PUBGMobile Beta Download page and  download PUBG Mobile 0.10 Beta on  Android  or  iOS  version . Step #2 : Next,  install PUBG Mobile 0.10 beta apk  file on your smartphone. Step #3 : After the successful i nstallation of PUBG Mobile 0.10 update , launch the new version and log in as a “Guest” or use “Facebook” login to get started.