Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

9/3/2015 GCPUG.TW free talk: kubernetes

No description
by

Ming-der Wang

on 3 September 2015

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of 9/3/2015 GCPUG.TW free talk: kubernetes

GCPUG.TW 9/3 free talk - Use Kubernetes on GKE
ming@log4analytics.com

Ideas
I want to provide a free back-end database services for front-end, IoT, iOS, Android, mobile developers.
http://mholt.github.io/json-to-go/
What You May Learn Tonight.
what is a microservice?
microservices in Go
how to use go generate?
who to dockerize a service in Go
start a go service on Google Container Engine using kubernetes
how to do kubectl rolling update?
dockerize
Dockerfile:

FROM asia.gcr.io/mitac-cust-gcp-1/base-onion:latest
CMD ["/go/bin/onion","serve"]
EXPOSE 8080


go generate
//go:generate ginger $GOFILE
package main
//@ginger
type TaipeiCity struct {
Ginger_Created int32 `json:"ginger_created"`
Ginger_Id int32 `json:"ginger_id" gorm:"primary_key"`
Name string `json:"name"`
Age int `json:"age"`
Address string `json:"address"`
}
JUST GIVE ME a JSON Schema...
I will give you a RESTful API URL in return.
And many many ways to summit a #log4 request ...
* Live demo (curry)
You got an URL in return message, such as
http://api.log4security.com/taipeiCity
inspired by
What is microservice anyway?
SOA (Service Oriented Architecture)
make each service smaller
think of scaling from day 1
easy to maintain and refactory

* Live demo (pepper)
$ go get github.com/mingderwang/ginger
$ go generate
docker build -f example/Dockerfile.asia.gcr.io -t
asia.gcr.io/mitac-cust-gcp-1/base-onion .
docker build -t ming/chilli .
docker run -d -p 8080:8080 ming/chilli

Google Container Registry
gcloud components install kubernetes (or kubectl)

gcloud docker push gcr.io/mitac-cust-gcp-1/base-onion:latest
docker build -t gci.io/mitac-cust-gcp-1/demo-onion:v1 .
gcloud docker push gcr.io/mitac-cust-gcp-1/demo-onion:v1
kubernetes command
gcloud container clusters create onion-world \\
--num-nodes 1 \
--machine-type g1-small
(or gcloud config set container/clusters onion-world)

kubectl run demo-node --image=gcr.io/mitac-cust-gcp-1/demo-onion:v4 --port=8080

kubectl scale --replicas=3 rc demo-node

kubectl expose rc demo-node --create-external-load-balancer=true
another example from GKE
docker build -t gcr.io/mitac-cust-gcp-1/demo-onion:v7 .

gcloud docker push gcr.io/mitac-cust-gcp-1/demo-onion:v7

kubectl rolling-update demo-node --image=gcr.io/mitac-cust-gcp-1/demo-onion:v7
Kubectl Rolling Update
https://console.developers.google.com/project/mitac-cust-gcp-1/kubernetes/images/tags/demo-onion?location=GLOBAL
Q&A
Ming-der Wang <ming@log4analytics.com>

welcome to join us!

GCPUG.TW
DevOpsTaiwan.slack.com
DockerTaipei.slack.com
Golang.slack.com
Full transcript