ãã®èšäºã¯ãRed Hatã®ã¢ãŒããã¯ãã§ãããããã€ãã®Apacheãããžã§ã¯ãã«ç©æ¥µçã«åå ããŠãããCamel Design Patternsããã³Kubernetes Patternsã®èè ã§ããBilgin Ibryamãäœæããå ã®ææžïŒ PDF ïŒã®éèªçãªç¿»èš³ã§ã¯ãããŸããããäž»ãªãã€ã³ããæ瀺ããŠããããšã«æ³šæããŠãã ããããªãç¡æã®ãã¬ãŒã³ããŒã·ã§ã³ã§ã
ååãšããŠãã¯ã©ãŠãããŒã¹ïŒã¯ã©ãŠããã€ãã£ãïŒã¢ããªã±ãŒã·ã§ã³ã§ã¯ãé害ãäºèŠãããåºç€ãšãªãã€ã³ãã©ã¹ãã©ã¯ãã£ã«åé¡ãçºçããŠããå Žåã§ãæ©èœãšã¹ã±ãŒãªã³ã°ãå¯èœã§ãã ãããå¯èœã«ããããã«ããã®ãããªã¢ããªã±ãŒã·ã§ã³ãå®è¡ããããã«èšèšããããã©ãããã©ãŒã ã¯ããããã§èµ·åãããã¢ããªã±ãŒã·ã§ã³ã«ç¹å®ã®çŸ©åãšå¶éã課ããŸãã èŠããã«ãã¢ããªã±ãŒã·ã§ã³ã¯ã³ã³ããã«å ¥ããŠå®è¡ããã ãã§ã¯ååã§ã¯ãããŸãããKubernetesã®ãããªãã©ãããã©ãŒã ã§å¹ççã«ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ãè¡ãã«ã¯ãè¿œå ã®äœæ¥ãå¿ èŠã§ãã 圌ãã¯ã©ããªäººã§ããïŒ
ã¯ã©ãŠããã€ãã£ãã¢ããªã±ãŒã·ã§ã³ãžã®Red Hatã¢ãããŒã
ããã§ææ¡ãããŠããã¢ã€ãã¢ã¯ãä»ã®ããŸããŸãªäœåã«è§ŠçºãããŠããŸãïŒäŸïŒ
Twelve-Factor App ïŒããœãŒã¹ç®¡çããã¢ããªã±ãŒã·ã§ã³ã¹ã±ãŒã©ããªãã£ã¢ãã«ãŸã§ãå€ãã®åéãã«ããŒããŠããŸãã ãã ããããã§èª¬æããååã®ç¯å²ã¯ãKubernetesãªã©ã®ã¯ã©ãŠããã€ãã£ããã©ãããã©ãŒã åãã®ãã€ã¯ããµãŒãã¹ããŒã¹ã®ã³ã³ãããŒåã¢ããªã±ãŒã·ã§ã³ã®èšèšã«éå®ãããŸãã
ãã¹ãŠã®ååã®èª¬æã§ã¯ãã³ã³ããã€ã¡ãŒãžãã¡ã€ã³ããªããã£ããšããŠäœ¿çšãããã³ã³ãããªãŒã±ã¹ãã¬ãŒã·ã§ã³ãã©ãããã©ãŒã ãèµ·åã®ã¿ãŒã²ããç°å¢ãšããŠäœ¿çšãããŸãã ãããã®ååã«åŸãããšã¯ãã³ã³ãããïŒãããã«åŸã£ãŠæºåãããïŒã»ãšãã©ã®ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ãšã³ãžã³ãã€ãŸã ã¹ã±ãžã¥ãŒã©ã«ãã£ãŠæäŸãããèªåçã«ã¹ã±ãŒãªã³ã°ããã³ç£èŠãããŸãã ååã¯ãïŒåªå é äœã§ã¯ãªãïŒã©ã³ãã ã«ãªã¹ããããŠããŸãã
1.åäžæžå¿µååïŒSCPïŒ
å€ãã®ç¹ã§ãSCPã¯SOLIDã®åäžè²¬ä»»ååïŒSRPïŒã«äŒŒãŠããŸãããã㯠ãåã¯ã©ã¹ã«1ã€ã®è²¬ä»»ãå¿ èŠã§ããããšã瀺ããŠããŸãã SRPã®èåŸã«ããåæ©-ã¯ã©ã¹ã®å€æŽã«ã€ãªããçç±ã¯1ã€ã ãã§ãã
ãæžå¿µããšããèšèïŒãæžå¿µãããæžå¿µãããé¢å¿ãããã¿ã¹ã¯ããšèš³ãããïŒã¯ã æžå¿µã責任ãããé«ãæœè±¡åã¬ãã«ã§ããããšã匷調ããŸããããã¯ãã³ã³ããã®ã¿ã¹ã¯ã®ç¯å²ãããããè¡šããŸãïŒã¯ã©ã¹ãšæ¯èŒïŒã SRPã®äž»ãªåæ©ãå€æŽã®å¯äžã®çç±ã§ããå ŽåãSCPã®å Žåãã³ã³ããã€ã¡ãŒãžãšãã®äº€æå¯èœæ§ãåå©çšã§ããŸãã 1ã€ã®ã¿ã¹ã¯ãæ åœããã³ã³ãããäœæãããããå®å šã«è§£æ±ºãããšãä»ã®ç¶æ³ã§ãã®ã€ã¡ãŒãžãåå©çšããå¯èœæ§ãé«ããªããŸãã
äžè¬ã«ãSCPã®ååã¯ãåã³ã³ãããåäžã®åé¡ã解決ãããããããŸããããªããã°ãªããªãããšã瀺ããŠããŸãïŒUNIXå²åŠããã®å€å ž-DOTADIW ãã1ã€ã®ããšãããŠããããããŸãããã- çŽ ã ãã€ã¯ããµãŒãã¹ãå€ãã®åé¡ãæ åœããå¿ èŠãããå Žåããµã€ãã«ãŒãinitã³ã³ãããŒãªã©ã®ãã¿ãŒã³ã䜿çšããŠãå€ãã®ã³ã³ãããŒãåäžã®ãããã€å¯èœãªãã©ãããã©ãŒã ïŒäžïŒã«çµåããåã³ã³ãããŒãåäžã®ã¿ã¹ã¯ã«é¢äžãç¶ããããšãã§ããŸãã
2.é«å¯èŠ³æž¬æ§åçïŒHOPïŒ
ã³ã³ããã¯ãã¢ããªã±ãŒã·ã§ã³ãããã±ãŒãžåããŠå®è¡ããããã®çµ±äžãããæ¹æ³ã§ãããã¢ããªã±ãŒã·ã§ã³ããã©ãã¯ããã¯ã¹ã«å€ããŸãã ãã ããã³ã³ããã¯ãå®è¡ããç°å¢ã«ã¢ããªã±ãŒã·ã§ã³ããã°ã©ãã³ã°ã€ã³ã¿ãŒãã§ã€ã¹ïŒAPIïŒãæäŸããå¿ èŠããããã³ã³ããã®ç¶æ ãšåäœãç£èŠã§ããããã«ããŸãã ããã¯ãã³ã³ããã®æŽæ°ãèªååããã©ã€ããµã€ã¯ã«ãç¶æããããã®åææ¡ä»¶ã§ãã
å®çšçãªèŠ³ç¹ãããã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã¯ãå°ãªããšãïŒå°ãªããšãïŒïŒç¶æ ã®ããŸããŸãªãã§ãã¯ã®ããã®APIãæäŸããå¿ èŠããããŸãïŒ æŽ»æ§ ïŒæäœæ§ïŒãšæºå ïŒãµãŒãã¹èŠæ±ã«å¯ŸããæºåïŒã ããã«è¯ãããšã«ãã¢ããªã±ãŒã·ã§ã³ã®ã¹ããŒã¿ã¹ãç£èŠããä»ã®æ¹æ³ãæäŸãããŠããå Žå-ç¹ã«ãFluentdãLogstashãªã©ã®ãŠãŒãã£ãªãã£ã䜿çšããéèŠãªã€ãã³ããSTDERRããã³STDOUTã«èšé²ããã¡ããªãã¯ãæ§ç¯ããããã®ããŒã«ãšã®çµ±åïŒOpenTracingãPrometheusãªã©
çµè«ã¯æ¬¡ã®ãšããã§ããã¢ããªã±ãŒã·ã§ã³ããã©ãã¯ããã¯ã¹ãšããŠæ±ããŸããããã©ãããã©ãŒã ãã¢ããªã±ãŒã·ã§ã³ãç£èŠããå¯èœãªéã管çããããã«å¿ èŠãªãã¹ãŠã®APIãå®è£ ããŸãã
3.ã©ã€ããµã€ã¯ã«é©åæ§ååïŒLCPïŒ
HOPããã©ãããã©ãŒã ããèªã¿åããããšãã§ããAPIã®æäŸã«ã€ããŠè©±ãå ŽåãLCPã¯è£è¿ãã§ããã¢ããªã±ãŒã·ã§ã³ã¯ãã©ãããã©ãŒã ããã®ã€ãã³ãã«ã€ããŠåŠç¿ã§ããã¯ãã§ãã ããã«ããããã«ã€ããŠåŠã¶ã ãã§ãªãããããã«å¯Ÿå¿ããããšãããã®ååã®ååã®ç±æ¥ã§ãïŒãé©åãã¯ãé©åãããåæãããèŠåã«åŸãããšèš³ãããŸãïŒ ã
管çãã©ãããã©ãŒã ã«ã¯ãã³ã³ããã®ã©ã€ããµã€ã¯ã«ã®ç®¡çã«åœ¹ç«ã€å€ãã®ã€ãã³ããå«ããããšãã§ããŸãããäžéšã®ã€ãã³ãã¯ä»ã®ã€ãã³ããããéèŠã§ãã ããšãã°ãããã»ã¹ãæ£ããå®äºããã«ã¯ãã¢ããªã±ãŒã·ã§ã³ãé©åãªã·ã°ãã«ïŒSIGTERMïŒã§ã¡ãã»ãŒãžãåä¿¡ããŠââãSIGKILLãä»ããäœæ¥ã®ç·æ¥çµäºãåé¿ããå¿ èŠããããŸãã ä»ã«ãéèŠãªã€ãã³ãããããŸããããšãã°ãPostStartãPreStopã¯ãæäœã®éå§æã«ã¢ããªã±ãŒã·ã§ã³ãããŠã©ãŒã ã¢ãããããããéã«çµäºæã«ãªãœãŒã¹ã解æŸããããã«å¿ èŠã§ãã
4.ã€ã¡ãŒãžäžå€æ§ã®ååïŒIIPïŒ
ã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã§ã¯ãäžå€æ§ãå®ããããŠããŸãããããã¯äžåºŠåéãããåŸãç°ãªãç°å¢ã§å€æŽãªãã«èµ·åãããŸãã ããã¯ãäœæ¥ã§äœ¿çšãããããŒã¿ãä¿åããããã®å€éšããŒã«ã®äœ¿çšãããã³ç°ãªãç°å¢çšã®ããŸããŸãªæ§æã®äœæ/é©çšãæå³ããŸãã ã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã®å€æŽã¯ããã¹ãŠã®ç°å¢ã§äœ¿çšãããæ°ããã³ã³ããã€ã¡ãŒãžã®ã¢ã»ã³ããªã«ã€ãªããã¯ãã§ãã äžå€ã€ã³ãã©ã¹ãã©ã¯ãã£ãšåŒã°ããåãååãããµãŒããŒã€ã³ãã©ã¹ãã©ã¯ãã£ã®ç®¡çã«äœ¿çšãããŸãã
5.ããã»ã¹ã®äœ¿ãæšãŠã®ååïŒPDPïŒ
ã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã«åãæ¿ããäž»ãªçç±ã®1ã€ã¯ãã³ã³ããã®å¯¿åœãã§ããã ãçããããã€ã§ãå¥ã®ã³ã³ãããšäº€æã§ããããã«ããããšã§ãã ã³ã³ããã眮ãæããå€ãã®çç±ããããŸãïŒç¶æ ã®ç¢ºèªãã¢ããªã±ãŒã·ã§ã³ã®ã¹ã±ãŒã«ããŠã³ãå¥ã®ãã¹ããžã®ç§»è¡ããªãœãŒã¹ã®äžè¶³...
ãããã£ãŠãã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã¯ãç¶æ ãåæ£ããã³åé·ã«ä¿ã€å¿ èŠããããŸãã ããã«ãã¢ããªã±ãŒã·ã§ã³ã¯è¿ éã«éå§ããã³åæ¢ããå¿ èŠããããçªç¶ã®ïŒãããŠå®å šãªïŒããŒããŠã§ã¢é害ã«åããŠããæºåããå¿ èŠããããŸãã ãã®ååãå®è£ ãããã1ã€ã®åªããæ¹æ³ã¯ã次ã®ããã«å°ããªã³ã³ãããäœæããããšã§ã ã³ã³ããã¯ç°ãªããã¹ãã§èªåçã«èµ·åããããµã€ãºãå°ãããšèµ·åæéãççž®ãããŸãïŒæåã«ãã¹ãã·ã¹ãã ã«ç©ççã«ã³ããŒããå¿ èŠãããããïŒã
6.èªå·±æå¶ååïŒS-CPïŒ
ã³ã³ããã«ã¯ãLinuxã«ãŒãã«ã®ååšã®ã¿ã«äŸåããŠãã¢ã»ã³ããªæã«å¿ èŠãªãã®ããã¹ãŠå«ãŸããŠããå¿ èŠããããŸãïŒãã¹ãŠã®è¿œå ã©ã€ãã©ãªã¯ãã¢ã»ã³ããªæã«ã衚瀺ããããŸãïŒã ããã¯ãã©ã€ãã©ãªã«å ããŠãå®è¡å¯èœãªããã°ã©ãã³ã°èšèªç°å¢ãã¢ããªã±ãŒã·ã§ã³ãã©ãããã©ãŒã ïŒäœ¿çšããå ŽåïŒãããã³ã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ãå®è¡ããããã®ãã®ä»ã®äŸåé¢ä¿ãå«ããå¿ èŠãããããšãæå³ããŸãã å¯äžã®äŸå€ã¯ãç°å¢ã«ãã£ãŠç°ãªãèšå®ã§ãããèµ·åæã«æäŸããå¿ èŠããããŸãïŒããšãã°ãKubernetesã®
ConfigMap
ïŒã
äžéšã®ã¢ããªã±ãŒã·ã§ã³ã¯ãå€ãã®ã³ã³ããåãããã³ã³ããŒãã³ãã§æ§æãããŠããŸãã ããšãã°ãã³ã³ããåãããWebã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããŒã¿ããŒã¹ãå«ãã³ã³ãããå¿ èŠã«ãªãå ŽåããããŸãã ãã®ååã¯ãã³ã³ãããçµåããããšãæäŸããŠããŸãããããŒã¿ããŒã¹ãåããã³ã³ããã ãããã®æäœã«å¿ èŠãªãã¹ãŠãåããWebã¢ããªã±ãŒã·ã§ã³ãåããã³ã³ããã¯Webã¢ããªã±ãŒã·ã§ã³ïŒWebãµãŒããŒãªã©ïŒã®ãã¹ãŠãåããŠããå¿ èŠããããŸãã
7.ã©ã³ã¿ã€ã å¶éã®ååïŒRCPïŒ
S-CPã®ååã§ã¯ãã¢ã»ã³ããªæéãšçµæã®ãã€ããªã®å 容ã®èŠ³ç¹ããã³ã³ãããèæ ®ããŸãããã³ã³ããã¯ãã£ã¹ã¯äžã«ãã1次å ã®ãã©ãã¯ããã¯ã¹ã§ã¯ãããŸããã ã³ã³ããã®ãã®ä»ã®ã枬å®å€ãã¯ãèµ·åæã«è¡šç€ºãããŸã-ãããã¯ãã¡ã¢ãªãããã»ããµããã®ä»ã®ãªãœãŒã¹ã®æ¶è²»éã®ã枬å®å€ãã§ãã
ã³ã³ããã¯ãªãœãŒã¹èŠä»¶ã宣èšãããã®æ å ±ããã©ãããã©ãŒã ã«éä¿¡ããå¿ èŠããããŸããããã¯ãCPUãã¡ã¢ãªããããã¯ãŒã¯ããã£ã¹ã¯ã«å¯Ÿãããªã¯ãšã¹ãããã©ãããã©ãŒã ã®èšç»ãèªåã¹ã±ãŒãªã³ã°ããªãœãŒã¹ç®¡çã®å®è¡ã«åœ±é¿ããã³ã³ããã®äžè¬çãªSLAã¬ãã«ãæäŸããããã§ãã ããã«ãã¢ããªã±ãŒã·ã§ã³ãããã«å²ãåœãŠããããªãœãŒã¹ã«é©åããããšãéèŠã§ãã ãªãœãŒã¹ãäžè¶³ããŠããå Žåããã©ãããã©ãŒã ã¯ãã®ãããªã³ã³ãããåæ¢ãŸãã¯ç§»è¡ããå¯èœæ§ãäœããªããŸãã
ãã®ä»ã®æšå¥šäºé
ãããã®ååã«å ããŠãã³ã³ããã«é¢é£ããåºæ¬çã§ã¯ãªãããããã§ãæçšãªããšãå€ããã©ã¯ãã£ã¹ãææ¡ãããŠããŸãã
- å°ããç»åãæ¢ããŸãã äžæãã¡ã€ã«ãåé€ããäžèŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããªãã§ãã ããã ããã«ãããã³ã³ãããŒã®ãµã€ãºã ãã§ãªãããã«ãæéãããã³ã€ã¡ãŒãžãã³ããŒãããšãã«ãããã¯ãŒã¯çµç±ã§ããŒã¿ã転éããã®ã«ãããæéãåæžãããŸãã
- UIDããµããŒãããŸãã sudoã³ãã³ãã䜿çšããããç¹å®ã®ãŠãŒã¶ãŒ/ UIDã䜿çšããŠã³ã³ãããŒãèµ·åãããããããšã¯é¿ããŠãã ããã
- éèŠãªããŒããããŒã¯ããŸãã
EXPOSE
ã³ãã³ãã§ã©ãã«ãä»ãããšã人ãšãœãããŠã§ã¢ã®äž¡æ¹ã§ã€ã¡ãŒãžãç°¡åã«äœ¿çšã§ããŸãã - æ°žç¶çãªããŒã¿ã«ããªã¥ãŒã ã䜿çšããŸãïŒã³ã³ããã®ç Žæ£åŸãä¿æããå¿ èŠãããïŒã
- ã¿ã°ãã©ãã«ã泚éã䜿çšããŠãç»åã®ã¡ã¿ããŒã¿ãå®çŸ©ããŸãã ããã«ãããéçºè ã«ããä»åŸã®äœ¿çšãç°¡çŽ åãããŸãã
- ãã¹ããšã€ã¡ãŒãžãåæããŸãã ã³ã³ããåãããã¢ããªã±ãŒã·ã§ã³ã®äžã«ã¯ãç¹å®ã®å±æ§ïŒæéããã·ã³IDãªã©ïŒã®ããã«ãã¹ããšåæããå¿ èŠãããå ŽåããããŸãã
ãããã¯ã«é¢ãããã¿ãŒã³ãšãã¹ããã©ã¯ãã£ã¹ã«é¢ããè¿œå ãªãœãŒã¹ãžã®ãªã³ã¯ïŒ
- ã³ã³ãããã¿ãŒã³ ïŒããã£ã¢ã¹ãªã¥ãŒãã±ã³ïŒ ;
- Dockerfiles ïŒDockerïŒ ãäœæããããã®ãã¹ããã©ã¯ãã£ã¹
- ã³ã³ããã®ãã¹ããã©ã¯ãã£ã¹ ïŒãããžã§ã¯ãã¢ãããã¯ïŒ ;
- OpenShift Enterprise 3.0ã€ã¡ãŒãžäœæã¬ã€ãã©ã€ã³ ïŒRed HatïŒ ;
- ã³ã³ããããŒã¹ã®åæ£ã·ã¹ãã ã®èšèšãã¿ãŒã³ ïŒBrendan BurnsãDavid OppenheimerïŒ ;
- Kubernetes Patterns ïŒBilgin IbryamãRolandHuÃïŒ ;
- 12å åã¢ã㪠ïŒAdam WigginsïŒ
翻蚳è ããã®PS
ãããã®ååã®äžéš-ç¹ã«ãããã¹ãŠãæ¯é ãã1ã€ã®ã€ã¡ãŒãžããšåŒã°ããç»åäžå€æ§ååïŒIIPïŒãããã³èªå·±æå¶ååïŒS-CPïŒã¯ãã¬ããŒãã ãã¹ãCI / KubernetesãšGitLabãåé²ããCD ã ïŒãªã³ã¯ããã¹ãã¹ã¯ã€ãŒãºãšãã«ãããªïŒ ã
ããã°ãã芧ãã ããã
- ã 2018幎ã®ãã€ã¯ããµãŒãã¹ããããã¹ã®æ» ã
- ã ã¯ã©ãŠããã€ãã£ãåãã®ãªãŒãã³ãœãŒã¹ãœãªã¥ãŒã·ã§ã³ïŒããã³ãã®ä»ïŒã®CNCFã¬ã€ã ã;
- ã äœäººã®éçºè ãç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ã¯å¿ èŠãªããšèããŠããŸããïŒ ";
- ã å°èŠæš¡ãããžã§ã¯ãã§ã®Kubernetesã§ã®çµéš ã ïŒãããªã¬ããŒããKubernetesæè¡ããã€ã¹ã®çŽ¹ä»ãå«ãïŒã