- Install Git for Windows
- Install Notepad++
- Do Windows update before Installing Docker
- Install Docker for Windows
- Sign up for Free Google Cloud Account using your gmail ID - https://cloud.google.com/
- Download gCloud tool for Windows
- Initialize your Local gcloud env and set the default project, compute zone etc
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
This repository contains sample applications used in Google Kubernetes Engine tutorials.
See the following resources to learn more:
- See CONTRIBUTING.md
- See LICENSE