Skip to content

amohan14/kubernetes-engine-samples

 
 

Repository files navigation

Quick Start GCP Kubernetes on Windows with Hello World App

gcloud init
  • Handy way to get current project and set an environment variable
gcloud config get-value project
set PROJECT_ID=<project value>
  • Clone the Repo
git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app
  • Build docker Image
docker build -t gcr.io/%PROJECT_ID%/hello-app:v1 .
  • Run it locally
docker run --rm -p 8080:8080 gcr.io/%PROJECT_ID%/hello-app:v1
  • Push the Image so that we can deploy into k8s cluster
gcloud auth configure-docker
docker push gcr.io/%PROJECT_ID%/hello-app:v1

Setup GKE

gcloud config set project %PROJECT_ID%
gcloud container clusters create hello-cluster
gcloud compute instances list
kubectl create deployment hello-app --image=gcr.io/%PROJECT_ID%/hello-app:v1
kubectl get pods
kubectl expose deployment hello-app --name=hello-app-service --type=LoadBalancer --port 80 --target-port 8080
kubectl get service
curl <External IP address>
  • Cleanup
kubectl delete service hello-app-service
gcloud container clusters delete hello-cluster

Kubernetes Engine Samples

This repository contains sample applications used in Google Kubernetes Engine tutorials.

See the following resources to learn more:

Contributing changes

Licensing

About

Sample applications for Google Kubernetes Engine (GKE)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 35.5%
  • Dockerfile 22.0%
  • Python 16.0%
  • C# 8.8%
  • JavaScript 8.1%
  • PHP 4.3%
  • Other 5.3%