Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DevLove k8s nobusue 20180711

161 views

Published on

Kubernetes Tips and Best Practices for DevLove 2018/7/11

Published in: Technology
  • Be the first to comment

DevLove k8s nobusue 20180711

  1. 1. 0() )/) 1 78 K 2 @ (0 0)
  2. 2. • – Mail: nosue@redhat.com – Twitter: @nobusue • 14 JavaEE (1999 2013) • Enterprise Mobile (2012 2013) • IoT (2014 2017) – – – / 2
  3. 3. g b uJa d P • 8 4 O tO n • e c m – ( ) )) • fSil J /8 • db V e Jskm – b p n – 8 4 J O o • C a b J o – AM b Or oD
  4. 4. ed gba [ • O M P GK – edc ] fG 7= =(B – /5 N GK =(B OS Base MW App D C7 7 8 ) 2 8 OS Base MW App C7 7 8 ) OS Base MW App D /5 8 ) 2 8 OS Base MW App C7 7 /5 8 ) C7 7 N N 0 1.
  5. 5. CI RHEL7 (v1) PHP (v1) RHEL7 (v1) RHEL7 (v1) PHP (v1) App (v1) RHEL7 (v1) PHP (v1) App (v2) RHEL7 (v1) PHP (v2) RHEL7 (v1) PHP (v2) App (v2) RHEL7 (v2) PHP (v2) App (v2) RHEL7 (v2) PHP (v2) RHEL7 (v2) OS MW • ( ) • Docker ID
  6. 6. • / / - . 7 - / – . 7 ::: . 7 7 / / - . 7 - / . - / – R ca B • 7 / 7 /- / - / / / / 7 – . 7 ::: . 7 7 7 / 7 / /- / – b H B
  7. 7. 10 ) ) https://www.redhat.com/ja/resources/container-security-openshift-cloud-devops-whitepaper
  8. 8. k8s
  9. 9. Y co • Y M – f 0 1 =m – Y M ki M • L – 0 1 38 ) =m – p D e 0 )=m • n – A= > G> ( 8m l
  10. 10. > a l j s • S M l jJ – / < 1 ) < > 1 A Y – y P a – m jn ( 1. i epfk • N l j > s P a – > M L uR vd O – h oj ) 1 • A " > " " <D A"< < • tr D< > M c a • . >18 > d /A Jd
  11. 11. • d s d2 P en • K K u I K 1 d b • o n K s r t 1 IP: 1.1.1.1 Port: 8080
  12. 12. • cd ( . ) 3 r c e 1 Db S P k o 31/ 1 - N ns • 1 c e ( lDcd (D f cd (D S P PodPod DNS IP IP
  13. 13. : 2 Re dli • : 2 L – 1 y KmhvsM:) – n gb g g a Kmh • : 2 mh k – 0 7 - 2 . 1 1 / : 2 • 8 ? : 2 4 7 7 1 4 7 4 : 2 – 1 / : 2 • 8 ? : 2 4 1 : 1 : 2 • $ ) ru ? ps tIL:) o R – 8 ? 7 8 2 : 2 : 2 – f c g • : 2 1 2 1?? 1 : 2
  14. 14. NodeNodeNode NodeNodeNode
  15. 15. RHEL NODE RHEL NODE c RHEL NODE RHEL NODE c RHEL NODE C C RHEL NODE C C RED HAT ENTERPRISE LINUX MASTER API/AUTHENTICATION DATA STORE SCHEDULER HEALTH/SCALING C
  16. 16. RHEL NODE RHEL NODE RHEL NODE RHEL NODE C C RHEL NODE C C c RED HAT ENTERPRISE LINUX MASTER API/AUTHENTICATION DATA STORE SCHEDULER HEALTH/SCALING C c
  17. 17. n liveness probe – Hy U R LT a – O G t • )( 2/ t d EedH U • 0 U • ( b oi p d EedbEiH U – t r bo H R UK T U n rediness probe – HcEkd U P xH P LT a – : = Ts a tH • av S :3C t – t r bo H xS T U lnd a
  18. 18. 8 ( 2 ) 1 2
  19. 19. p :5 2 2 + 1 5 2 +50 / : 1 5 2 +50 1 /1 / : 1 5 2 +50 + M= :5 o =+50c d L :5 PQU CNe m i n a 2 2 +50 5 2 1 CN i n 22
  20. 20. F K 1 2 8 2 8 2 8 2 8 1 1 1 2 8 2 8 2 8 1 1 1 1 2 8 F E F N F F K 23
  21. 21. • • – – –
  22. 22. . +)( 5 2 5 2 ( / ())+ / ( / + ( + V S P
  23. 23. L A RS / ) / - - ( - ( - ( - ( - ( - ( - ) / - - ( - ( - ( - ( - ( - ( - - - - CO E A P L A RS L A L A H OpenShift Web Console RED HAT CLOUDFORMS CUSTOM DASHBOARDS API 26
  24. 24. D L 8 6 60 % % % % % % LCH 6 • RP R ES • A A U A 27
  25. 25. PV(Persistent Volume)
  26. 26. • uf S uf d DP • – och( n sacf uf p uh – au sk i • ) ) – – ) r lrN ) d – ) p uh – cht bN PO Ple ui • ) ) – ) ) D – ) V N K) pemu (9 2 CFV
  27. 27. D S 1 1 - 1 F 1 0 - 1 11 1 - 1 1 - 1 - 1 A C - 01 MySQL 1 1 1 G D VW N DI P 1 1 1 - G D VW - 1 - 1 01 - 1A 30
  28. 28. DS CP I N L C I N L CI 2 0 : : : 1 : mysql-claim matchLabel: pytype: db MySQL 0 apiVersion: v1 kind: PersistentVolumeClaim spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi selector: matchLabels: pvtype: db ... apiVersion:v1 kind:PersistentVolume metadata: annotations: pv.kubernetes.io/bound-by-controller:"yes" labels: pvtype:db name:pv1 … 32 :
  29. 29. C 0 G -1 0 1 MySQL I ODW N P I O W 1 A 0 1 0 A V B 33 S A
  30. 30. DevOps Toolchain on k8s
  31. 31. HOST OS CONTAINER OS RUNTIME APP SERVER CONTAINER OS RUNTIME APP AZURE O Java+JBoss PHP, C++, Ruby Database ( ) 5p e ) p D ) ) ) OS 3 D D O
  32. 32. 88 2 3 Q • ( 3 QTb h E ( 3 3 – c uQonD Q pe – a S S b uQlx – siQ • r O Jk e • NTb h E – 8 O) Js O Cm N – 3 6 J Qv N
  33. 33. G J • 3 8 H 3 : ( / – : 8 3 3 3 / 33 :/ 3 / 3 73 8 • 3 8 - – 33 : / 3 8 3 3 3 / 73 8 C • ./ 3 : 3 3 : ) 8 – : / / / 3 :
  34. 34. JENKINS-AS-A-SERVICE ON OPENSHIFT • Red Hat Jenkins – OpenShift – Jenkins 1.x / 2.x LTS • Jenkins S2I Builder – OpenShift – Jenkins – Build Job • OpenShift CI/CD • Jenkins Plugins Jobs Configuration Jenkins (S2I) Custom Jenkins Image Jenkins Image
  35. 35. WebAPI/MicroServices on k8s
  36. 36. WebAPI in Production Proxy (Nginx) LB Internet Proxy (Nginx) Svc Svc Query API Cache Svc Mongo Svc Cassandra Svc Mongo Cassandra Query API Cache Svc Mongo Svc Cassandra Svc Mongo Mongo Cassandra Cassandra Svc
  37. 37. Client 1 L S Web API Web API LB Client LB Client Web API Web API LB Web API • > =4 =8 • >BA A? • A AA =8 • ?4B A ? =8 • / ?C 4 4>C ? • =A 8 =A >BA =8 >D A> = PL S LH I T 1 R
  38. 38. Circuit Breaker (eg: Hysterix) l Ø Ø / https://martinfowler.com/bliki/CircuitBreaker.html
  39. 39. DISTRIBUTED ARCHITECTURE Service ServiceService Service ServiceService Service ServiceService
  40. 40. 1. 2. 3. 4. 5. 6. 1 7. 8. ( ) 8 Source: https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing Photo: Icon made by Freepik from www.flaticon.com Service Service Library Library
  41. 41. MICROSERVICES EVOLUTION Service Config Svc Discovery Routing Circuit Breaker Tracing Service Platform Container Platform (+ Service Mesh) ...2014 2018
  42. 42. POD ENVOY SERVICE POD ENVOY SERVICE POD ENVOY SERVICE Pilot Mixer Auth SERVICE MESH ARCHITECTURE Applies security, route rules, policies and reports traffic telemetry at the pod level JaegerControl Plane Data Plane
  43. 43. Service Mesh ● ● ● ● ● ● Blue/Green ● ● ● IaaS Mesh Pod/Container Mesh
  44. 44. Tech Preview Istio - istiooc ● istiooc cluster up --istio --launcher ● Istio kiali ● launcher ROAHR on Istio https://github.com/openshift-istio/origin
  45. 45. ) 50
  46. 46. Red Hat Red Hat OpenShift Container Platform minishift Red Hat Container Development Kit OpenShift Online(Payed Plan) OpenShift Origin OpenShift Dedicated OpenShift Online(Free)
  47. 47. ( ( ( ) https://learn.openshift.com/ https://courses.edx.org/courses/course -v1:RedHat+DO081x+2T2017/course/
  48. 48. D - ( . - - . / - - ( . )- :- - . - - - :-
  49. 49. ) 5 4 • DC • DC P K H ( ) 4 5 5 5) https://developers.redhat.com/products/cdk/download/

×
Save this presentationTap To Close