ã¬ãããããã®ç¹ã§ãã2022å¹´ã®OpenShift Advent Calendarã®1æ¥ç®ã¨ãããã¨ã§ãæ¹ãã¦OpenShiftã®ãç´¹ä»ããããã¨æãã¾ãã
OpenShiftã¨ã¯
OpenShiftã¯ãRed Hatãéçºã»æä¾ããKubernetesãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ããã¨ã³ã¿ã¼ãã©ã¤ãº/ããã·ã§ã³ã¯ãªãã£ã«ã«ãªã¯ã¼ã¯ãã¼ãã§ä½¿ç¨ããããã¨ãæ³å®ããupstreamã®Kubernetesã«å¯¾ãã¦æ§ã ãªæ¹è¯ãå ãããã³ã³ãã¼ãã³ãã追å ããããããªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢è£½åã¨ãã¦æä¾ãã¦ãã¾ããCNCFã®èªå®ãåå¾ããKubernetesã®æ¨æºã«æºæ ãã¦ãã¾ã [1]ã
OpenShiftã®ç¾å¨ã®ãã¼ã¸ã§ã³ã¯v4.11ã§ãããv2ãæä¾ãã¦ãã2014å¹´8æã«ãOpenShift v3ã¯Docker + Kubernetesããã¼ã¹ã«ä½ãç´ãããã¨ã表æãã¾ããããã®å¾2015å¹´6æã«Kubernetes v1.0ãã¼ã¹ã®OpenShift v3ãGAãã¦ä»¥éãKubernetesã³ãã¥ããã£ã¨ååããªããOpenShiftãçºå±ããã¦ãã¾ããã
OpenShiftã®ç¹å¾´ã¯ããããããã¾ãããå人çã«ã¯ãã®ä¸ã§ã次ã®2ã¤ã大ããªç¹å¾´ã¨èãã¦ãã¾ãã
æ§ã ãªã¨ã³ã·ã¹ãã ã®ã³ã³ãã¼ãã³ãããããæãã«è¨å®ãããç¶æ ã§å ¥ã£ã¦ãã
ãã¼ã¸ã§ã³ã¢ããããµãã¼ãããã
ã¾ã 1. ã«ã¤ãã¦ã§ãããKubernetesã使ç¨ããéãã¡ããªãã¯ã¹ç®¡çã®ããã«Prometheusããã°ç®¡çã®ããã«ElasticSearch+Fluentd+Kibanaããã¨Ingress Controllerã¨Web dashboardã¨ãã¢ããªã®CI/CDã®ä»çµã¿ã欲ããããµã¼ãã¹ã¡ãã·ã¥ãæ¤è¨ããããã...ã¨ãKubernetesæ¬ä½ã ãã§ãªããã¨ã³ã·ã¹ãã ã®æ§ã ãªã³ã³ãã¼ãã³ããä¸ç·ã«ä½¿ç¨ãããã¨ãã»ã¨ãã©ã ã¨æãã¾ããOpenShiftã§ã¯ããããã®ã»ã¨ãã©ãããã©ã«ãã§å ¥ã£ã¦ããããããã¯å¿ è¦ã«å¿ãã¦è¿½å ã§ãã(追å è²»ç¨ãããããªããã®ãããããããã¾ã)ããã«ãªã£ã¦ãããã¾ãå ¥ããã ãã§ããæãã«è¨å®ãããããã«ä½¿ç¨ãããã¨ãã§ãã¾ããã客æ§ãããã¢ããªã±ã¼ã·ã§ã³éçºã«æ³¨åã§ãããããKubernetesã«ä»å 価å¤ãã¤ãã¦æä¾ãã¦ãããã¨è¨ããããããã¾ããã
2.ã®ãã¼ã¸ã§ã³ã¢ããã¯ãç¹ã«upstreamã®é²åã®éãã½ããã¦ã§ã¢ã使ç¨ããã¨ãã¯ãã¤ã課é¡ã«ãªããã¨ãå¤ãã¨æãã¾ããKubernetesã¯ä»ã§ã1å¹´ã«3åãã¤ãã¼ãã¼ã¸ã§ã³ãä¸ãã£ã¦ãããOpenShiftãããã«åããã¦ãã¼ã¸ã§ã³ã¢ãããã¾ããOpenShiftã§ã¯ãOperatorã®èãæ¹ããã¼ã¹ã«Kubernetesã®ã³ã¢ã³ã³ãã¼ãã³ããå«ããå ¨ã¦ã®ã³ã³ãã¼ãã³ãã管çãã¦ããããã®ä»çµã¿ã使ã£ãin-placeãªãã¼ã¸ã§ã³ã¢ããããµãã¼ããã¦ãã¾ãã
OpenShiftãKubernetesã«å¯¾ãã¦è¿½å ãã¦ããæ©è½ãå ·ä½çã«ããã¤ãæãã¦ã¿ã¾ãã
- Web GUI
- ã¢ããªã±ã¼ã·ã§ã³ã®ãã«ãã®ä»çµã¿
- ããã©ã«ãã®ã»ãã¥ãªãã£è¨å®ãå³ãç®
- ãã¦ã¹æ°ã¯ãªã㯠(ãããã¯ã³ãã³ã1çº) ã§in-placeã¢ããã°ã¬ã¼ã
- Operatorã«ããã¯ã©ã¹ã¿ã¼å ¨ä½(OSãå«ãã¦)ã®èªå管ç
- Metrics管ç (Prometheus)
- HAProxyãã¼ã¹ã®Ingress Controller
- Multusã«ããè¤æ°Podãããã¯ã¼ã¯ç®¡ç
- ã³ã³ããã¢ããªã稼åããããã¨ã«ç¹åããOS (Red Hat Enterprise Linux CoreOS, RHCOS) ä¸ã§ç¨¼åããRHCOSèªä½ã®ç®¡çãOpenShiftããè¡ã (OpenShiftã®ãã¼ã¸ã§ã³ãä¸ããã¨ãRHCOSã®ãã¼ã¸ã§ã³ãèªåçã«ä¸ããã¾ã)
ããã«ãå¿ è¦ã«å¿ãã¦OperatorHubããæ©è½è¿½å ãããã¨ãã§ãã¾ã [2]ã
- Windowsã®ã¯ã¼ã«ã¼ãã¼ã管ç
- Logging管ç (ElasticSearch/Fluentd/Kibna, Grafana Loki/Vector)
- Local Storage Operator (å èµãã£ã¹ã¯ã®ç®¡ç)
- Compliance Opeartor (ã»ãã¥ãªãã£æ¨æºã¸ã®æºæ ã®ãµãã¼ã)
- File Integrity Operator (ãã¡ã¤ã«æ¹ç«æ¤ç¥)
- Performance Addon Operator (ä½ã¬ã¤ãã³ã·ã¼ãè¦æ±ããã¢ããªã±ã¼ã·ã§ã³ç¹æã®ãã¥ã¼ãã³ã°ãv4.11以éã¯OpenShiftã®æ¨æºæ©è½ã«ãªãã¾ãã)
- SR-IOV Operator
- MetalLB Operator
- Service Mesh (Istioãã¼ã¹ã®ãµã¼ãã¹ã¡ãã·ã¥)
- Virtualization (KubeVirtãã¼ã¹ã®ä»®æ³å)
- Serverless
- Pipelines (Tektonãç¨ããCI/CD)
- GitOps (ArgoCDãç¨ããGitOps)
- PTP Operator
- OADP Operator (ããã¯ã¢ãã/ãªã¹ãã¢)
- MTC Operator (OpenShiftã¯ã©ã¹ã¿ã¼ã®ãã¤ã°ã¬ã¼ã·ã§ã³)
- ãã®ä»ãããã
OpenShiftã使ã£ã¦ã¿ãã
OpenShift Container Platform
OpenShift Container Platform (OCP) ã¯ããµãã¹ã¯ãªãã·ã§ã³ãè³¼å ¥ãã¦ä½¿ã£ã¦ããã ã製åçã®OpenShiftã§ããä»ã¯å³å¯ã«ã¯ãåã«ãOpenShiftãã¨è¨ãã¨OKD(å¾è¿°ããã³ãã¥ããã£ç)ã¯å«ã¾ã製åçã®ã¿ãæå³ãã¾ãããã製åçã®ãã¨ããOCPãã¨å¼ãã ããOKDã¨OCPã®ç·ç§°ã¨ãã¦OpenShiftã¨ããå¼ã³åã使ããã¨ããã£ããããã®è¾ºãã¯ããã¨é©å½ã§ã [3]ã
OpenShiftã¯æ§ã ãªå½¢ã§å©ç¨ãã¦ããã ããã¨ãã§ãã¾ãã
- ããã¼ã¸ã: ã¯ã©ã¦ãäºæ¥è ããã¨ååãã¦æä¾ããããã¼ã¸ããµã¼ãã¹ãROSA (AWSã®OpenShiftããã¼ã¸ããµã¼ãã¹) ã ARO (Azureã®OpenShiftããã¼ã¸ããµã¼ãã¹) çãããã¾ããOpenShiftãåããåºç¤ã®éç¨ç®¡çã¯åºæ¬çã«Red Hat SREãè¡ãã¾ãã
- ã»ã«ãããã¼ã¸ã: å©ç¨è ãèªèº«ã§æ§ç¯ã»éç¨ããå½¢æ
ã»ã«ãããã¼ã¸ããªä½¿ãæ¹ã®å ´åãIPI, UPIã®2種é¡ã®ã¤ã³ã¹ãã¼ã«æ¹æ³ãããã¾ãã
- IPI (Installer Provisioned Infrastructure): OpenShiftã使ç¨ããã¤ã³ãã©ãã¤ã³ã¹ãã¼ã©ãèªåçã«ä½æãã¾ããä¾ãã°AWSä¸ã§IPIã¤ã³ã¹ãã¼ã«ããã¨ãVPCãELBãªã©ãå«ããå¿ è¦ãªãã®ãã¤ã³ã¹ãã¼ã©ãä½æãã¾ãã
- UPI (User Provisioned Infrastructure): OpenShiftã使ç¨ããã¤ã³ãã©ã¯ãã¤ã³ã¹ãã¼ã©å®è¡åã«ã¦ã¼ã¶ã¼ãæåã§ä½æãã¦ããã¾ãã
IPIã¯AWSãOpenStackãªã©ã主ã«ã¯ã©ã¦ãç°å¢ã§å©ç¨ãããã¤ã³ã¹ãã¼ã«æ¹æ³ã§ãããOpenShiftã§ã¯ãã¢ã¡ã¿ã«ãµã¼ããvSphereãNutanixçã®ç°å¢ã«å¯¾ãã¦ãIPIã¤ã³ã¹ãã¼ã«ã®ä»çµã¿ãæä¾ãã¦ãã¾ãã ãã¢ã¡ã¿ã«IPIã®å ´åã¯ãOpenStack Ironicã®ä»çµã¿ãæµç¨ããMetal3 [4] ã使ã£ã¦ãã¼ãã®ãããã¸ã§ãã³ã°ãè¡ãã¾ããé常APIãµã¼ããIngressã³ã³ããã¼ã©ã®å段ã«é ç½®ãããã¼ããã©ã³ãµã«ç¸å½ããæ©è½ã¯ãHAProxy 㨠Keepalived ãOpenShiftãã¼ãä¸ã§ç¨¼åããããã¨ã§å®ç¾ãã¾ãã
IPIã¤ã³ã¹ãã¼ã«ã®ãæ軽ãã¯ãç¿ã§ãã§ããOpenShift4ã¤ã³ã¹ãã¼ã«ç·¨ãè¦ã¦ããã ããã¨é°å²æ°ãããããã¨æãã¾ãã
UPIã¤ã³ã¹ãã¼ã«ã¯ãDNSãDHCPããã¼ããã©ã³ãµçãäºåã«ç¨æããå¿ è¦ããããä»ã®æ¹æ³ã¨æ¯ã¹ãã¨è¥å¹²æéããããã¾ããæ¤è¨¼ç°å¢ãä½ãã¨ãã¯ãOpenShift-AiOãªã©ã®Ansible Playbookã使ã£ãããçéã§ã¤ã³ã¹ãã¼ã«ããã¹ã¯ãªããã使ã£ãããã人ãå¤ãããã§ãã
ã»ã«ãããã¼ã¸ãã§ãå©ç¨ããã ãéã¯ããµãã¹ã¯ãªãã·ã§ã³ãè³¼å ¥ãã¦ããªãã¦ãã60æ¥ã¯ç¡æã§ä½¿ç¨ãã¦ããã ããã¨ãã§ãã¾ã [5]ã
OpenShiftã®ããã¥ã¡ã³ãã¯ä»¥ä¸ã®URLã«ããã¾ãã
- è±èªç https://docs.openshift.com/container-platform/latest/welcome/index.html
- æ¥æ¬èªç https://access.redhat.com/documentation/ja-jp/openshift_container_platform/
OKD
OKDã¯ã³ãã¥ããã£çã®OpenShiftã§ãã
OpenShift v3ã®é ã¯OpenShift Originã¨ããååã®upstreamããã¸ã§ã¯ãããã£ãã®ã§ãããOpenShift v4ã«ãªã£ã¦OriginããªããªããOKDã«ãªãã¾ããã Originã¯OCPã®é¢ä¿ã¯upstream-downstreamã®é¢ä¿ã§ããããOKDã¨OCPã®é¢ä¿ã¯ãå å¼ãã ããã§ã [6]ã
OKDã®ããã¥ã¡ã³ãã¯ãã¡ãã«ããã¾ããããã¼ã¸ããµã¼ãã¹ã¯ããã¾ããããã»ã«ããµã¼ãã¹ã§IPI/UPIã¤ã³ã¹ãã¼ã«ããç¹ã¯OpenShiftã¨åãã§ãããã¼ã¹ã®OSã¨ãã¦ã¯ãFedora CoreOS (FCOS) ã使ç¨ãã¾ã [7]ã
OKDã®nightly buildã¯ãã¡ãããåå¾ã§ãã¾ãã
æè¿ãOKD Streams ã¨ããæ°ããåãçµã¿ãå§ãã¾ãããOKD Streamsã§ã¯ãOKDããã«ãããããã®Tekton CIãã¤ãã©ã¤ã³ãå ¬éãããã¨ã§ãã¦ã¼ã¶ã¼ãããç¬èªã®æ©è½è¿½å ãããããã°ãã£ãã¯ã¹ãããããOKDã«å¯¾ãã¦ãã£ã¼ãããã¯ãããããªããã¨ãç®æãã¦ãã¾ãã
æå¾ã«
Advent Calendaråæ¥ã¨ããããã§ãOpenShiftã®ç´¹ä»ãããã¦ããã ãã¾ãããæ©ä¼ããã£ãããã²OpenShift/OKDã試ãã¦ã¿ã¦ãã ãããã
- ããã§è¨ããKubernetesã®æ¨æºã¸ã®æºæ ãã¯APIã®äºææ§ãæå³ãã¦ãããKubernetesã«å¯¾ãã¦åããDeploymentçã®ãããã§ã¹ãããã®ã¾ã¾OpenShiftã§ç¨¼åãããã¨ãæå³ããããã§ã¯ããã¾ãããä¾ãã°OpenShiftã¯ããã©ã«ãã§ã¯ããªãå³ããã»ãã¥ãªãã£è¨å®ã¨ãªã£ã¦ãããroot権éã§åã(ãããã¯ç¹å®ã®UIDãæå®ãã)ã³ã³ããã¤ã¡ã¼ã¸ãOpenShiftã§åããããã«ã¯ãSecurity Contextãè¨å®ããå¿ è¦ãããã¾ãã↩
- ããã§æãããã®ã¯ç¡åã§è¿½å ã§ããOperatorã§ããããã®ä»ã«ããã«ãã¯ã©ã¹ã¿ç®¡çãRook Cephãã¼ã¹ã®ã¹ãã¬ã¼ã¸ãªã©ãæåã®è£½åãããã¾ãã↩
- 以åãã³ãã¥ããã£çããOpenShift Originãã¨å¼ãã§ããæ代ãããããã®é ã¯åã«ãOpenShiftãã¨ããã¨OCPã¨Originã®ç·ç§°ãæå³ãã¦ãã...ãããªæ°ããã¾ãããã®åæ®ããããã¾ããã↩
- Metal³ - Metal Kubed↩
- Pull Secret (ã³ã³ããã¤ã¡ã¼ã¸ãpullããããã®ã¯ã¬ãã³ã·ã£ã«æ å ±) ãåå¾ããããã«ãRed Hatã®ã«ã¹ã¿ãã¼ãã¼ã¿ã«ã§ã¦ã¼ã¶ã¼ç»é²ãã¦ããã ãå¿ è¦ãããã¾ãã↩
- 解éãé£ãã表ç¾ã§ãã...↩
- CentOS Streamãã¼ã¹ã®CoreOS (SCOS) ãéçºä¸ã§ã https://github.com/openshift/os↩