ãä¹ ãã¶ãã§ããã¬ãããããã§ã¯ã©ã¦ãã¤ã³ãã©ãçæ¥ã«ãã¦ããå®é½å®®ã§ãã
ãã¦ãã㯠OpenShift Advent Calendar 2022 ã®5æ¥ç®ã®è¨äºãªã®ã§ãããåã ããè¶ äººéããã£ã¼ããªè¨äºãæ¸ãã¦ããã®ã§ãããã¯ãã¡ãã«ãã¾ãããã¦ãåã¯ç¸å½ã©ãã§ããããã¿ããã©ãã©ã¨æ¸ãã¾ãã
OpenShift ã¯ä½ã§ãã¤ï¼
ä¼å¢ã¯æ´¥ã§ãã¤ãæ´¥ã¯ä¼å¢ã§ãã¤ã尾張åå¤å±ã¯åã§ãã¤ã
è¶ æåãªè¨ãåããããã¾ããããããè¦ã¦ç§ã¯ããæããããã§ã¯ãOpenShift ã¯ä½ã§ãã¤ï¼
OpenShift 㯠Kubernetes ã§ãã¤ã
ãããããã ãééããªãããããããããã¨ãããªãããã¨èªåãæªãã
OpenShift 㯠Operator ã§ãã¤ã
ãããããã¯ããªãæ ¸å¿ãçªãã¦ãããããã§ãããããªããã¨æãããããã ãã§ããã£ã±ãèªåãæªãã
çæ¥ã®ã¸ãæ²ãããªãã¤ã¼ã¯å¤åçãæããããè²ã èããçµæãããã¦ç§ã¯ããå«ã³ããã
OpenShift 㯠GUI ã§ãã¤
OpenShift ã® GUI ã®ãã
OpenShift ã® GUI 㯠OpenShift Web Console ã¨å¼ã°ãããã®ã§ããããããç´ æ´ãããã
ã¾ããæ¥æ¬èªè¡¨ç¤ºãé¸ã¹ãããã®æã®ã½ããã¦ã§ã¢ã§æ¥æ¬èª GUI ãããã®ã¯ç¸å½ã¬ã¢ã§ãããã¶ãã¬ã¢ã ã¨æããã¬ã¢ãªããããªãããªãã¾ã¡ãã£ã¨è¦æã¯ãã¦ããï¼
ãããä¸å½èªãéå½èªãé¸ã¹ã¦ãè±èªãå
¥ããã¨4ãµå½èªã話ãããçããã¨æã£ã¦ãã³ã°ã«ãèªããªãã®ã«éå½èªã«å¤ãã¦ãã¾ããããã¦è¨èªè¨å®ã®ç»é¢ã«æ»ããªãã¦ç¦ããã¨ããçµé¨ã¯çãããé ·ãããã¨æãã¾ãã
ããã¦ç®¡çè
ç»é¢ã¨éçºè
ç»é¢ããããã¨ã¯ãOpenShift ãªè«¸å
å§ã¯ãåç¥ã§ãããã
管çè
ç»é¢ã§ã¯ãã¦ã¼ã¶ã®æ¨©éã«ãã£ã¦è¡¨ç¤ºãããã¡ãã¥ã¼ããã¤ãããã¯ã«å¤ããã®ã¯å½ããåãDeployment
ãªã©ã®ãªã½ã¼ã¹ã YAML ã ãã§ãªãã¦ã£ã¶ã¼ãçãªç»é¢ã使ã£ã¦ä½ããã¨ãã§ãã¾ãã
éçºè
ç»é¢ã§ã¯ãã¢ããªã½ã¼ã¹ã³ã¼ãããã³ã³ããã¤ã¡ã¼ã¸ããã«ãããããããããã¤ããã¾ã§ã GUI ã ãã§è¨å®ã§ãã¾ãããããã¤ããã¢ããªã®ãããã¸ã¼ããã¸ã¥ã¢ã«ã«è¡¨ç¤ºã§ããæ©è½ãããã¾ãã
ä»ç´¹ä»ããç´ æ´ããã㯠Web Console ã®ã¡ã¸ã£ã¼ãªé¢ã§ãããããç§ã¯ãããªã¡ã¸ã£ã¼ãªãã¨ãç´¹ä»ããããã«è¨äºãæ¸ãç·ã§ã¯ãªãã
ä»æ¥ç§ãç´¹ä»ãããã®ã¯ããã
ããã£ã¦ä½ã¦å¼ã¶ãã§ãããããããããã¼ï¼
æ£ç´ãWeb Consoleã§ãé »ç¹ã«è§¦ããªãé¨åã¨è¨ãã¾ãããããããã«ã¯é¢ç½ãç§å¯ãé ããã¦ããã®ã§ãä»æ¥ã¯ãããé çªã«ç°¡åã«ç´¹ä»ãã¦ããã¾ãã
OpenShift Web Console ã®ä¸ã®ã¡ãã¥ã¼
ãã³ãã¼ã¬ã¼ãã¿ã³(ä¸æ¬ç·ã®ãã¤)
ã¯ããã¾ãã¯å·¦ç«¯ã®ä¸æ¬ç·ã®ã¢ã¤ã³ã³ã§ãããã³ãã¼ã¬ã¼ãã¿ã³ã¨ããã³ãã¼ã¬ã¼ã¢ã¤ã³ã³ã¨ãå¼ã¶ãããªã®ã§ãããå¼ã¶ã¨ããã¯ãã¨ãªãããã£ã½ãæããåºãã¾ãã
ããã¯åç´ã«ãå·¦å´ã®ã¡ãã¥ã¼ãåºãããé ãããããã ãã®ãã¿ã³ã§ãã
ã¢ãã¿ã¼å
¨ç»é¢ã§è¡¨ç¤ºããã¨ãã¯å¥ã«é ããªãã¦ããããã ãã©ãã¢ãã¿ã¼å·¦ååã«GUIãå³ååã«ã¿ã¼ããã«ã¨ã両æ¹éãã¦ããããå ´åã«ä½¿ã£ãããã¾ãã
ããã¯ãã以ä¸è¨ããã¨ããªãã®ã§æ¬¡ã¸ã
ãã´
次ã«ãã´ã§ããããã«ã¯ "Red Hat OpenShift" ã¨ã "Red Hat OpenShift Service on AWS" ã¨ãããã©ãããã©ã¼ã ãã¨ã«éããã´ã表示ããã¦ã¾ãã
å®ã¯ãã®ãã´ã好ããªãã®ã«ã«ã¹ã¿ãã¤ãºã§ãããã§ãããç¥ã£ã¦ã¾ããï¼
ã¡ãã£ã¨ãã£ã¦ã¿ã¾ãããããä¾ãã°ãåé ã®ãããã¨ãããã®ç»åã«å¤ãã¦ã¿ã¾ãããã
ã¾ãã¯å¤æ´å
ã®ç»åã ConfigMap
ã¨ã㦠up ãã¾ããGUI ã®ç´¹ä»ã®è¨äºã§ CLI ã§ããã®ã¯æããæ°æã¡ããããã§ãããCLI ã§ããã»ãã話æ©ãã®ã§ãCLI ã§ããã¾ã(ãã)
$ ll total 376 -rwxr-xr-x. 1 lab-user users 381226 Dec 1 08:56 text_animals_ogenki.png $ oc create configmap console-custom-logo --from-file ./text_animals_ogenki.png -n openshift-config configmap/console-custom-logo created
ãã¨ã¯ããã©ã«ãã§ä½ããã¦ã consoles.operator.openshift.io
ã«ã¹ã¿ã ãªã½ã¼ã¹ãå¤æ´ãã¦ããã¾ãããã㯠GUI ã§ãæ§ãã¾ããã
管çè
ç»é¢ã§ã
管ç (Administration) > ã¯ã©ã¹ã¿ã¼è¨å® (Cluster Settings) > è¨å® (Configuration) > Console; operator.openshift.io
ã¨è¡ã£ã¦ãYAML ã§æ¬¡ã®ããã« spec.customization.
以ä¸ã追è¨ãã¦ã»ã¼ãã
customProductName
ã®é¨åã¯èªç±ã§ããã©ã¦ã¶ã®ã¿ãã®é¨åã«è¡¨ç¤ºããã¾ãã
spec: customization: customLogoFile: key: text_animals_ogenki.png name: console-custom-logo customProductName: OGENKI Logo
oc edit
ã³ãã³ãã oc patch
ã³ãã³ãã使ã£ã¦ããã¡ããOKã
å¾ã¯ openshift-console Operator ãèªåçã« Pod ãä½ãç´ãã®ã§2,3åå¾ ã£ã¦ç»é¢ããªãã¼ãããã¨ã
ã¨ãããªæãã«ãªãã¾ãã
誰å¾ã ãããï¼ã¨æãããã§ãããä¾ãã°å¤è²©äºæ¥ã¨ã㦠Kubernetes as a Service çãªãµã¼ãã¹ãæä¾ãããã¦ã¼ã¶ã¼ããããWeb Console ã¯ä½¿ããããã©èªåã®ãã´ã表示ããããã¨ããå ´åã«ä¾¿å©ã§ããã
ã¡ãªã¿ã«ããã®ç»åã®å¤§ããã¯é«ã 60px ãæ大ã§ãããããã大ããªç»åã¯ãã¢ã¹ãã¯ãæ¯åºå®ã§é«ã 60px ã«ç¸®å°ããã¾ãã
ãã³ãã¼ã¡ãã¥ã¼(ã«ã¼ããã¯ãã¥ã¼ãã¿ãããªãã¤)
次ã«9åã®ãããã並ãã ã«ã¼ããã¯ãã¥ã¼ãã¿ãããªã¢ã¤ã³ã³ã§ãããå¼å½ã¿ããã ãããã³ãã¼ã¡ãã¥ã¼ã¨ãå¼ã°ãããããã1800åãããããã¡ãã£ã¨ããå¼å½ããã
ããã«ã¯ããããªãªã³ã¯ã表示ããã¾ãã
OpenShift Container Platform ã ã¨ããã©ã«ã㧠OpenShift Cluster Manager ã§ã®å½è©²ã¯ã©ã¹ã¿ã®ãã¼ã¸ã¨ãRed Hat Hybrid Cloud Console ã®ãªã³ã¯ã表示ããã¦ã¾ãã
OpenShift ã§ã¤ã³ã¹ãã¼ã«ãã Operator ã«ãã£ã¦ã¯ãå¥ã® GUI ã®ãã¼ã¸ãç¨æããããã®ãããã¾ãã
ãããã GUI ã®ãã¼ã¸ã¸ã®ãªã³ã¯ããOperator ã¤ã³ã¹ãã¼ã«ã¨åæã«èªåçã«ããã«è¿½å ããããã¨ãããã¾ãã
ä¾ãã°ãOpenShift GitOps Operator ãã¤ã³ã¹ãã¼ã«ããã¨ãArgo CD ã® GUI ã¸ã®ãªã³ã¯ã追å ããã¾ãã
ãã®ãªã³ã¯ã®ã¨ã³ããªã¼ã¯ãConsoleLink
ã¨ããã«ã¹ã¿ã ãªã½ã¼ã¹ã§ç®¡çããã¦ã¾ããããã«ããã®ã«ã¹ã¿ã ãªã½ã¼ã¹ãä½ã£ã¦ããã°ãèªç±ã«ãªã³ã¯ã追å ãããã¨ãã§ãã¾ãã
試ãã«ãã®èµ¤å¸½ã¨ã³ã¸ãã¢ããã°ã®ãªã³ã¯ã追å ãã¦ã¿ã¾ãããã 管çè ç»é¢ã§ã
管ç (Administration) > ã«ã¹ã¿ã ãªã½ã¼ã¹å®ç¾© (CustomResourceDefinitions) > ConsoleLink > ã¤ã³ã¹ã¿ã³ã¹(Instance) > ã³ã³ã½ã¼ã«ã®ãªã³ã¯ã®ä½æ(Create ConsoleLink)
ã¨è¡ã£ã¦ã次ã®ããã«YAMLãæ¸ãã¦ä½æãã¿ã³ãæ¼ãã
apiVersion: console.openshift.io/v1 kind: ConsoleLink metadata: name: rheb spec: applicationMenu: imageURL: https://cdn.profile-image.st-hatena.com/users/rheb/profile.gif?1538617339 section: åèã«ãªããµã¤ãé href: 'https://rheb.hatenablog.com/' location: ApplicationMenu text: 赤帽ã¨ã³ã¸ãã¢ããã°
ããããã¨ã次ã®ããã«ãªã³ã¯ã追å ããã¾ãã
localtion
ã®é¨åã« "ApplicationMenu" ãé¸ã¶ã¨ãã®ãã³ãã¼ã¡ãã¥ã¼ã«è¿½å ããã¾ãããä»ã«ã "HelpMenu" ã "UserMenu" ãªã©ãå¥ã®ã¨ããã«ãªã³ã¯ã表示ããããã¨ãã§ãã¾ãã
éç¥
ã次ã¯ãã«ã®ã¢ã¤ã³ã³ã§ããããã«ã¯ OpenShift Monitoring ã®ã¢ã©ã¼ãã«ã¼ã«ã«å¼ã£æãã£ã¦ Firing ç¶æ
ã®ã¢ã©ã¼ãã表示ããã¾ãã
ãã㯠OpenShift Monitoring ã® View 権éãããã¦ã¼ã¶ã¼ã«ã®ã¿è¡¨ç¤ºããã¾ãã
ã¢ã©ã¼ãã® Severity ã«åããã¦ã"é大ãªã¢ã©ã¼ã(Critical Alerts)"ã"ä»ã®ã¢ã©ã¼ã(Other Alerts)"ã"æ¨å¥¨äºé
(Recommendations)" ã¨åãã¦è¡¨ç¤ºããã¾ãã
ãã«ã®æ¨ªã«ã¯ã"é大ãªã¢ã©ã¼ã(Critical Alerts)" 㨠"ä»ã®ã¢ã©ã¼ã(Other Alerts)" ã®åè¨æ°ã表示ããã¾ãã
ãã¸é ã¿ãããªãã¤
ãã¸é ã¿ãããªãã©ã¹ã®ã¢ã¤ã³ã³ããããç§ã®è¶
å¤ç¨ãã便å©æ©è½ã§ãããã®è¨äºã¯ããã ãè¦ãã¦ãããã°8000ç¹ã
ãããæ¼ãã¨ãYAMLãç´ã«æ¸ãã¦ãªã½ã¼ã¹ãä½ããç»é¢ã«è¡ãã¾ãã
ããããã¾ããããgithubã¨ãã§è¦ã¤ããYAMLããã¯ãããæã
ããããæãCLI 㧠curl
ã¨ã wget
ã¨ãã§ãã¡ã¤ã«ãã¦ã³ãã¼ããã¦ã¾ãããï¼
ãããã¯ãã©ã¦ã¶ã§ã³ãã¼ãã¦vimã¨ãemacsã¨ãã«ãã¼ã¹ãã¨ããã¦ãã¾ãããï¼ãã¢ããã¥ã¡ã³ãã§ãã£ã¦ã¾ãããï¼
ä»æ¥ããã¯ããã©ã¦ã¶ã§YAMLãã³ãã¼ãããããã®ã¾ã¾ Web Console ã«ãã¼ã¹ãï¼ãããªã«ç·¨éããããã¿ã³æ¼ãã¦ä»¥ä¸çµããï¼
ãããã¡ããããCLI ã§ããã®ãæªãã¨ã¯è¨ãã¾ãããããããã§ã¹ãã¯ãã¡ã¤ã«ã¨ãã¦ä¿ç®¡ããªãã¨ãããªãã«ã¼ã«ã¨ããããã§ãããããããããå ´åã¯è©±ã¯å¥ã§ãã
ãã ãåç´ã«YAMLãã³ãã¼ãã¦ãã®ã¾ã¾ oc create/apply
ãããã±ã¼ã¹ã£ã¦å²ã¨ããã¨æããã§ãããã®å ´åã¯ããã®ãã¸é ã使ã£ã¦ããã¨è©±ãæ©ãã§ãã
ãã«ã
次ã¯ããããã¼ã¯ã§ãã·ã³ãã«ã«ããã¯ãã«ãã§ããOpenShift ã®ããã¥ã¡ã³ãããµãã¼ãã±ã¼ã¹ãªã©ã¸ã®ãªã³ã¯ã表示ããã¦ãã¾ãã
CLIãã¼ã«ã®ãã¦ã³ãã¼ãå
ã«ãããããè¡ãã¾ããoc
ã ãã§ãªã helm
ã¨ã odo
ã¨ãããã¦ã³ãã¼ãã§ããã®ã§ãéçºè
ã®äººãèªèº«ã®ç«¯æ«ã«ãããã® CLI ãã¤ã³ã¹ãã¼ã«ãããã¨ãã«ä¾¿å©ã§ãã
ã¡ãªã¿ã«ãåè¿°ã® ConsoleLink
㧠location
ã« "HelpMenu" ãæå®ããã¨ãããã«ãªã³ã¯ãä½ããã¾ãã
ã¦ã¼ã¶ã¼
æå¾ã¯ã¦ã¼ã¶ã¼ã¡ãã¥ã¼ã§ããããã¯çµæ§è§¦ã£ããã¨ããã諸å å§ãå¤ãã®ã§ã¯ãªãã§ããããã
"ãã°ã¤ã³ã³ãã³ãã®ã³ãã¼"ã¨æ¸ãã¦ãããã©ãå®è³ªçã«ã¯ API ãã¼ã¯ã³ã®çºè¡ã§ããã
çºè¡ããããã¼ã¯ã³ãå«ãã¦ãCLI 㧠oc login
ããæã®ã¯ã³ã©ã¤ãã¼ããç´æ¥ curl
ã§å©ãã³ãã³ãã表示ããã¾ãã
"ã¦ã¼ã¶ã¼è¨å®"ã¯ãè¨èªã¨ã表示系ã®ããããªè¨å®ãã§ãã¾ãã
ã¾ã¨ã
ãã¦ãããã«ãªããããªãªããªããããªè©±ããã©ãã©ãã¦ãã¾ããããOpenShift ã® GUI ã®ãã¤ãã¼ãªé¨åã«ã¤ãã¦ç´¹ä»ãã¾ããã
ã¯ã©ã¦ããã¤ãã£ãçéã§ã¯ãCLI ãããªããªå©ããã®ãå¿ è¦ä¸å¯æ¬ ï½ã¿ããã«æããã人ãããã£ãããããããã¾ããã ã©ããã¦ã GUI ã¯æä½å±¥æ´ãæ®ãã®ã CLI ãã大å¤ãªã®ã§ãCLI æåã«ãªãã®ã¯ä»æ¹ãªãã¨ããããªã¨æãã¾ãã
ã§ãããOpenShift 㯠GUI ãçµæ§ã¤ã±ã¾ããGUI ã®ããã¨ããã¯ãééããªãã¨ããã¨çµæçã«æ©ãã¨ããããªã¨æãã¾ãã
ä¾ãã°ãç§ã常ã
ãä¸è©±ã«ãªã£ã¦ãã OperatorHubãCLI 㧠OperatorGroup
ã Subscription
ã¨ãã£ãã«ã¹ã¿ã ãªã½ã¼ã¹ãä½ã£ã¦ Operator ãã¤ã³ã¹ãã¼ã«ããã®ãæªããªãã§ãããGUI ã使ãããªããã®ã»ããã¾ã syntax ãééããªããããã®çµææ©ãã§ãã
OpenShift Data Foundation ã®ããã«ãçµæ§å¤ãã®ã«ã¹ã¿ã ãªã½ã¼ã¹ãä½ãã½ããã¦ã§ã¢ã§ããGUI ã§ã¦ã£ã¶ã¼ããããã¨èª°ã§ãç°¡åã«ééããªãæ§æã§ããããã«ãªãã¾ãã
ããããããã§ãã¿ããªãã£ã¨ OpenShift ã® GUI ã使ãã¾ãããã
ä¼å¢ã¯æ´¥ã§ãã¤ãæ´¥ã¯ä¼å¢ã§ãã¤ãOpenShift 㯠GUI ã§ãã¤
ãã¼ããèªåãããã
ã¨ãããã¨ã§ä»æ¥ã¯ããã¾ã§ã