Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Infra@LINE

 Infra@LINE

2019/7/25に行われたLINE Developer Meetup #56 in KYOTOでの登壇資料です
https://line.connpass.com/event/139283/

53850955f15249a1a9dc49df6113e400?s=128

LINE Developers
PRO

July 25, 2019
Tweet

Transcript

  1. 2 . 1 1 1 5 1 2 . -1

    4 3 1
  2. None
  3. • ,

  4. ) C • 0 5 C A2 2 • (

    . C • 2 C C • ( C • . C C
  5. + + + + +

  6.  -

  7. - // /

  8. - & 

  9. - - ,

  10. - 35 4 / 0: 7592 : ) . ,

    • 7592 . 2 5. 2 2 07529 • 7592 : 329 ( 2 2 • 7592 2775 2 2 2 07529 • 7592 029 .71:3 . ( 2 2 • 7592 07. .91 :51 E 07 12 1 . 2
  11. 

  12. None
  13.   •   •  •  

    •   
  14. None
  15. 

  16.  •    •  •  

      •     •    •   •    •  ) /) ) ( )
  17. None
  18. ) , , • ( , • • ( •

  19. , • • • • , /-) ( )

  20.   $ docker run -ti ¥ ubuntu bash

  21. None
  22. + /-) ( )

  23.     

  24. • • 

  25. • • • , 

  26. ) • ) ( • • • (

  27. 

  28. 

  29. None
  30.       •   

    •    
  31. /

  32.    •   •   

     •  •   •   
  33.  ◎    ◦  ◦  

      ╳     ╳    △   △    ◦  ) /) ) ( )
  34. 

  35.  - -) - (

  36. $ cat serve.go time.Sleep(5 * time.Second) http.HandleFunc("/", func(w http.ResponseWriter, r

    *http.Request) { log.Printf("%s %s %s %s", r.Method, r.URL.String(), r.RemoteAddr, r.UserAgent()) w.Write([]byte(*greeting + "¥n")) })
  37. $ cat Dockerfile FROM golang:1.12-alpine RUN go build serve.go CMD

    ["./serve", "--listen=:80", "--greeting=Hello, Docker!"] $ docker build --tag $TAG . Successfully built 728b5f3086be Successfully tagged docker- registry.linecorp.com/christopher- pickel/hello-world:latest
  38. $ docker run -rm --name=demo ¥ --publish 127.0.0.1:2080:80/tcp ¥ $TAG

    2019/07/25 06:34:41 starting 2019/07/25 06:34:46 listening on :80 2019/07/25 06:34:52 GET / 172.17.0.1:41676 curl/7.54.0 $ curl localhost:2080 Hello, Docker!
  39. $ docker exec -ti demo bash bash-4.4# ps PID USER

    TIME COMMAND 1 root 0:00 ./serve --listen=… 12 root 0:00 bash 22 root 0:00 ps bash-4.4# curl localhost Hello, Docker! 2019/07/25 06:36:27 GET / 127.0.0.1:36774 curl/7.64.0
  40. bash-4.4# file ./serve serve: ELF 64-bit LSB executable, x86-64… bash-4.4#

    uname Linux bash-4.4# exit $ uname Darwin
  41. $ cat kube.yaml containers: - name: hello image: docker-registry.linecorp.com/ch… args:

    ["./serve", "--listen=:80", "--greeting=Hello, Kubernetes!"] readinessProbe: httpGet: path: /healthz port: 80
  42. $ kubectl apply -f kube.yaml namespace/demo created deployment.apps/hello created service/hello

    created $ curl $(minikube ip):$PORT Hello, Kubernetes! namespace/demo created deployment.apps/hello created service/hello created
  43. $ kubectl logs hello-674f6956d-97kcb 2019/07/23 09:11:34 starting 2019/07/23 09:11:39 listening

    on :80 2019/07/23 09:11:44 GET /healthz 172.17.0.1:39214 kube-probe/1.15 2019/07/23 09:11:49 GET /healthz 172.17.0.1:39214 kube-probe/1.15 2019/07/23 09:11:51 GET / 172.17.0.1:63338 curl/7.54.0
  44. $ kubectl edit deployment hello (s/replicas: 1/replicas: 10/) $ kubectl

    edit deployment hello (s/Hello, Kubernetes/Hello, Rollouts/) $ kubectl rollout status deployment hello Waiting for deployment "hello" rollout to finish: 9 of 10 updated replicas are available... deployment "hello" successfully rolled out
  45.  - -) - (

  46. None