Kubernetes Engine
Run containers and implement cloud-native applications powered by industry standards
When you run a GKE cluster, you also gain the benefit of advanced cluster management features that Google Cloud provides. These include:
Load balancing for Compute Engine instances
Node pools to designate subsets of nodes within a cluster for additional flexibility
Automatic scaling of your cluster's node instance count
Automatic upgrades for your cluster's node software
Node auto-repair to maintain node health and availability
Logging and Monitoring with Cloud Monitoring for visibility into your 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.
To create a cluster
gcloud container clusters create [CLUSTER-NAME]
After creating your cluster, you need authentication credentials to interact with it. To authenticate the cluster
gcloud container clusters get-credentials [CLUSTER-NAME]
To create a Kubernetes Service, which is a Kubernetes resource that lets you expose your application to external traffic
kubectl expose deployment hello-server \
--type=LoadBalancer \
--port 8080
In this command:
--port
specifies the port that the container exposes.type="LoadBalancer"
creates a Compute Engine load balancer for your container.
To delete the cluster
gcloud container clusters delete [CLUSTER-NAME]
Commands
gcloud container clusters create learning-cluster
gcloud container clusters get-credentials learning-cluster
kubectl create deployment hello-server --image=gcr.io/google-samples/hello-app:1.0
kubectl expose deployment hello-server --type=LoadBalancer --port 8080
kubectl get service
gcloud container clusters delete learning-cluster
Last updated
Was this helpful?