Table of Contents (🔎 Click to expand/collapse)
Google Kubernetes Engine (GKE) provides a managed environment for deploying, managing, and scaling your containerized applications using Google infrastructure. The Kubernetes Engine environment consists of multiple machines (specifically Compute Engine instances) grouped to form a container cluster. In this lab, you get hands-on practice with container creation and application deployment with GKE.
Google Kubernetes Engine (GKE) clusters are powered by the Kubernetes open source cluster management system. Kubernetes provides the mechanisms through which you interact with your container cluster.
- A cluster consists of at least one cluster master machine and multiple worker machines called nodes.
- Nodes are Compute Engine virtual machine (VM) instances that run the Kubernetes processes necessary to make them part of the cluster.
The benefit of Google Kubernetes Engine (GKE) cluster:
- Load Balancing: distribute incoming traffic across multiple virtual machine (VM) instances
- Node Pools: designate subsets of nodes within a cluster that all have the same configuration for additional flexibility
- Automatic Scale: automatically resizes the number of nodes in a given node pool, based on the demands of your workloads
- Automatic Upgrade: keep the nodes in cluster up-to-date with the cluster control plane (master) version when the control plane is updated on our behalf
- Node auto-repair: makes periodic checks on the health state of each node in your cluster to keep nodes in a healthy and running state
# create cluster
$ gcloud container clusters create <CLUSTER-NAME>
# authenticate cluster
$ gcloud container clusters get-credentials <CLUSTER-NAME>
# deploy containerized application
$ kubectl create deployment hello-server --image=<IMAGE>
$ kubectl expose deployment hello-server --type=<TYPE> --port=<PORT>
# delete cluster
$ gcloud container clusters delete <CLUSTER-NAME>
- GKE uses Kubernetes objects to create and manage the cluster's resources.
- Kubernetes provides:
- Deployment object for deploying stateless applications.
- Service objects define rules and load balancing for accessing application from the internet.