ãã®å³ã§ãã³ãã¬ãŒãæ©èœã®ã¿ãç·è²ã§åŒ·èª¿è¡šç€ºãããŠããçç±ãšãã¢ã»ã³ããªãšããã±ãŒãžã³ã°ãç°å¢ã®èªååãªã©ã®åé¡ãèŠãŠã¿ãŸãããã ããããå¿é ããªãã§ãã ãããèšäºã¯ãã¹ãŠãæªããšããäºå®ã§çµããããã§ã¯ãããŸããã ã³ãã¥ããã£ã¯ããã«åæã§ããã代æ¿ããŒã«ãšãœãªã¥ãŒã·ã§ã³ãæäŸããŸã-ç§ãã¡ã¯ãããã«å¯ŸåŠããŸãã
Ivan Glushkov ïŒ gli ïŒã¯ããã®è©³çŽ°ãªãã¬ãŒã³ããŒã·ã§ã³ã®ãããªããã³ããã¹ãçã§ããRIT ++ã«é¢ãã圌ã®ã¬ããŒãã§ãããæäŒã£ãŠãããŸããã
RIT ++ã§ã®ãã®ãããªããã³ãã®ä»ã®DevOpsã¹ããŒãã®ãããªã¯å ¬éãããŠããã YouTubeãã£ã³ãã«ã§ç¡æã§èŠèŽã§ããŸããäœæ¥äžã®è³ªåã«å¯Ÿããåçãæ¢ããŠãã ããã
ã¹ããŒã«ãŒã«ã€ããŠïŒ Ivan Glushkovã¯15幎éãœãããŠã§ã¢ãéçºããŠããŸãã ç§ã¯MZãEchoã§ã³ã¡ã³ãçšã®ãã©ãããã©ãŒã ã§åããŠãMCSTã®Elbrusããã»ããµçšã®ã³ã³ãã€ã©ã®éçºã«åå ããŸããã 圌ã¯çŸåšãPostmatesã®ã€ã³ãã©ã¹ãã©ã¯ãã£ãããžã§ã¯ãã«é¢äžããŠããŸãã Ivanã¯äž»èŠãªDevZenããããã£ã¹ãã®1ã€ã§ãããäŒè°ã«ã€ããŠèª¬æããŠããŸãã ããã§ã¯RIT ++ã«ã€ããŠã ããã§ã¯HighLoad ++ã«ã€ããŠèª¬æããŸãã
ããã±ãŒãžãããŒãžã£ãŒ
誰ããäœããã®ããã±ãŒãžãããŒãžã£ãŒã䜿çšããŠããŸããããããäœã§ãããã«ã€ããŠã®åäžã®åæã¯ãããŸããã å ±éã®ç解ããããããããã«ç¬èªã®ç解ããããŸãã
ã©ã®ã¿ã€ãã®ããã±ãŒãžãããŒãžã£ãŒãæåã«æãæµ®ãã¶ã®ãæãåºããŠã¿ãŸãããã
- ãã¹ãŠã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®æšæºããã±ãŒãžãããŒãžã£ãŒïŒ rpmãdpkgãportageãªã©
- ããŸããŸãªããã°ã©ãã³ã°èšèªã®ããã±ãŒãžãããŒãžã£ãŒïŒ cargoãcabalãrebar3ãmix ã...
äž»ãªæ©èœã¯ãããã±ãŒãžã®ã€ã³ã¹ããŒã«ãããã±ãŒãžã®æŽæ°ãããã±ãŒãžã®ã¢ã³ã€ã³ã¹ããŒã«ãããã³äŸåé¢ä¿ã®ç®¡çã®ããã®ã³ãã³ããå®è¡ããããšã§ãã ããã°ã©ãã³ã°èšèªå ã®ããã±ãŒãžãããŒãžã£ãŒã§ã¯ãäºæ ã¯ããå°ãè€éã§ãã ããšãã°ããããã±ãŒãžã®èµ·åããããªãªãŒã¹ã®äœæãïŒãã«ã/å®è¡/ãªãªãŒã¹ïŒãªã©ã®ã³ãã³ãããããŸãã ããã¯æ¢ã«ãã«ãã·ã¹ãã ã§ãããããã±ãŒãžãããŒãžã£ãŒãšãåŒã°ããŠããŸãã
ããã¯ãã¹ãŠãããªããããããã åãããšãã§ããªããšããäºå®ã«ããã ãã§ã...ãããŠãHaskellæ奜家ã«ãã®æ¯èŒãèš±ãããŠãã ããã ãã€ããªãã¡ã€ã«ã¯å®è¡ã§ããŸãããHaskellãŸãã¯Cã§ããã°ã©ã ãå®è¡ããããšã¯ã§ããŸãããæåã«äœããã®æ¹æ³ã§æºåããå¿ èŠããããŸãã ãããŠããã®æºåã¯ããªãè€éã§ããããŠãŒã¶ãŒã¯ãã¹ãŠãèªåçã«è¡ãããããšãæãã§ããŸãã
éçº
å€æ°ã®ã³ã³ããŒãã³ãã§æ§æããã倧èŠæš¡ãããžã§ã¯ãçšã«äœæãããGNU libtoolã䜿çšãã人ã¯ããµãŒã«ã¹ãç¬ããªãã ããã¯æ¬åœã«éåžžã«é£ãããããã€ãã®ã±ãŒã¹ã¯ååçã«è§£æ±ºã§ãããåé¿ããããšããã§ããŸããã
ããã«æ¯ã¹ãŠãRustã®è²šç©ã®ãããªææ°ã®ããã±ãŒãžèšèªãããŒãžã£ãŒã¯ã¯ããã«äŸ¿å©ã§ãããã¿ã³ãæŒãã ãã§ãã¹ãŠãæ©èœããŸãã å®éã«ã¯ãå éšã§ã¯å€ãã®åé¡ã解決ãããŠããŸãã ããã«ããããã®ãã¹ãŠã®æ°ããæ©èœã«ã¯ãç¹ã«ããŒã¿ããŒã¹ãªã©ã®è¿œå æ©èœãå¿ èŠã§ãã ããã±ãŒãžãããŒãžã£ãŒèªäœã§ã¯ä»»æã®ååãä»ããããšãã§ããŸãããããŒã¿ããŒã¹ãšåŒãã§ããŸãã ããŒã¿ã¯ããã«ä¿åãããŸãïŒã€ã³ã¹ããŒã«ãããããã±ãŒãžããããã®ããŒãžã§ã³ãæ¥ç¶ããããªããžããªããããã®ãªããžããªã®ããŒãžã§ã³ã«ã€ããŠã ãããã¯ãã¹ãŠã©ããã«ä¿åããå¿ èŠããããããå éšããŒã¿ããŒã¹ããããŸãã
ãã®ããã°ã©ãã³ã°èšèªã§ã®éçºããã®ããã°ã©ãã³ã°èšèªã®ãã¹ããéå§-ãã¹ãŠãçµã¿èŸŒãŸããå éšã«ããããã äœæ¥ã¯éåžžã«äŸ¿å©ã«ãªããŸã ã ã»ãšãã©ã®çŸä»£èšèªã¯ãã®ã¢ãããŒãããµããŒãããŠããŸãã æ¯æããªãã£ã人ã§ãããæ¯æãå§ããŸãããªããªããã³ãã¥ããã£ã¯ãçŸä»£äžçã§ã¯ãããªãã§ã¯äžå¯èœã ãšäž»åŒµããŠããããã§ãã
ããããã©ã®ãœãªã¥ãŒã·ã§ã³ã«ãåžžã«å©ç¹ãããã ãã§ãªããæ¬ ç¹ããããŸãã ããã§ã®æ¬ ç¹ã¯ãã©ãããŒãè¿œå ã®ãŠãŒãã£ãªãã£ãããã³çµã¿èŸŒã¿ã®ãããŒã¿ããŒã¹ããå¿ èŠãªããšã§ãã
Docker
Dockerã¯ããã±ãŒãžãããŒãžã£ãŒã§ãããšæããŸããïŒ
ã©ããªæ¹æ³ã§ããåºæ¬çã«ã¯ã¯ãã ã¢ããªã±ãŒã·ã§ã³ããã¹ãŠã®äŸåé¢ä¿ãšå®å šã«çµã¿åãããŠããã¿ã³ãã¯ãªãã¯ããã ãã§æ©èœãããããã®ãããæ£ç¢ºãªãŠãŒãã£ãªãã£ã¯ç¥ããŸããã ããã±ãŒãžãããŒãžã£ãŒã§ãªãå Žåãããã¯äœã§ããïŒ ããã¯çŽ æŽãããããã±ãŒãžãããŒãžã£ãŒã§ãïŒ
ããã·ã ã»ã©ãã·ã³ã¯ããã§ã«Dockerã䜿çšããããšã§ã¯ããã«ç°¡åã«ãªã£ããšè¿°ã¹ãŠããŸãã Dockerã«ã¯ãçµã¿èŸŒã¿ã®ãã«ãã·ã¹ãã ãããããã¹ãŠã®ããŒã¿ããŒã¹ããã€ã³ãã£ã³ã°ããŠãŒãã£ãªãã£ããããŸãã
ãã¹ãŠã®ç¹å žã®äŸ¡æ Œã¯ãããã§ããïŒ Dockerã䜿çšãã人ã¯ãç£æ¥çšã¢ããªã±ãŒã·ã§ã³ã«ã€ããŠã»ãšãã©èããŸããã ç§ã¯ãã®ãããªçµéšããããå®éã«äŸ¡æ Œã¯éåžžã«é«ãã§ãïŒ
- Dockerã€ã¡ãŒãžã«ä¿åããå¿ èŠãããæ å ±ã®é ïŒã€ã¡ãŒãžãµã€ãºïŒã ãã¹ãŠã®äŸåé¢ä¿ããŠãŒãã£ãªãã£ã®äžéšãã©ã€ãã©ãªãå éšã«ããã¯ããå¿ èŠããããŸããã€ã¡ãŒãžã¯å€§ããããããæäœã§ããå¿ èŠããããŸãã
- ãã©ãã€ã ã·ãããè¡ãããŠããããšã¯ãã¯ããã«è€éã§ãã
ããšãã°ã1ã€ã®ããã°ã©ã ã転éããŠDockerã䜿çšããã¿ã¹ã¯ããããŸããã ããã°ã©ã ã¯ããŒã ã«ãã£ãŠé·å¹Žã«ããã£ãŠéçºãããŸããã ç§ã¯æ¥ãŸããç§ãã¡ã¯æ¬ã«æžãããŠãããã¹ãŠãããŸãïŒç§ãã¡ã¯ãŠãŒã¶ãŒã®ç©èªã圹å²ãæãã圌ããäœãã©ã®ããã«è¡ããã圌ãã®æšæºçãªã«ãŒãã³ãæããŸãã
ç§ã¯èšãïŒ
-Dockerã¯ãã¹ãŠã®åé¡ã解決ã§ããŸãã ãããã©ã®ããã«è¡ãããããèŠãŠãã ããã
-ãã¹ãŠããã¿ã³ã«è¡šç€ºãããŸã-ãã°ãããïŒ ããããKubernetesã³ã³ããå ã§SSHãå®è¡ããããšèããŠããŸãã
-åŸ ãŠãSSHã¯ã©ãã«ããããŸããã
-ã¯ããã¯ãããã¹ãŠãããŸããããŸã...ããããSSHã¯å¯èœã§ããïŒ
ãŠãŒã¶ãŒã®èªèãæ°ããæ¹åã«å€ããã«ã¯ãå€ãã®æéãããããæè²äœæ¥ãšå€å€§ãªåªåãå¿ èŠã§ãã
ãã1ã€ã®äŸ¡æ ŒèŠå ã¯ã Dockerã¬ãžã¹ããªãã€ã¡ãŒãžã®å€éšãªããžããªã§ãããäœããã®æ¹æ³ã§ã€ã³ã¹ããŒã«ããã³å¶åŸ¡ããå¿ èŠãããããšã§ãã ç¬èªã®åé¡ãã¬ããŒãžã³ã¬ã¯ã¿ãŒãªã©ããããããã«åŸããªãå Žåã¯ãã°ãã°èœã¡ãŸãããããã¯ãã¹ãŠè§£æ±ºãããŸãã
ã¯ãã«ããã¹
ãã£ãšKubernetesã«çããŸããã ããã¯ãã³ãã¥ããã£ã«ãã£ãŠç©æ¥µçã«ãµããŒããããŠããã¯ãŒã«ãªãªãŒãã³ãœãŒã¹ã®ã¢ããªã±ãŒã·ã§ã³ç®¡çã·ã¹ãã ã§ãã å ã ã¯1ã€ã®äŒç€ŸãèŸããŠããŸããããKubernetesã«ã¯å·šå€§ãªã³ãã¥ããã£ããããããã«è¿œãã€ãããšã¯äžå¯èœã§ãããå®è³ªçã«ä»£æ¿æ段ã¯ãããŸããã
èå³æ·±ãããšã«ããã¹ãŠã®KubernetesããŒãã¯ã³ã³ãããä»ããŠKubernetesèªäœã§åäœãããã¹ãŠã®å€éšã¢ããªã±ãŒã·ã§ã³ã¯ã³ã³ãããä»ããŠåäœããŸãããã¹ãŠãã³ã³ãããä»ããŠåäœããŸã ã ããã¯ãã©ã¹ãšãã€ãã¹ã®äž¡æ¹ã§ãã
Kubernetesã«ã¯ãåæ£æ§ããã©ãŒã«ããã¬ã©ã³ã¹ãããŸããŸãªã¯ã©ãŠããµãŒãã¹ãšé£æºããæ©èœããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã«çŠç¹ãåœãŠãæ©èœãªã©ãå€ãã®äŸ¿å©ãªæ©èœãšããããã£ããããŸãã ãããã¯ãã¹ãŠé¢çœããŠã¯ãŒã«ã§ãããKubernetesã«ã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ããæ¹æ³ã¯ïŒ
ã¢ããªã±ãŒã·ã§ã³ã®ã€ã³ã¹ããŒã«æ¹æ³ã¯ïŒ
Docker-registryã«Dockerã€ã¡ãŒãžãã€ã³ã¹ããŒã«ããŸãã
ãã®ãã¬ãŒãºã®èåŸã«ã¯æ·±aããããŸãã æ³åããŠãã ãããããšãã°ãRubyã§èšè¿°ãããã¢ããªã±ãŒã·ã§ã³ããããDockerã¬ãžã¹ããªã«Dockerã€ã¡ãŒãžãé 眮ããå¿ èŠããããŸãã ã€ãŸãã次ã®ããšãè¡ãå¿ èŠããããŸãã
- Dockerã€ã¡ãŒãžãæºåãã
- ãããã©ã®ããŒãžã§ã³ã«åºã¥ããŠããã®ããç解ããŸã;
- ããããã¹ãããããšãã§ããŸã;
- åéãã以åã«ã€ã³ã¹ããŒã«ããDocker-registryã«å ¥åããŸãã
å®éãããã¯1è¡ã§å€§ããªã倧ããªçã¿ã§ãã
ããã«ãã¢ããªã±ãŒã·ã§ã³ãããã§ã¹ããk8ã®çšèªïŒãªãœãŒã¹ïŒã§èšè¿°ããå¿ èŠããããŸãã æãç°¡åãªãªãã·ã§ã³ïŒ
- å±é+ãããããµãŒãã¹+ã€ã³ã°ã¬ã¹ïŒããããïŒã説æããŸãã
- kubectl apply -f resources.yamlã³ãã³ããå®è¡ãããã¹ãŠã®ãªãœãŒã¹ããã®ã³ãã³ãã«è»¢éããŸãã
ã¬ã³ãžãŒã¯ã¹ã©ã€ããæã§ããããŸã-Kubernetesã§ããã±ãŒãžãããŒãžã£ãŒãèŠã€ããããã§ãã ãã ããkubectlã¯ããã±ãŒãžãããŒãžã£ãŒã§ã¯ãããŸããã 圌ã¯ãç§ããã®ãããªã·ã¹ãã ã®æçµç¶æ ãèŠãããšèšã£ãŠããã ãã§ãã ããã¯ããã±ãŒãžãã€ã³ã¹ããŒã«ããããäŸåé¢ä¿ãåŠçãããããã«ããããããã®ã§ã¯ãªããåã«ããã®æçµç¶æ ãèŠãããã ãã§ãã
ãã«ã
ã€ãã«ãã«ã ã«æ¥ãŸããã Helmã¯å€ç®çãŠãŒãã£ãªãã£ã§ãã ããã§ãHelmã®éçºã®ã©ã®é åãæ€èšããHelmãšååããŸãã
ãã³ãã¬ãŒããšã³ãžã³
ãŸããHelmã¯ãã³ãã¬ãŒããšã³ãžã³ã§ãã ã©ã®ãªãœãŒã¹ãæºåããå¿ èŠããããã話ãåããŸããããåé¡ã¯Kubernetesã®èŠ³ç¹ããïŒãããŠyamlã ãã§ãªãïŒæžãããšã§ãã æãèå³æ·±ãã®ã¯ããããããã®ç¹å®ã®ç°å¢ã«ãããç¹å®ã®ã¢ããªã±ãŒã·ã§ã³ã®éçãã¡ã€ã«ã§ããããšã§ãã
ãã ããè€æ°ã®ç°å¢ã§äœæ¥ããæ¬çªç°å¢ã ãã§ãªããã¹ããŒãžã³ã°ããã¹ããéçºãããã³ç°ãªãããŒã ã®ç°ãªãç°å¢ãããå Žåãããã€ãã®åæ§ã®ãããã§ã¹ããå¿ èŠã§ãã ããšãã°ããããã®1ã€ã«ã¯è€æ°ã®ãµãŒããŒããããå€æ°ã®ã¬ããªã«ãå¿ èŠã§ããããã1ã€ã«ã¯1ã€ã®ã¬ããªã«ããå¿ èŠãªãããã§ãã ããŒã¿ããŒã¹ããªããRDSã«ã¢ã¯ã»ã¹ã§ããªããããå éšã«PostgreSQLãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ãããŠãããã«ã¯å€ãããŒãžã§ã³ãããããã¹ãŠãå°ãæžãçŽãå¿ èŠããããŸãã
ãã®ãã¹ãŠã®å€æ§æ§ã¯ãKubernetesã®ãããã§ã¹ããååŸããã©ãã§ãã³ããŒããŠããã¹ãŠã®å Žæã§ä¿®æ£ããå¿ èŠããããšããäºå®ã«ã€ãªãããŸããããã§1æ¡ã眮ãæããŠãã ããã ããã¯éåžžã«äžå¿«ã«ãªãã€ã€ãããŸãã
解決çã¯ç°¡åã§ãã ãã³ãã¬ãŒããå ¥åããå¿ èŠããããŸãã ã€ãŸãããããã§ã¹ããäœæãããã®äžã«å€æ°ãå®çŸ©ããŠãããå€éšã§å®çŸ©ãããå€æ°ããã¡ã€ã«ãšããŠéä¿¡ããŸãã ãã³ãã¬ãŒãã¯æçµçãªãããã§ã¹ããäœæããŸãã ãã¹ãŠã®ç°å¢ã§åããããã§ã¹ããåå©çšããããšãå€æãããããã¯ããã«äŸ¿å©ã§ãã
ããšãã°ããã«ã ã®ãããã§ã¹ãã
- Helmã®æãéèŠãªéšåã¯Chart.yamlã§ã ãããã¯ããããã©ã®ãããªãããã§ã¹ãã§ããããã©ã®ããŒãžã§ã³ãã©ã®ããã«æ©èœããããèšè¿°ããŠããŸãã
- ãã³ãã¬ãŒãã¯ãKubernetesãªãœãŒã¹ãã³ãã¬ãŒãã§ããããã®äžã«ããçš®ã®å€æ°ãå«ãŸããŠããŸãã ãããã®å€æ°ã¯ãå€éšãã¡ã€ã«ãŸãã¯ã³ãã³ãã©ã€ã³ã§å®çŸ©ããå¿ èŠããããŸãããåžžã«å€éšã§å®çŸ©ããå¿ èŠããããŸãã
- values.yamlã¯ããããã®ãã³ãã¬ãŒãã®å€æ°ãå«ããã¡ã€ã«ã®æšæºåã§ãã
chartãã€ã³ã¹ããŒã«ããããã®æãåçŽãªèµ·åã³ãã³ãã¯ãhelm install ./wordpressïŒãã©ã«ããŒïŒã§ãã äžéšã®ãã©ã¡ãŒã¿ãŒãåå®çŸ©ããã«ã¯ãããããã®ãã©ã¡ãŒã¿ãŒãæ£ç¢ºã«åå®çŸ©ãããã®ãããªå€ãèšå®ãããããšèšããŸãã
Helmã¯ãã®ã¿ã¹ã¯ã«å¯Ÿå¿ããŠãããããå³ã§ã¯ç·è²ã§ããŒã¯ããŠããŸãã
確ãã«ãçæã衚瀺ãããŸãïŒ
- åé·æ§ ã ãªãœãŒã¹ã¯Kubernetesã®èŠ³ç¹ããå®å šã«å®çŸ©ãããŠãããè¿œå ã®æœè±¡åã¬ãã«ã®æŠå¿µã¯å°å ¥ãããŠããŸãããKubernetesã«æžããããã®ããã¹ãŠæžããããã§å€æ°ã眮ãæããŸãã
- ç¹°ãè¿ããŠã¯ãããŸãã-é©çšãããŸããã å€ãã®å Žåãåãããšãç¹°ãè¿ãå¿ èŠããããŸãã ç°ãªãååã®2ã€ã®é¡äŒŒãããµãŒãã¹ãããå Žåããã©ã«ããŒå šäœãå®å šã«ã³ããŒãïŒã»ãšãã©ã®å Žåãããè¡ãïŒãå¿ èŠãªãã¡ã€ã«ãå€æŽããå¿ èŠããããŸãã
ããããã¹ãŠèª¬æããããã±ãŒãžãããŒãžã£ãŒã§ããHelmã®æ¹åã«çªå ¥ããåã«ãHelmãäŸåé¢ä¿ã§ã©ã®ããã«æ©èœããããèŠãŠã¿ãŸãããã
äŸåé¢ä¿ãæ±ã
Helmã¯äŸåé¢ä¿ãæ±ãã®ãå°é£ã§ãã ãŸããäŸåãããã®ã«é©åããrequirements.yamlãã¡ã€ã«ããããŸãã èŠä»¶ãåŠçããªããã圌ã¯requirements.lockãå®è¡ããŸããããã¯ããã¹ãŠã®äŸåé¢ä¿ã®çŸåšã®ç¶æ ïŒãã²ããïŒã§ãã ãã®åŸã圌ã¯ãããã/ chartsãšãããã©ã«ããŒã«ããŠã³ããŒãããŸãã
管çããããŒã«ããããŸãïŒèª°ããã©ã®ããã«ãã©ãã«æ¥ç¶ããã- ã¿ã°ãšæ¡ä»¶ ãã©ã®å€éšãã©ã¡ãŒã¿ã«å¿ããŠãã©ã®ç°å¢ã§ãã©ã®äŸåé¢ä¿ã«æ¥ç¶ããããæ¥ç¶ããªããã決å®ããŸãã
ã¹ããŒãžã³ã°ç°å¢çšã®PostgreSQLïŒãŸãã¯æ¬çªçšã®RDSããã¹ãçšã®NoSQLïŒããããšããŸãã ãã®ããã±ãŒãžãæ¬çªç°å¢ã«ã€ã³ã¹ããŒã«ãããšãPostgreSQLã¯ã€ã³ã¹ããŒã«ãããŸãããã¿ã°ãšæ¡ä»¶ã䜿çšããã ãã§ãPostgreSQLã¯ããã«å¿ èŠãªãããã§ãã
ããã§é¢çœãã®ã¯äœã§ããïŒ
- Helmã¯ããã¹ãŠã®äŸåé¢ä¿ãšã¢ããªã±ãŒã·ã§ã³ã®ãã¹ãŠã®ãªãœãŒã¹ãæ··åããŸãã
- ãœãŒã->ã€ã³ã¹ããŒã«/æŽæ°
/ãã£ãŒãå ã®ãã¹ãŠã®äŸåé¢ä¿ïŒãããã®äŸåé¢ä¿ã¯ãããšãã°100ïŒãããŠã³ããŒãããåŸãHelmã¯å éšã®ãã¹ãŠã®ãªãœãŒã¹ãååŸããŠã³ããŒããŸãã ãã³ãã¬ãŒããã¬ã³ããªã³ã°ããåŸã圌ã¯ãã¹ãŠã®ãªãœãŒã¹ã1ãæã«éããèªåã®é åºã§äžŠã¹æ¿ããŸãã ãã®é åºã«åœ±é¿ãäžããããšã¯ã§ããŸããã ããã±ãŒãžãäœã«äŸåããŠããããèªåã§å€æããå¿ èŠããããŸããããã±ãŒãžã«æšç§»çãªäŸåé¢ä¿ãããå Žåã¯ãrequirements.yamlã®èª¬æã«ããããã¹ãŠãå«ããå¿ èŠããããŸãã ããã«çæããå¿ èŠããããŸãã
ããã±ãŒãžãããŒãžã£ãŒ
Helmã¯ã¢ããªã±ãŒã·ã§ã³ãšäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããHelmã®ã€ã³ã¹ããŒã«ãæ瀺ã§ããŸã-ãããŠãããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã ãããããã±ãŒãžãããŒãžã£ãŒã§ãã
åæã«ãããã±ãŒãžãã¢ããããŒãããå€éšãªããžããªãããå Žåã¯ãããŒã«ã«ãã©ã«ããŒãšããŠã§ã¯ãªããããã®ãªããžããªãããã®ããã±ãŒãžãååŸãããã®ãããªãã©ã¡ãŒã¿ãŒã§ã€ã³ã¹ããŒã«ããŸãããšèšãã ãã§ã¢ã¯ã»ã¹ã§ããŸãã
å€ãã®ããã±ãŒãžãåãããªãŒãã³ãªãªããžããªããããŸãã ããšãã°ã次ã®ã³ãã³ããå®è¡ã§ããŸããhelm install -f prod / values.yaml stable / wordpress
å®å®ãããªããžããªããwordpressãååŸããèªåã§ã€ã³ã¹ããŒã«ããŸãã æ€çŽ¢/ã¢ããã°ã¬ãŒã/åé€ã®ãã¹ãŠãå®è¡ã§ããŸãã å®éãHelmã¯ããã±ãŒãžãããŒãžã£ãŒã§ãã
ãã ããçæããããŸãããã¹ãŠã®æšç§»çãªäŸåé¢ä¿ãå éšã«å«ããå¿ èŠããããŸãã ããã¯ãæšç§»çãªäŸåé¢ä¿ãç¬ç«ããã¢ããªã±ãŒã·ã§ã³ã§ããããã¹ããšéçºã®ããã«ããããåå¥ã«æäœãããå Žåã«å€§ããªåé¡ã§ãã
ãã1ã€ã®ãã€ãã¹ç¹ã¯ã ãšã³ãããŒãšã³ãæ§æã§ãã ããŒã¿ããŒã¹ãããããã®ååããã¹ãŠã®ããã±ãŒãžã«è»¢éããå¿ èŠãããå Žåãããã¯å¯èœã§ãããå®è¡ããã®ã¯å°é£ã§ãã
å€ãã®å Žåã1ã€ã®å°ããªãã±ãããã€ã³ã¹ããŒã«ãããšåäœããŸãã äžçã¯è€éã§ããã¢ããªã±ãŒã·ã§ã³ã¯ã¢ããªã±ãŒã·ã§ã³ã«äŸåããã¢ããªã±ãŒã·ã§ã³ãã¢ããªã±ãŒã·ã§ã³ã«äŸåããŸããããããäœããã®åœ¢ã§å·§ã¿ã«æ§æããå¿ èŠããããŸãã Helmã¯ããããµããŒãããæ¹æ³ãç¥ããªããã倧ããªåé¡ãæ±ããŠãµããŒãããŠããŸãããŸããåäœãããããã«ã¿ã³ããªã³ã§ããããèžããªããã°ãªããªãå ŽåããããŸãã ããã¯æªãã®ã§ãå³ã®ãããã±ãŒãžãããŒãžã£ãŒãã¯èµ€ã§åŒ·èª¿è¡šç€ºãããŸãã
çµã¿ç«ãŠãšå
è£
Kubernetesã§ã¢ããªã±ãŒã·ã§ã³ãååŸããŠå®è¡ããããšã¯ã§ããŸããã ãããã¢ã»ã³ãã«ããå¿ èŠããããŸããã€ãŸããDockerã€ã¡ãŒãžãäœæããDockerã¬ãžã¹ããªã«æžã蟌ããªã©ã§ãã Helmã®ããã±ãŒãžã®å®çŸ©å šäœã¯ããã§ããã ããã±ãŒãžãäœã§ããããã©ã®æ©èœãšãã£ãŒã«ããããã«ããã¹ããã眲åãšèªèšŒã決å®ããŸãïŒäŒç€Ÿã®ã»ãã¥ãªãã£ã·ã¹ãã ã¯éåžžã«æºè¶³ããŠããŸãïŒã ãã®ãããäžæ¹ã§ã¯ãã«ããšããã±ãŒãžã³ã°ããµããŒããããŠããããã«èŠããŸãããä»æ¹ã§ã¯Dockerã€ã¡ãŒãžã®åŠçã¯æ§æãããŠããŸããã
Helmã§ã¯ãDockerã€ã¡ãŒãžãªãã§ã¢ããªã±ãŒã·ã§ã³ãå®è¡ããããšã¯ã§ããŸããã åæã«ãHelmã¯ã¢ã»ã³ããªããã³ããã±ãŒãžã³ã°çšã«æ§æãããŠããŸãããã€ãŸããå®éã«ã¯ãDockerã€ã¡ãŒãžãæäœããæ¹æ³ãããããŸããã
ããã¯ãå°ããªã©ã€ãã©ãªã®ã¢ããã°ã¬ãŒãã€ã³ã¹ããŒã«ãè¡ãããã«ãã³ã³ãã€ã©ãå®è¡ããããã«é¢ãããã©ã«ãã«éä¿¡ãããå Žåãšåãã§ãã
ãããã£ãŠãHelmã¯ç»åã®æäœæ¹æ³ãç¥ããªããšèšããŸãã
éçº
次ã®é çã¯éçºã§ãã éçºã§ã¯ãã³ãŒããè¿ éãã€äŸ¿å©ã«å€æŽããããšèããŠããŸãã ãã³ãã«ãŒãã«ç©Žãéããæãéãã5æ¥åŸã«çµæãåŸãããŸããã ç·šéè ããšãã£ã¿ãŒã§1ã€ã®æåãå¥ã®æåã«çœ®ãæããããšã«æ £ããŠããã®ã§ãã³ã³ãã€ã«ãæŒããšãæ¢ã«å€æŽãããããã°ã©ã ãæ©èœããŸãã
ããã§ãã³ãŒããå€æŽããå Žåãè¿œå ã®ã¢ã¯ã·ã§ã³ãå€ãå¿ èŠã§ããããšãããããŸããDockerãã¡ã€ã«ãæºåããŸãã Dockerãå®è¡ããŠãã€ã¡ãŒãžãæ§ç¯ããŸãã ã©ããã«ããã·ã¥ããã Kubernetesã¯ã©ã¹ã¿ãŒã«ãããã€ããŸãã ãããŠãããªãããããã¯ã·ã§ã³ã§æ¬²ãããã®ãæã«å ¥ããŠãã³ãŒãããã§ãã¯ããããšãã§ããŸãã
ç Žå£çãªæŽæ°ãã«ã ã®ã¢ããã°ã¬ãŒãã«ããäžäŸ¿ããäŸç¶ãšããŠãããŸãã kubectl execã䜿çšããŠããã¹ãŠãã©ã®ããã«æ©èœãããã確èªããã³ã³ããå ã確èªããŸããããã¹ãŠãæ£åžžã§ãã ãã®æç¹ã§ãæŽæ°ãéå§ããæ°ããã€ã¡ãŒãžãããŠã³ããŒãããæ°ãããªãœãŒã¹ãèµ·åããå€ããªãœãŒã¹ãåé€ããŸããæåãããã¹ãŠãéå§ããå¿ èŠããããŸãã
æ倧ã®çã¿ã¯å€§ããªç»åã§ãã ã»ãšãã©ã®äŒæ¥ã¯å°ããªã¢ããªã±ãŒã·ã§ã³ã§ã¯åäœããŸããã å€ãã®å Žåãã¹ãŒããŒã¢ããªã¹ã§ãªããã°ãå°ãªããšãå°ããªã¢ããªã¹ã§ãã æéãçµã€ã«ã€ããŠã幎茪ãæé·ããã³ãŒãããŒã¹ãå¢å ããåŸã ã«ã¢ããªã±ãŒã·ã§ã³ãéåžžã«å€§ãããªããŸãã 2 GBãè¶ ããDockerã€ã¡ãŒãžã«ç¹°ãè¿ãééããŸããã ããã°ã©ã ã®1ãã€ããå€æŽãããã¿ã³ãæŒããšã2ã®ã¬ãã€ãã®Dockerã€ã¡ãŒãžãã¢ã»ã³ãã«ããå§ãããšæ³åããŠãã ããã 次ã«ã次ã®ãã¿ã³ãæŒããšããµãŒããŒãžã®2 GBã®è»¢éãéå§ãããŸãã
Dockerã§ã¯ãã¬ã€ã€ãŒãæäœã§ããŸãã ããå±€ããããã©ããã確èªããäžè¶³ããŠããå±€ãéä¿¡ããŸãã ããããäžçã¯éåžžã«å€ãã®å Žåã1ã€ã®å€§ããªã¬ã€ã€ãŒã«ãªããŸãã 2 GBããµãŒããŒã«ç§»åããDockerã¬ãžã¹ããªã§Kubernetesã«ç§»åããŸãããæçµçã«èµ·åãããŸã§ãã¹ãŠã®æ¹æ³ã§å±éãããŸã-å®å šã«ãè¶ã飲ãããšãã§ããŸãã
Helmã¯ã倧ããªDockerã€ã¡ãŒãžã«é¢ãããã«ããæäŸããŸããã ç§ã¯ããããã¹ãã§ã¯ãªããšä¿¡ããŠããŸãããHelméçºè ã¯ãã¹ãŠã®ãŠãŒã¶ãŒãããããç¥ã£ãŠããã®ã§ãSteve Jobsã¯ããã«ç¬ããŸãã
éçºãããã¯ãèµ€ã«ãªããŸããã
ç°å¢èªåå
æåŸã®æ¹å-ç°å¢ã®èªåå-ã¯èå³æ·±ãåéã§ãã DockerïŒããã³é¢é£ã¢ãã«ãšããŠã®KubernetesïŒã®äžç以åã«ã¯ãããã®ãµãŒããŒãŸãã¯ãããã®ãµãŒããŒã«ã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ããŠãã¬ããªã«ãnåãäŸåé¢ä¿ã50åããããã¹ãŠèªåçã«æ©èœãããïŒããšèšãæ¹æ³ã¯ãããŸããã§ãããããã¯ããã§ããããããã§ã¯ãããŸããã§ããïŒ
Kubernetesã¯ãããæäŸããŸããããšãã°ããããã«æ°ããç°å¢ãå±éããŠããŸããã¢ããªã±ãŒã·ã§ã³ãæºåãããã¹ãŠã®éçºããŒã ããã¿ã³ãã¯ãªãã¯ããã ãã§ãããããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãæ°ããç°å¢ã«èªåçã«ã€ã³ã¹ããŒã«ãããŸãã ã çè«çã«ã¯ãHelmããããæ¯æŽããå€éšããŒã¿ãœãŒã¹ïŒS3ãGitHubïŒããã©ãããã§ãæ§æãååŸã§ããããã«ããå¿ èŠããããŸãã
Helmã«ã¯ç¹å¥ãªãã¿ã³ãDo me good on already finallyïŒãããããããã«è¯ããªãããšãæãŸããã§ãã Kubernetesã§ã¯ãããè¡ãããšãã§ããŸãã
Kubernetesã¯ã©ãã§ãå®è¡ã§ããAPIãä»ããŠæ©èœãããããããã¯ç¹ã«äŸ¿å©ã§ãã AWSãŸãã¯Google Cloud Engineã§minikubeãããŒã«ã«ã§èµ·åãããšãããã«KubernetesãååŸã§ããã©ãã§ãåãããã«æ©èœããŸãããã¿ã³ãæŒãã ãã§ããã¹ãŠãããã«æ£åžžã«åäœããŸãã
åœç¶ãHelmã䜿çšãããšãããå¯èœã«ãªããŸãã ããã§ãªããã°ããã«ã ãäžè¬çã«äœæããããšã®ãã€ã³ãã¯äœã§ãããïŒ
ããããçµæã¯éããŸãã
ç°å¢ã®èªååã¯ãããŸããã
代æ¿æ¡
誰ãã䜿çšããKubernetesããã®ã¢ããªã±ãŒã·ã§ã³ïŒå®éã«ã¯ãœãªã¥ãŒã·ã§ã³çªå·1ïŒãååšããããHelmã«äžèšã®åé¡ãããå Žåãã³ãã¥ããã£ã¯å¯Ÿå¿ããããåŸãŸããã§ããã 代æ¿ããŒã«ãšãœãªã¥ãŒã·ã§ã³ãäœæãå§ããŸããã
ãã³ãã¬ãŒããšã³ãžã³
ãã³ãã¬ãŒããšã³ãžã³ãšããŠãHelmã¯ãã¹ãŠã®åé¡ã解決ããããã«èŠããŸãããããã§ãã³ãã¥ããã£ã¯ä»£æ¿æ¡ãäœæããŸãã ãã³ãã¬ãŒããšã³ãžã³ã®åé¡ãã€ãŸãåé·æ§ãšã³ãŒãã®åå©çšãæãåºãããŠãã ããã
ããã®ä»£è¡šè ã¯Ksonnetã§ãã ããŒã¿ãšæŠå¿µã®æ ¹æ¬çã«ç°ãªãã¢ãã«ã䜿çšããKubernetesãªãœãŒã¹ã§ã¯æ©èœãããç¬èªã®å®çŸ©ã§æ©èœããŸãã
ãããã¿ã€ãïŒãã©ã¡ãŒã¿ãŒïŒ->ã³ã³ããŒãã³ã->ã¢ããªã±ãŒã·ã§ã³->ç°å¢ã
ãããã¿ã€ããæ§æããéšåããããŸãã ãããã¿ã€ãã¯å€éšããŒã¿ã«ãã£ãŠãã©ã¡ãŒã¿ãŒåãããã³ã³ããŒãã³ãã衚瀺ãããŸãã ããã€ãã®ã³ã³ããŒãã³ãã¯ãå®è¡å¯èœãªã¢ããªã±ãŒã·ã§ã³ãæ§æããŸãã ããŸããŸãªç°å¢ã§å®è¡ãããŸãã ããã«ã¯KubernetesãªãœãŒã¹ãžã®æ確ãªãªã³ã¯ãããã€ããããŸãããçŽæ¥ã®é¡æšã¯ãªããããããŸããã
Ksonnetã®äž»ãªç®æšã¯ããã¡ããã ãªãœãŒã¹ãåå©çšããããšã§ããã 圌ãã¯ãã³ãŒããæžããããåŸã§ã©ãã§ãããã䜿çšã§ããããã«ãããã£ãã®ã§ãéçºã®é床ãäžãããŸããã 倧èŠæš¡ãªå€éšã©ã€ãã©ãªãäœæãããšã人ã ã¯ããã«ãªãœãŒã¹ãåžžã«æçš¿ã§ããã³ãã¥ããã£å šäœãããããåå©çšã§ããŸãã
çè«çã«ã¯ãããã¯äŸ¿å©ã§ãã ç§ã¯å®éã«ã¯äœ¿çšããŸããã§ããã
ããã±ãŒãžãããŒãžã£ãŒ
ããã§ã®åé¡ã¯ãæãåºãããã«ããã¹ããããäŸåé¢ä¿ããšã³ãããŒãšã³ãã®æ§æãæšç§»çãªäŸåé¢ä¿ã§ãã Ksonnetã¯ãããã解決ããŸããã Ksonnetã«ã¯Helmãšéåžžã«ãã䌌ãã¢ãã«ããããåãæ¹æ³ã§ãã¡ã€ã«å ã®äŸåé¢ä¿ã®ãªã¹ããå®çŸ©ããããç¹å®ã®ãã£ã¬ã¯ããªã«ã¢ããããŒããããããŸãã éãã¯ãããããäœæã§ããããšã§ããã€ãŸããç¹å®ã®ããã±ãŒãžã®ããããå ¥ãããã©ã«ããŒãæºåããŠãããšããããšã§ãã
ãã©ã«ããã¢ããããŒããããšããããã®ããããã¹ãŒããŒã€ã³ããŒãºãããè€æ°ã®ããããããŒãžããçµæã䜿çšã§ããŸãã ããã«ãäŸåé¢ä¿ã®æ§æã®æ€èšŒããããŸãã ããã¯äŸ¿å©ãããããŸããããããã¯ãŸã éåžžã«ç²éã§ãã»ãšãã©ããã¥ã¡ã³ãããªããããŒãžã§ã³ã¯0.1ã§ããªãŒãºããŸããã 䜿çšããã«ã¯æ©ããããšæããŸãã
ãã®ãããããã±ãŒãžãããŒãžã£ãŒã¯KubePackã§ãããä»ã®éžæè¢ã¯ãŸã ãããŸããã
éçº
ãœãªã¥ãŒã·ã§ã³ã¯ããã€ãã®ç°ãªãã«ããŽãªã«åé¡ãããŸãã
- ãã«ã ã®äžã§äœæ¥ããããšããŠããŸãã
- ãã«ã ã®ä»£ããã
- æ ¹æ¬çã«ç°ãªãã¢ãããŒãã䜿çšããŠãããã°ã©ãã³ã°èšèªã§çŽæ¥äœæ¥ããããšããŸãã
- ãã®ä»ã®ããªãšãŒã·ã§ã³ã«ã€ããŠã¯åŸã§ã
1.ãã«ã äžã§ã®éçº
åªãã代衚è ã¯Draftã§ãã ãã®ç®çã¯ãã³ãŒããã³ããããããåã«ã¢ããªã±ãŒã·ã§ã³ãè©Šãæ©èœãã€ãŸãçŸåšã®ç¶æ ã確èªããæ©èœã§ãã ãã©ããã¯ããã°ã©ãã³ã°ææ³ã䜿çšããŸã-Herokuã¹ã¿ã€ã«ïŒ
- èšèªçšã®ããã±ãŒãžïŒããã¯ïŒããããŸãã
- Pythonã§ãHelloãworldïŒããšæžããŠãã ããã
- ãã¿ã³ãæŒããšãDockerãã¡ã€ã«ãèªåçã«äœæãããŸãïŒäœæããŸããïŒã
- ãªãœãŒã¹ãèªåçã«äœæããããã¹ãŠãéå§ãããèšå®ããå¿ èŠããã£ãdocker-registryã«ç§»åããŸãã
- ã¢ããªã±ãŒã·ã§ã³ã¯èªåçã«åäœãéå§ããŸãã
ããã¯ãã³ãŒãã䜿çšããŠä»»æã®ãã£ã¬ã¯ããªã§å®è¡ã§ãããã¹ãŠãé«éã§ç°¡åã§åªããŠããããã§ãã
ããããDraftã¯HelmãªãœãŒã¹ãäœæããããããšã«ããHelmã§äœæ¥ãéå§ããããšããå§ãããŸããã³ãŒããçç£æºåå®äºç¶æ ã«éãããšãDraftãHelmãªãœãŒã¹ãããŸãäœæããããšãæåŸ ããªãã§ãã ããã æåã§äœæããå¿ èŠããããŸãã
å°ãªããšã1ã€ã®HelmãªãœãŒã¹ãäœæããåã«ãããã«éå§ããŠæåããè©Šãã«ã¯ãã©ãããå¿ èŠã§ããããšãããããŸãã ãã©ããã¯ããã®æ¹åã®æåã®åè£ã§ãã
2.ãã«ã ãªãã®éçº
Helm Chartsã䜿çšããªãéçºã§ã¯ãHelm Chartsã䜿çšããŠäœæããã®ãšåãKubernetesãããã§ã¹ããäœæããå¿ èŠããããŸãã ç§ã¯3ã€ã®éžæè¢ãæäŸããŸãïŒ
- GitKube
- ã¹ã«ãã©ãŒã«ã
- ãã©ãŒãžã
ãããã¯ãã¹ãŠHelmã«éåžžã«ãã䌌ãŠãããéãã¯çŽ°éšã«ãããŸãã ç¹ã«ããœãªã¥ãŒã·ã§ã³ã®äžéšã¯ãã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããããšãæ³å®ããŠãããChartã¯git pushãå®è¡ããŠããã¯ã管çããããšãæ³å®ããŠããŸãã
æçµçã«ã¯ãããã«ãŒãã«ããããã«ãŒããã·ã¥ãããã³kubectlããŒã«ã¢ãŠããå®è¡ããŸãã Helmã«ã€ããŠèšèŒãããã¹ãŠã®åé¡ã解決ããããšã¯ã§ããŸããã ããã¯ãåãæ¬ ç¹ãæã€åçŽãªä»£æ¿æ段ã§ãã
3.ã¢ããªã±ãŒã·ã§ã³èšèªã§ã®éçº
次ã®éžæè¢ã¯ãã¢ããªã±ãŒã·ã§ã³èšèªã®éçºã§ãã ããã§ã®è¯ãäŸã¯Metaparticleã§ãã Pythonã§ã³ãŒããèšè¿°ããPythonã®å éšã§ã¢ããªã±ãŒã·ã§ã³ã«äœã欲ãããèãå§ãããšããŸãã
å€ãã®å Žåãéçºè ã¯ã¢ããªã±ãŒã·ã§ã³ããµãŒããŒäžã§ã©ã®ããã«åäœããããsysconfigã®é©åãªæ§æãªã©ã«ã€ããŠèããããªããããããã¯éåžžã«èå³æ·±ãæŠå¿µã ãšèããŠããŸãã 圌ã¯åäœããã¢ããªã±ãŒã·ã§ã³ãå¿ èŠã§ãã
åäœäžã®ã¢ããªã±ãŒã·ã§ã³ããã®æ§æèŠçŽ ãããããã©ã®ããã«çžäºäœçšããããæ£ç¢ºã«èª¬æãããšãçè«çã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã®èŠ³ç¹ãããã®ç¥èãKubernetesãªãœãŒã¹ã«å€ããã®ã«åœ¹ç«ã€éæ³ããããŸãã
ãã³ã¬ãŒã¿ã䜿çšããŠã以äžã決å®ããŸãããªããžããªã¯ã©ãã«ããã®ããæ£ããããã·ã¥ããæ¹æ³ã ãµãŒãã¹ãšã¯äœãããããŠããããäºãã«ã©ã®ããã«çžäºäœçšãããã ã¯ã©ã¹ã¿ãŒäžã«éåžžã«å€ãã®ã¬ããªã«ãããã¯ãã§ãã
ç§ã¯ããªãã®ããšã¯ç¥ããŸããããPythonã®å®çŸ©ããKubernetesã®èšå®ãäœæããå¿ èŠããããšç§ã«ä»£ãã£ãŠäœããã®éæ³ã決å®ããå Žåãå人çã«ã¯å¥œãã§ã¯ãããŸããã ãããŠãä»ã«äœãå¿ èŠãªå Žåã¯ïŒ
ã¢ããªã±ãŒã·ã§ã³ãããªãæšæºçãªãã®ã§ããéããããã¯ãã¹ãŠããçšåºŠæ©èœããŸãã ãã®åŸãåé¡ãå§ãŸããŸãã ã¡ã€ã³ã³ã³ãããèµ·åããåã«ãã¬ã€ã³ã¹ããŒã«ã³ã³ãããèµ·åãããšããŸããããã«ãããå°æ¥ã®ã³ã³ãããèšå®ããããã®ã¢ã¯ã·ã§ã³ãå®è¡ãããŸãã ããã¯ãã¹ãŠKubernetesã®æ§æå ã§è¡ãããŸããããããMetaparticleã®ãã¬ãŒã ã¯ãŒã¯å ã§è¡ããããã©ããã¯ããããŸããã
ç°¡åãªç°¡åãªäŸãæããŸãããããã«å€ãã®äŸããããŸããKubernetesæ§æä»æ§ã«ã¯å€ãã®ãã©ã¡ãŒã¿ãŒããããŸãã Metaparticleã®ãããªãã³ã¬ãŒã¿ã«ã¯å®å šã«ååšããªããšç¢ºä¿¡ããŠããŸãã
å³ã«ã¡ã¿ç²åã衚瀺ããã3ã€ã®ä»£æ¿Helmã¢ãããŒãã«ã€ããŠèª¬æããŸããã ããããè¿œå ã®ãã®ããããç§ã®æèŠã§ã¯éåžžã«ææã§ãã
Telepresence / Ksyncã¯ãã®1ã€ã§ãã ãã§ã«äœæãããã¢ããªã±ãŒã·ã§ã³ããããšããŸãããŸããHelmãªãœãŒã¹ãèšè¿°ãããŠããŸãã ã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ããã¯ã©ã¹ã¿ãŒå ã®ã©ããã§éå§ããŸããããã®æç¹ã§ãããšãã°ã³ãŒãã®1è¡ãå€æŽãããªã©ãäœããè©ŠããŠã¿ãããšæããŸãã ãã¡ããããããã¯ã·ã§ã³ã¯ã©ã¹ã¿ãŒã«ã€ããŠã¯è©±ããŠããŸãããããããã¯ã·ã§ã³ã§äœããæ¯é ããŠãã人ãããŸãã
Kubernetesã®åé¡ã¯ããããã®ããŒã«ã«ç·šéãDockeræŽæ°ãéããŠãã¬ãžã¹ããªãéããŠKubernetesã«è»¢éããå¿ èŠãããããšã§ãã ãã ãã1ã€ã®å€æŽãããè¡ãä»ã®æ¹æ³ã§ã¯ã©ã¹ã¿ãŒã«äŒããããšãã§ããŸãã 以äžã«ããããŒã«ã«ãã©ã«ããŒãšãªã¢ãŒããã©ã«ããŒãåæã§ããŸãã
ã¯ãããã¡ãããåæã«ãã€ã¡ãŒãžã«ã¯ã³ã³ãã€ã©ãŒãå¿ èŠã§ããéçºã«å¿ èŠãªãã®ã¯ãã¹ãŠããã«ããã¹ãã§ãã ãããããªããšäŸ¿å©ãªã®ã§ããããïŒã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ããè€æ°ã®è¡ãå€æŽããåæãèªåçã«åäœããæŽæ°ãããã³ãŒããå²çè£ã§å®è¡ãããã³ã³ãã€ã«ãšãã¹ããå®è¡ããŸã-ç ŽæãæŽæ°ãç Žå£çãªæŽæ°ã¯çºçããŸãããã¢ããªã±ãŒã·ã§ã³ã
ç§ã®æèŠã§ã¯ãããã¯åé¡ã®çŽ æŽããã解決çã§ãã
4. Kubernetesã䜿çšããªãKubernetesã®éçº
以åã¯ãKubernetesãªãã§KubernetesãæäœããŠãæå³ããªãããã«æããŸããã Helmã®å®çŸ©ãäžåºŠæ£ããäœæããé©åãªããŒã«ã䜿çšããŠãããŒã«ã«éçºã§ãã¹ãŠã®èšå®ãå ±éåããæ¹ãè¯ããšæããŸããã ããããæéãçµã€ã«ã€ããŠãç§ã¯çŸå®ã«åºããããéåžžã«é£ããã¢ããªã±ãŒã·ã§ã³ãèŠãŠããŸããã ããã§ãDockeræ§æãã¡ã€ã«ãäœæããæ¹ãç°¡åã ãšããçµè«ã«éããŸããã
Docker-composeãã¡ã€ã«ãäœæãããšãã¯ããã¹ãŠåãã€ã¡ãŒãžãèµ·åããåã®å Žåãšåæ§ã«ãDockerã³ã³ããå ã®ãã©ã«ããŒäžã®ããŒã«ã«ãã©ã«ããŒãããŠã³ãããŸããKuberneteså ã§ã¯ãªããåã«Docker-composeå ã«ããŒã«ã«ã§èµ·åããŸãã ã ãã®åŸãã³ã³ãã€ã©ãå®è¡ããã ãã§ããã¹ãŠãæ£åžžã«æ©èœããŸãã æ¬ ç¹ã¯ãDockerã®è¿œå ã®æ§æãå¿ èŠãªããšã§ãã ãã©ã¹ã¯ãé床ãšã·ã³ãã«ãã§ãã
ç§ã®äŸã§ã¯ãDocker-composeã§å®è¡ããããšããã®ãšåãããšãminikubeã§å®è¡ããããšããŸãããããã®å·®ã¯éåžžã«å€§ããã£ãã§ãã ããã¯ããŸãæ©èœãããç解ã§ããªãåé¡ããããDocker-composeããããŸãã-10è¡ã§çºçãããã¹ãŠãæ©èœããŸãã åãç»åã䜿çšããŠãããããããã«ããåçŸæ§ã確ä¿ãããŸãã
Docker-composeãã¹ããŒã ã«è¿œå ãããäžè¬ã«ãããããã¹ãŠã®ãœãªã¥ãŒã·ã§ã³ãåãããã³ãã¥ããã£ãéçºã®åé¡ã解決ããããšãããããŸããã
çµã¿ç«ãŠãšå
è£
ã¯ããã¢ã»ã³ããªãšããã±ãŒãžã³ã°ã¯ââHelmã®åé¡ã§ãããããããHelméçºè ã¯æ£ããã£ãã§ãããã åäŒæ¥ã«ã¯ç¬èªã®CI / CDã·ã¹ãã ããããã¢ãŒãã£ãã¡ã¯ããåéããæ€èšŒãããã¹ãããŸãã ãã§ã«ååšããŠããå Žå-誰ããèªåã§æã£ãŠããã®ã«ããªããã«ã ã§ãã®åé¡ã解決ããã®ã§ããïŒ ããããã1ã€ã®æ£ãããœãªã¥ãŒã·ã§ã³ã¯æ©èœãããããããã«ä¿®æ£ãå ããããŸãã
CI / CDãããå Žåãå€éšãªããžããªãšã®çµ±åããããåã³ãããã«å¯ŸããŠããã«ãŒãèªåçã«åéããããã¹ãã®èšå®ãå®è¡ãããŸãããã¿ã³ãã¯ãªãã¯ããŠãã¹ãŠãå±éãããšãåé¡ã¯è§£æ±ºããŸããã
CI / CDã¯ãã«ããšããã±ãŒãžã³ã°ã®åé¡ã«å¯Ÿããå®éã®è§£æ±ºçã§ãããç§ãã¡ã¯ãããç·è²ã«å¡ã£ãŠããŸãã
ãŸãšã
5ã€ã®æ¹åã®ãã¡ãHelmèªäœã¯ãã³ãã¬ãŒããšã³ãžã³ã®ã¿ãéããŸãã äœæãããçç±ã¯ããã«æããã«ãªããŸãã ã³ãã¥ããã£ã¯æ®ãã®ãœãªã¥ãŒã·ã§ã³ãå ±åã§è¿œå ããéçºãã¢ã»ã³ããªãããã±ãŒãžã³ã°ã®åé¡ã¯å€éšãœãªã¥ãŒã·ã§ã³ã«ãã£ãŠå®å šã«è§£æ±ºãããŸããã ããã¯å®å šã«äŸ¿å©ãªããã§ã¯ãããŸããã瀟å ã§ç¢ºç«ãããäŒçµ±ã®æ çµã¿ã®äžã§è¡ãã®ã¯å¿ ãããç°¡åã§ã¯ãããŸããããå°ãªããšãããã¯å¯èœã§ãã
ãã¥ãŒãã£ãŒãã«ã
ç§ã¯èª°ããã«ã ãäœã«æ¥ãã¹ããã確å®ã«ç¥ããªãã®ã§ã¯ãªãããšå¿é ããŠããŸãã , Helm , . , , , Helm.
, Road Map. Kuberneres Helm community , , Helm V3 .
Tiller, cli
, . Helm :
- , (cmd ..).
- Tiller â , Kubernetes.
Tiller , Command Line Interface. : « Chart» â Helm , , Tiller', : «, - ! , Kubernetes-» â .
Helm, Tiller , . , , , , Tiller' â namespace . Tiller namespace, , . , .
V3 Tiller .
? , , Command Line Interface, , Kubernetes. , Kubernetes , Tiller. kubectl cli .
Tiller . , Kubernetes Command Line Interface : , , , pre- post-. .
Lua- Chart
, â , lua- . Chart lua-, . . , . , , , .
Lua , , , - , , .
, , . , . Kubernetes, - , , , , . , .
Release- + secret
, , Release- , Release . , Release-, , , CRD, , .
namespace
Release- namespace, , - Tiller' namespace â , .
CRD: controller
, CRD-controller Helm , push-. .
, .
, Helm . , , , . , , . Helm â - Kubernetes. - , , .
, CI/CD , . Slack , , , master , . : « Staging» â , : « !» â . ããªãå¿«é©ã§ãã
Docker-compose Telepresence.
, A B, C, C . :
- , , ;
- ;
- , .
, Kubernetes â .
4 Chart' Helm, 3 ( C ). , v1 v2 , . , C; , v1 A; . , -. , .
â , .
, A. , Helm- , A, . B â , .
, , . , .
䟿å©ãªãªã³ã¯
⢠Draft
⢠GitKube
⢠Helm
⢠Ksonnet
⢠Telegram stickers: ,
⢠Sig-Apps
⢠KubePack
⢠Metaparticle
⢠Skaffold
⢠Helm v3
⢠Docker-compose
⢠Ksync
⢠Telepresence
⢠Drone
⢠Forge
GitHub , twitter , .
çŽ æŽããããã¥ãŒã¹
åœç€Ÿã®ãŠãŒãã¥ãŒããã£ã³ãã«ãæã ã¯RIT ++ç¥ãã§ãã¹ãŠã®ã¬ããŒãã®DevOpsããŒã ã®ãããªãçºèŠããŸãããããã¯å¥ã®ãã¬ã€ãªã¹ãã§ããããããªã®å®å šãªãªã¹ãã«ã¯ä»ã®äŒè°ããã®å€ãã®æçšãªãã®ããããŸãã
ãã£ãã®ããšããã£ãŒãã賌èªãããšãã¥ãŒã¹ã¬ã¿ãŒæ¥å¹Žã«ã¯ãã®ã§ãç§ãã¡ã¯ããããã®devopsaãåŸ ã£ãŠããïŒæã«ãRIT ++å ãHighLoad ++ã®ã»ã¯ã·ã§ã³ãšããŠã®æ¥ãå€ãç§ãããã³ç¬ç«ããç§ã®DevOpsConf Russiaã