Showing posts with label Google Cloud. Show all posts
Showing posts with label Google Cloud. Show all posts

Friday, December 22, 2017

Google Cloud Kubernetes Cluster creation with Sample Guest book App tutorial

~$ gcloud container clusters get-credentials cluster-1 --zone us-central1-a --project northern-timer-193700

Creeate A directory to create Test App

TUTORIALDIR=src/northern-timer-193700/gke_guestbook-2018-04-08-00-22

Clone gustbook  App

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples.git $TUTORIALDIR

Change directory to guest book.

cd $TUTORIALDIR/guestbook

Disaply redis-master template
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ cat redis-master-controller.yaml


~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ gcloud container clusters get-credentials cluster-1 --zone us-central1-a

Create Redis Master Service
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl create -f redis-master-service.yaml

Create Redis Master Controller
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl create -f redis-master-controller.yaml

List down Pods, resources and Services.
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl get pods
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl get rc
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl get services

Create slave nodes
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl create -f all-in-one/redis-slave.yaml
Create Front End App
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl create -f all-in-one/frontend.yaml

Watch the Deployed App
~/src/northern-timer-193700/gke_guestbook-2018-04-08-00-22/guestbook$ kubectl get services --watch