Red Hatã§ã½ãªã¥ã¼ã·ã§ã³ã¢ã¼ããã¯ãããã¦ããç°ä¸å¸æ©(@tnk4on)ã§ãã ãã®é£è¼ã¯vSphereç°å¢ä¸ã«OpenShift Container Platformï¼ä»¥ä¸ãOpenShiftï¼ããã³OpenShift Virtualizationã®ç°å¢ãæ§ç¯ããæ¹æ³ã解説ããã·ãªã¼ãºã§ãã
第3åã¯å ±æã¹ãã¬ã¼ã¸ã®ä½æã«ã¤ãã¦è§£èª¬ãã¾ããä»å¾ã®é£è¼äºå®ã¯ä¸è¨ã®éãã§ãã
- 第1åï¼OpenShiftã®ã¤ã³ã¹ãã¼ã«
- 第2åï¼OpenShiftã¤ã³ã¹ãã¼ã«å¾ã®ä½æ¥
- 第3åï¼å ±æã¹ãã¬ã¼ã¸ã®ä½æï¼NFS CSIãã©ã¤ãã¼ã®æ§ç¯ï¼ï¼âæ¬è¨äºï¼
- 第4åï¼OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨å®è¡
- 第5åï¼vSphereä»®æ³ãã·ã³ã®ç§»è¡
- ãçªå¤ç·¨ãï¼å ±æã¹ãã¬ã¼ã¸ã®ä½æï¼NFSãããã¸ã§ãã¼ã®æ§ç¯ï¼
ï¼2024/7/17追è¨ï¼2ã¤ç®ã®ãã£ã¹ã¯ã/mnt/nfsã«ãã¦ã³ãããæé ã追å ãã¾ããï¼
ï¼2024/7/23追è¨ï¼NFS CSIãã©ã¤ãã¼ã使ç¨ããå 容ã«å¤æ´ãã¾ããã以åã®å 容ã¯çªå¤ç·¨ã¨ãã¦å¥è¨äºã«ãã¾ãããï¼
ï¼2024/9/29追è¨ï¼NFS CSIãã©ã¤ãã¼ã®ã¢ãããã¼ãæ¹æ³ã追å ãã¾ããï¼
ï¼2024/10/2追è¨ï¼è¸ã¿å°ãµã¼ãã¼ã«2ã¤ç®ã®ãã£ã¹ã¯ã追å ããã³ãã³ããä¿®æ£ãã¾ããï¼
-ç®æ¬¡-
- å ±æã¹ãã¬ã¼ã¸ã®ä½ææ¦è¦
- åææ¡ä»¶
- 1. OpenShift Virtualizationã«å¿ è¦ãªã¹ãã¬ã¼ã¸
- 2. è¸ã¿å°ãµã¼ãã¼ä¸ã®NFSãµã¼ãã¼è¨å®
- 3. NFS CSIãã©ã¤ãã¼ã®è¨å®
- 3-1 NFS CSIãã©ã¤ãã¼ã«ã¤ãã¦
- 3-2 NFS CSIãã©ã¤ãã¼ã®åä½
- 3-3 NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«
- 3-4 ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã¨ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ã®ä½æ
- 3-5 ããã©ã«ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®è¨å®
- 3-6 åçãããã¸ã§ãã³ã°ã®åä½ãã¹ã
- 4. ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã®è¨å®
- ã¾ã¨ã
å ±æã¹ãã¬ã¼ã¸ã®ä½ææ¦è¦
æ¬è¨äºã§ã¯OpenShift Virtualizationã«å¿ è¦ãªå ±æã¹ãã¬ã¼ã¸ã®ä½æãç®çã¨ãã¦ãä¸è¨ã®å 容ãç´¹ä»ãã¾ãã
- OpenShift Virtualizationã«å¿ è¦ãªã¹ãã¬ã¼ã¸
- è¸ã¿å°ãµã¼ãã¼ä¸ã®NFSãµã¼ãã¼è¨å®
- NFS CSIãã©ã¤ãã¼ã®è¨å®
- ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã®è¨å®
OpenShiftã®æ¨æºãµãã¹ã¯ãªãã·ã§ã³ã§ããOpenShift Container Platformï¼OCPï¼ããã®ä¸ä½ã¨ãã£ã·ã§ã³ã®OpenShift Kubernetes Engineï¼OKEï¼*1ã¯è¤æ°ãã¼ãããæ¸ãè¾¼ã¿å¯è½ãªå ±æã¹ãã¬ã¼ã¸ã®æ©è½ã¯æ¨æºæè¼ãã¦ãã¾ããã é常ã¯OpenShiftã¯ã©ã¹ã¿ã¼å¤é¨ã®ã¹ãã¬ã¼ã¸è£½åãå©ç¨ããå½¢æ ã§ãããæ§æãã¾ãã 対ãã¦ãOCPã®ä¸ä½ã¨ãã£ã·ã§ã³ã®OpenShift Platform Plusï¼OPPï¼*2ã«ã¯OpenShift Data Foundationï¼ODFï¼*3ãå«ã¾ãã¾ãããã®ODFã使ç¨ãããã¨ã§OpenShiftãHCIã§æ§æãå ±æã¹ãã¬ã¼ã¸ãæä¾ã§ããããã«ãªãã¾ãï¼vSphereã§è¨ãã¨ããã®vSANã¨åæ§ã®ãã¨ãã§ããã¨ã¤ã¡ã¼ã¸ãã ããï¼ã ODFã¯OpenShiftã«çµ±åãããã¹ãã¬ã¼ã¸ã§ãããããå®ç¨¼åç°å¢ã«ãããæ¨å¥¨ãããã¹ãã¬ã¼ã¸ã®é¸æã§ãã
ããããªãããODFã¯ãã®æ§æä¸é常ã«å¤ãã®ãªã½ã¼ã¹ã使ç¨ãã¾ãã潤沢ãªãªã½ã¼ã¹ããªãç°å¢ã§ã®å©ç¨ã¯é£ãããããä»åã®æ¤è¨¼ç°å¢ã§ODFã¯å©ç¨ãã¾ããã ä»åã¯1å°ã®RHELï¼ã¾ãã¯ä»ã®Linuxçã§ãå¯ï¼ã§æ§æã§ããNFSãå©ç¨ããã·ã³ãã«ãªå ±æã¹ãã¬ã¼ã¸ãä½æãããã¨ã¨ãã¾ãã ãªãããã®ã¹ãã¬ã¼ã¸ã¯ããã¾ã§æ¤è¨¼ç¨éã§ãããå®ç¨¼åç°å¢ã§ã®å©ç¨ã¯ã§ãã¾ããã®ã§ã注æãã ããã*4
åææ¡ä»¶
- é£è¼ç¬¬1åããã³ç¬¬2åã®ä½æ¥ãå®äºãã¦ãããã¨ã¨ãã¾ã
- å ¨ä½ã®æ§æãåãã©ã¡ã¼ã¿ã¼ãªã©ã¯é£è¼ç¬¬1åãåç §ãã¦ãã ãã
- ä½æ¥ç¨ç«¯æ«ã®ããã³ããã¯
%
ã¨ãã¾ã - è¸ã¿å°ãµã¼ãã¼ã®ããã³ããã¯
$
ã¨ãã¾ã - è¸ã¿å°ãµã¼ãã¼ã®ä½æ¥ã¯æ示çã«è¨è¼ãããå ´åãé¤ãã¦ãä½æ¥ãã£ã¬ã¯ããª
${HOME}/work
ã§ä½æ¥ãããã¨ã¨ãã¾ã
1. OpenShift Virtualizationã«å¿ è¦ãªã¹ãã¬ã¼ã¸
1-1 ã¹ãã¬ã¼ã¸ã®ã¢ã¯ã»ã¹ã¢ã¼ãã«ã¤ãã¦
OpenShift Virtualizationã«å¿ è¦ãªã¹ãã¬ã¼ã¸ã®è¦ä»¶ã«ã¤ãã¦ã¯OpenShiftã®ã¤ã³ã¹ãã¼ã«ããã¥ã¡ã³ãã«è¨è¼ãããã¾ãã ãã®ä¸ç¯ã«ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã«ã¤ãã¦ã®è¦ä»¶ã®è¨è¼ãããã¾ãã
ã©ã¤ããã¤ã°ã¬ã¼ã·ã§ã³ã«ã¯å ±æã¹ãã¬ã¼ã¸ãå¿ è¦ã§ããOpenShift Virtualizationã®ã¹ãã¬ã¼ã¸ã¯ãReadWriteMany(RWX)ã¢ã¯ã»ã¹ã¢ã¼ãããµãã¼ããã使ç¨ããå¿ è¦ãããã¾ãã
第12ç« ãã¢ã¡ã¿ã«ã¸ã®ã¤ã³ã¹ãã¼ã« | Red Hat Product Documentation
ReadWriteMany(RWX)ã¢ã¼ãã¨ã¯ãè¤æ°ã®ãã¼ãããã®èªã¿æ¸ãï¼ReadWriteï¼ã«å¯¾å¿ããã¢ã¯ã»ã¹ã¢ã¼ãã®ãã¨ã§ãã 対ãã¦ReadWriteOnce (RWO)ã¨ã¯ã1ã¤ã®ãã¼ãããèªã¿æ¸ãã«å¯¾å¿ããã¢ã¯ã»ã¹ã¢ã¼ãã§ãã
ã¢ã¯ã»ã¹ã¢ã¼ãã¯ä»ã«ãReadOnlyManyï¼ROXï¼ãReadWriteOncePodï¼RWOPï¼ãããã¾ããæ¬è¨äºã§ã¯è©³ç´°ãªè§£èª¬ã¯çç¥ãã¾ãã OpenShiftã対å¿ãã¦ããã¢ã¯ã»ã¹ã¢ã¼ãã®è©³ç´°ã«ã¤ãã¦ã¯ä¸è¨ããã¥ã¡ã³ãã®ã表3.1 ã¢ã¯ã»ã¹ã¢ã¼ãããåç §ãã ããã
OpenShiftã§ã¯ãããã¯ããã¡ã¤ã«ããªãã¸ã§ã¯ãã®3種é¡ã®ã¹ãã¬ã¼ã¸ã¿ã¤ãã«å¯¾å¿ãã¦ãããRWXã¢ã¼ãã§å©ç¨å¯è½ãªã®ã¯ãã¡ã¤ã«ããªãã¸ã§ã¯ãã®ã¿ã¤ãã§ãã
OpenShiftã§æ¨å¥¨ãããã¹ãã¬ã¼ã¸ã®ã¿ã¤ã
第7ç« ã¹ã±ã¼ã©ããªãã£ã¨ããã©ã¼ãã³ã¹ã®æé©å | Red Hat Product Documentation
ä»åã¯æ§ç¯ãç°¡åãªNFSã使ã£ããã¡ã¤ã«ã¹ãã¬ã¼ã¸ãå ±æã¹ãã¬ã¼ã¸ã¨ãã¦ä½¿ç¨ãã¾ãã
1-2 æ°¸ç¶ã¹ãã¬ã¼ã¸
OpenShiftããµãã¼ãããã¹ãã¬ã¼ã¸ã®ã¿ã¤ãã¯å¤§å¥ãã¦2ã¤ã®ã«ãã´ãªã¼ã«å¤§å¥ããã¾ãã
- ä¸æã¹ãã¬ã¼ã¸ï¼Podã¨ã³ã³ããã¼ãçæéã®ãã¼ã«ã«ã¹ãã¬ã¼ã¸ã®æä½ã«ä½¿ç¨ããåèµ·åãé害ã§ãã¼ã¿ã失ããããã¨ãæ³å®ããã¹ãã¬ã¼ã¸
- æ°¸ç¶ã¹ãã¬ã¼ã¸ï¼Podã¨ã³ã³ããã¼ããã¼ã¿ã®æ°¸ç¶æ§ãä¿è¨¼ããåèµ·åãé害å¾ããã¼ã¿ãä¿æãããã¹ãã¬ã¼ã¸
OpenShift Virtualizationã§ã¯ä»®æ³ãã·ã³ã®ãã£ã¹ã¯ãæ°¸ç¶åããã¦ããå¿ è¦ãããããã使ç¨ããã¹ãã¬ã¼ã¸ã®ã¿ã¤ãã¯æ°¸ç¶ã¹ãã¬ã¼ã¸ã«ãªãã¾ãã æ¬è¨äºã§ã¯ä¸æã¹ãã¬ã¼ã¸ã«ã¤ãã¦ã¯è§¦ãã¾ããã®ã§ã詳細ã¯ä¸è¨ããã¥ã¡ã³ããåç §ãã ããã
1.2. ã¹ãã¬ã¼ã¸ã¿ã¤ã | Red Hat Product Documentation
1-3 æ°¸ç¶ããªã¥ã¼ã ã®åçãããã¸ã§ãã³ã°
OpenShiftã§Podãã³ã³ããã§æ°¸ç¶ã¹ãã¬ã¼ã¸ãå©ç¨ããå ´åã¯æ°¸ç¶ããªã¥ã¼ã ï¼PVï¼ãå©ç¨ãã¾ãã PVã¯OpenShiftã¯ã©ã¹ã¿å ã§æ°¸ç¶çãªã¹ãã¬ã¼ã¸ãªã½ã¼ã¹ãæä¾ããããã®ãªãã¸ã§ã¯ãã§ãã ã¾ããPVã¯ã¯ã©ã¹ã¿å ¨ä½ã§å©ç¨å¯è½ãªã¹ãã¬ã¼ã¸ãæ½è±¡åããã³ã³ããã®ã©ã¤ããµã¤ã¯ã«ã¨ã¯ç¬ç«ãã¦ãã¼ã¿ãä¿åã§ãã¾ãã
PVã®åçãããã¸ã§ãã³ã°ã¨ã¯ãå¿ è¦ãªã¨ãã«å¿ è¦ãªéã®ã¹ãã¬ã¼ã¸ãèªåçã«å²ãå½ã¦ãæ©è½ã§ããããã«ããã管çè ã¯äºåã«å¤§éã®ã¹ãã¬ã¼ã¸ã確ä¿ããå¿ è¦ããªããªããå¹ççãªãªã½ã¼ã¹å©ç¨ãå¯è½ã¨ãªãã¾ãã
[PVã®åçãããã¸ã§ãã³ã°ã¡ãªãã]
- èªåå: æåã§ã®ã¹ãã¬ã¼ã¸å²ãå½ã¦ã®æéãçããã
- å¹çå: å¿ è¦ãªåã ãã¹ãã¬ã¼ã¸ãå²ãå½ã¦ããããç¡é§ãå°ãªãã
- ã¹ã±ã¼ã©ããªãã£: å¿ è¦ã«å¿ãã¦ã¹ãã¬ã¼ã¸ãå¢æ¸ã§ãããããã·ã¹ãã ã®ã¹ã±ã¼ã«ã¢ããã»ãã¦ã³ã容æã
æåãããã¸ã§ãã³ã°ã¨åçãããã¸ã§ãã³ã°ã®PVä½æã®ããã¼ãå³ã§è¡¨ãããã®ãä¸è¨ã«ãªãã¾ãã
1-4 Container Storage Interface (CSI)
Container Storage Interface (CSI)ã¯ãç°ãªãã³ã³ããã¼ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã·ã¹ãã éã§ã³ã³ããã¼ã¹ãã¬ã¼ã¸ã管çããããã®APIä»æ§ã§ã*5ã ã¹ãã¬ã¼ã¸ãã³ãã¼ã¯CSIã«æºæ ãããã©ã°ã¤ã³ï¼ãã©ã¤ãã¼ï¼ãéçºãããã¨ã§ãä»ã®ã³ã³ããã¼ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã·ã¹ãã ã§ããã©ã°ã¤ã³ã«å¯¾å¿ããã¹ãã¬ã¼ã¸ãæ©è½ããããã«ãã¾ãã CSIã¯ã¹ãã¬ã¼ã¸ãå ±éåããä»æ§ã§æ½è±¡åãããã¨ã«ãããæ¥ç¶ã«å¿ è¦ãªæé ãä¸å¾åããã³ã³ããã¼ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã·ã¹ãã ãå¤æ§ãªã¹ãã¬ã¼ã¸ã«å¯¾å¿ãå¯è½ã¨ãªãã¾ãã
OpenShiftã¯Kubernetesãæ¡å¼µãããã®ã§ãããç´ç²ãªã¢ããã¹ããªã¼ã çã®Kubernetesï¼ããããVanilla Kubernetesï¼ã¨åæ§ã«CSIãã©ã¤ãã¼ãå©ç¨ã§ãã¾ãã ãã®CSIãã©ã¤ãã¼ãå©ç¨ãããã¨ã§PVã®åçãããã¸ã§ãã³ã°ãè¡ããã¨ãã§ãã¾ãã
2. è¸ã¿å°ãµã¼ãã¼ä¸ã®NFSãµã¼ãã¼è¨å®
ä»åã®æ¤è¨¼ç°å¢ã®æ§æã§ã¯æ°¸ç¶ã¹ãã¬ã¼ã¸ã®å ã¨ãªãNFSãµã¼ãã¼ã¯è¸ã¿å°ãµã¼ãã¼ä¸ã§å®è¡ãã¾ãã ãã®ããã«ãã¾ãã¯Linuxã§NFSãµã¼ãã¼ãå®è¡ããåºæ¬æ©è½ã¨ãã¦ãNFSã®ã¨ã¯ã¹ãã¼ããè¡ãã¾ãã
2-1 NFSãµã¼ãã¼ã®è¨å®
NFSãã¨ã¯ã¹ãã¼ãããåºç¹ã¨ãªããã£ã¬ã¯ããªãä½æãã¾ãã
ãã®ãã£ã¬ã¯ããªã¯OSã®èµ·åãã£ã¹ã¯ã¨ã¯å¥ã®ãã£ã¹ã¯ä¸ã«ä½æãããã¨ã¨ãã¾ãã
第1åã§è¸ã¿å°ãµã¼ãã¼ã®ä»®æ³ãã·ã³ã«2ã¤ç®ã®ãã£ã¹ã¯ã追å ãã¦ããªãå ´åã¯è¿½å ãã¦ãã ããã
govc
ã³ãã³ãã§å®è¡ããå ´åã¯ä¸è¨ã®ã³ãã³ãã使ç¨ãã¾ãã
è¸ã¿å°ãµã¼ãã¼ã«2ã¤ç®ã®ãã£ã¹ã¯ã追å ãã¾ãã
$ node=bastion $ govc vm.disk.create \ -vm ${node} \ -name "${node}/${node}_1.vmdk" \ -size 500G \ -thick=false \ -ds=NVMe
ãã£ã¹ã¯ããã¤ã¹ã確èªãã¾ãã ä¸è¨ã®ããã«2ã¤ç®ã®ãã£ã¹ã¯ã追å ããã¾ããã
$ govc device.ls -vm ${node} | grep disk disk-1000-0 VirtualDisk 104,857,600 KB disk-1000-1 VirtualDisk 524,288,000 KB
2ã¤ç®ã®ãã£ã¹ã¯ãOSä¸ã§ä½¿ç¨ã§ããããã«ãã/mnt/nfs
ã«ãã¦ã³ããã¾ãã
ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ããï¼2ã¤ç®ã®ãã£ã¹ã¯ã/dev/sdbã«ãããã¨ã¨ãã¾ãï¼
$ sudo parted /dev/sdb --script mklabel gpt $ sudo parted /dev/sdb --script mkpart primary ext4 0% 100% $ sudo mkfs.ext4 /dev/sdb1 $ sudo mkdir -p /mnt/nfs $ echo '/dev/sdb1 /mnt/nfs ext4 defaults 0 0' | sudo tee -a /etc/fstab $ sudo systemctl daemon-reload $ sudo mount -a
æ£å¸¸ã«ãã¦ã³ãããã¦ããã確èªãã¾ãã
$ df -h /mnt/nfs ãã¡ã¤ã«ã·ã¹ ãµã¤ãº ä½¿ç¨ æ®ã 使ç¨% ãã¦ã³ãä½ç½® /dev/sdb1 492G 28K 467G 1% /mnt/nfs
次ã«/etc/exports
ãã¡ã¤ã«ã«NFSã¨ã¯ã¹ãã¼ãç¨ã®è¨å®ã追è¨ãã¾ãã
$ sudo vi /etc/exports /mnt/nfs 192.168.1.0/24(rw,async,no_subtree_check,no_root_squash)
exportfs -r
ã³ãã³ãã使ç¨ãã¦è¨å®ã®æ¤è¨¼ãè¡ãã¾ããè¨å®ã«åé¡ããªããã°ä½ãåºåã¯ããã¾ããã
$ sudo exportfs -r $
ãã¨ãã°ãã¨ã¯ã¹ãã¼ããããã£ã¬ã¯ããªãè¦ã¤ãããªãå ´åã¯ä¸è¨ã®ã¨ã©ã¼ãåºã¾ãã
$ sudo exportfs -r exportfs: Failed to stat /mnt/nfs: No such file or directory
NFSã¨ã¯ã¹ãã¼ãã®è¨å®ã«åé¡ããªããã°ãã¡ã¤ã¢ã¼ã¦ã©ã¼ã«ã®è¨å®ãè¡ãã¾ãã NFSã§ä½¿ç¨ãããã¼ãããã¡ã¤ã¢ã¼ã¦ã©ã¼ã«è¨å®ã«è¿½è¨ãã¾ãã
$ sudo firewall-cmd --add-service nfs --permanent $ sudo firewall-cmd --reload
NFSãµã¼ãã¹ãèªåèµ·åãµã¼ãã¹ã«ç»é²ããåæã«èµ·åãã¾ãã
$ sudo systemctl enable --now nfs-server
ããã§NFSãµã¼ãã¼ã®è¨å®ãå®äºãã¾ããã
3. NFS CSIãã©ã¤ãã¼ã®è¨å®
è¸ã¿å°ãµã¼ãã¼ä¸ã«æ§ç¯ããNFSãµã¼ãã¼ãå©ç¨ãã¦PVã®åçãããã¸ã§ãã³ã°ãè¡ããããOpenShiftã«NFS CSI driver for Kubernetesï¼ä»¥ä¸ãNFS CSIãã©ã¤ãã¼ï¼ãã¤ã³ã¹ãã¼ã«ãã¾ãã
3-1 NFS CSIãã©ã¤ãã¼ã«ã¤ãã¦
OpenShiftã§PVã®åçãããã¸ã§ãã³ã°ãè¡ãããã«ã¯ã¹ãã¬ã¼ã¸ã¨ããã«å¯¾å¿ããCSIãã©ã¤ãã¼ãå¿ è¦ã§ãã ä»åæ§ç¯ããã¹ãã¬ã¼ã¸ã¯RHELã§ç«ã¦ãæ±ç¨çãªNFSãµã¼ãã¼ãªã®ã§å°ç¨ã®CSIãã©ã¤ãã¼ãããã¾ããã ããã§ä»åã¯ãæ±ç¨çãªNFSãµã¼ãã¼ãããã¯ã¨ã³ãã«ä½¿ç¨ãPVã®åçãããã¸ã§ãã³ã°ãè¡ããã¨ãã§ããNFS CSIãã©ã¤ãã¼ãå©ç¨ãã¾ãã
ãã®NFS CSIãã©ã¤ãã¼ã¯Kubernetes CSIã§ãã¹ãããã¦ãããªãã¸ããªã®1ã¤ã§ããOSSã§éçºããã¦ããApache-2.0 licenseã«å¾ãç¡åã§å©ç¨ã§ãã¾ãã
kubernetes-csi/csi-driver-nfs: This driver allows Kubernetes to access NFS server on Linux node.
NFS CSIãã©ã¤ãã¼ã¯fsGroupPolicyãVolume SnapshotãVolume Cloningã«å¯¾å¿ãã¦ãã¾ãã
å®ç¨¼åç°å¢ã§ã¯ã¹ãã¬ã¼ã¸ãã³ãã¼ãªã©ã®è£½åããå©ç¨ãã ããã
3-2 NFS CSIãã©ã¤ãã¼ã®åä½
NFS CSIãã©ã¤ãã¼ã®åä½ã®æµãã¯ä¸è¨ã®éãã§ã
3-3 NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«
NFS CSIãã©ã¤ãã¼ãã¤ã³ã¹ãã¼ã«ããæµãã¯ä¸è¨ã®ã¨ããã§ãã
- Helmã®ã¤ã³ã¹ãã¼ã«
- NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«
ç¾æç¹ã§ã¯ã³ãã³ãã®è©³ç´°ãæ·±ãç解ããå¿ è¦ã¯ããã¾ãããã¾ãã¯ãã¾ããªãçã«ã³ãã³ããã³ãããã¦å®è¡ãã¦ãã ããã
ï¼1ï¼Helmã®ã¤ã³ã¹ãã¼ã«
NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«ã§Helm*6ã使ç¨ãã¾ãã Helmã¯ããã±ã¼ã¸ããã¼ã¸ã£ã¼ã®1ã¤ã§ãã¢ããªã±ã¼ã·ã§ã³ãããã±ã¼ã¸ï¼Helmã§ã¯ãã£ã¼ãã¨ããï¼ã¨ãã¦Kuberenetesä¸ã«ç°¡åã«ãããã¤ã§ããä»çµã¿ã§ãã ä»åã®æ§æã§ã¯è¸ã¿å°ãµã¼ãã¼ã«Helmãã¤ã³ã¹ãã¼ã«ãã¾ããHelmã®ã¤ã³ã¹ãã¼ã«ããã¥ã¡ã³ãã¯ä¸è¨ã§ãï¼æ¬è¨äºã§ã¯Red Hatãæä¾ãã¦ããHelmã®ãã¤ããªãå©ç¨ãã¾ãï¼ã
6.2. Helm ã®ã¤ã³ã¹ãã¼ã« | Red Hat Product Documentation
x86_64ã®ç°å¢ã«Helmãã¤ã³ã¹ãã¼ã«ããã³ãã³ãä¾ã¯ä¸è¨ã®ã¨ããã§ãã
$ sudo curl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-linux-amd64 -o /usr/local/bin/helm $ sudo chmod +x /usr/local/bin/helm
Helmã®ã¤ã³ã¹ãã¼ã«å¾ãhelm
ã³ãã³ããå®è¡ãã¦åä½ç¢ºèªãè¡ãã¾ãã
$ helm version WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/user/work/auth/kubeconfig WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/user/work/auth/kubeconfig version.BuildInfo{Version:"v3.14.4+37.el9", GitCommit:"7163c12e65c8c0a40334c0a4b514b991ea37aa21", GitTreeState:"clean", GoVersion:"go1.21.9 (Red Hat 1.21.9-2.el9_4)"}
KUBECONFIG
ç°å¢å¤æ°ãã»ããããã¦ãã¦ããã¤kubeconfig
ãã¡ã¤ã«ã®ãã¼ããã·ã§ã³ãææè
以å¤ããèªã¿è¾¼ã¿å¯è½ã«ãªã£ã¦ããã¨ã³ãã³ãã®åºåã«è¦åãåºã¾ãã
æ°ã«ãªãæ¹ã¯chmod
ã³ãã³ãã§ãã¼ããã·ã§ã³ãå¤æ´ãã¦ãã ããã
$ chmod 600 auth/kubeconfig
ï¼2ï¼NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«
NFS CSIãã©ã¤ãã¼ã¯OpenShiftã«ã¤ã³ã¹ãã¼ã«ãã¾ããåãã«ãã£ã¼ããªãã¸ããªã追å ãããã®å¾ã«ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã
helm repo add
ã³ãã³ãã§NFS CSIãã©ã¤ãã¼ã®ãã£ã¼ããªãã¸ããªã追å ãã¾ãã
å®è¡ã³ãã³ã
$ helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
å®è¡ã³ãã³ãã¨çµæ
$ helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts "csi-driver-nfs" has been added to your repositories
~/.config/helm
ãã£ã¬ã¯ããªãä½æãããåç §ãããªãã¸ããªã®æ å ±ãä¿åããã¾ã
helm install
ã³ãã³ãã§NFS CSIãã©ã¤ãã¼ãã¤ã³ã¹ãã¼ã«ãã¾ãã
--version
ãªãã·ã§ã³ã使ã£ã¦ãã¼ã¸ã§ã³ãæå®ãã¾ããï¼è¨äºå·çæç¹ã§ã®ææ°çã¯v4.8.0ï¼
å®è¡ã³ãã³ã
$ helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.8.0
--namespace kube-system
ï¼ã¤ã³ã¹ãã¼ã«å ã®ãã¼ã ã¹ãã¼ã¹ã«kube-system
ãæå®--version v4.8.0
ï¼ã¤ã³ã¹ãã¼ã«ãããã¼ã¸ã§ã³ãæå®ãæå®ãããã¼ã¸ã§ã³ã¯NFS CSIãã©ã¤ãã¼ã®ãªãªã¼ã¹ãã¼ã¸*7ãåç §ã®ãã¨
helm install
ã³ãã³ããå®è¡ããã¨ä¸è¨ã®ãããªå¿çãåºåããã¾ã
å®è¡ã³ãã³ãã¨çµæ
$ helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.8.0 NAME: csi-driver-nfs LAST DEPLOYED: Fri Jul 19 10:40:55 2024 NAMESPACE: kube-system STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: The CSI NFS Driver is getting deployed to your cluster. To check CSI NFS Driver pods status, please run: kubectl --namespace=kube-system get pods --selector="app.kubernetes.io/instance=csi-driver-nfs" --watch
NFS CSIãã©ã¤ãã¼ãæ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ã§ãããã©ããã¯æ¬¡ã®æé ã§ç¢ºèªãã¾ãã
ï¼è¿½è¨ï¼NFS CSIãã©ã¤ãã¼ã®ã¢ãããã¼ã
NFS CSIãã©ã¤ãã¼ã®ãªãªã¼ã¹ãã¼ã¸*8ã§æ°ãããã¼ã¸ã§ã³ããªãªã¼ã¹ãããå ´åã¯ãhelm repo update
ãè¡ããã¨ã§æ°ãããã¼ã¸ã§ã³ã®ã¤ã³ã¹ãã¼ã«ãè¡ããã¨ãã§ãã¾ãã
ä¸è¨ã¯ãã£ã¼ããªãã¸ããªã®ã¢ãããã¼ããè¡ããv4.9.0
ãã¤ã³ã¹ãã¼ã«ããæé ã§ãã
å®è¡ã³ãã³ã
$ helm repo update $ helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.9.0
å®è¡ã³ãã³ãã¨çµæ
$ helm repo update Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "csi-driver-nfs" chart repository Update Complete. âHappy Helming!â $ helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.9.0 NAME: csi-driver-nfs LAST DEPLOYED: Thu Sep 26 23:18:01 2024 NAMESPACE: kube-system STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: The CSI NFS Driver is getting deployed to your cluster. To check CSI NFS Driver pods status, please run: kubectl --namespace=kube-system get pods --selector="app.kubernetes.io/instance=csi-driver-nfs" --watch
ï¼3ï¼NFS CSIãã©ã¤ãã¼ã®ã¤ã³ã¹ãã¼ã«ã®ç¢ºèª
OpenShiftã®Webã³ã³ã½ã¼ã«ããã管çè åã表示ãã®ãã«ãã¦ã³ãé¸æããéçºè ããé¸æãã¾ãã ããã«ããéçºè åã表示ï¼Developerãã¼ã¹ãã¯ãã£ãï¼ã«åãæ¿ãããã¨ãã§ãã¾ãã
å·¦ã®ã¡ãã¥ã¼ããããããã¸ã¼ããé¸æãã¾ããããã¸ã§ã¯ãã®ãã«ãã¦ã³ã¡ãã¥ã¼ããããã¹ã¦ã®ããã¸ã§ã¯ãããé¸æãã¾ãã ãããã©ã«ãããã¸ã§ã¯ãã®è¡¨ç¤ºãã¹ã¤ããããªã³ã«ãã¾ãã
ãããã©ã«ãããã¸ã§ã¯ãã®è¡¨ç¤ºãããªã³ã«ãããã¨ã§OpenShiftä¸ã®ç®¡çç¨ã®ããã¸ã§ã¯ãã®é¸æãå¯è½ã«ãªãã¾ãã
å
¥åæ¬ã«kube-system
ã¨å
¥åãã¦è¡¨ç¤ºã®ãã£ã«ã¿ãªã³ã°ãè¡ããããã¸ã§ã¯ãæ¬ã«è¡¨ç¤ºãããkube-system
ãé¸æãã¾ãã
ç»é¢å
ã«ãDãã®ã¢ã¤ã³ã³ãã¤ããcsi-nfs-controller
ã¨ãããªãã¸ã§ã¯ãï¼Deploymentï¼ã¨ããDSãã®ã¢ã¤ã³ã³ãã¤ããcsi-nfs-node
ã¨ãããªãã¸ã§ã¯ãï¼DaemonSetï¼ã表示ããã¾ãã
csi-nfs-controller
ãNFS CSIãã©ã¤ãã¼ã®ç®¡çã³ã³ãããcsi-nfs-node
ãåãã¼ãä¸ã§ç¨¼åããå®è¡ã³ã³ããã«ãªãã¾ãã
csi-nfs-controller
ã¨csi-nfs-node
ã®2ã¤ãåããããã®ãcsi-driver-nfs
ã¨ããååã®Helmãã£ã¼ãã¨ãã¦ãããã¤ããã¦ãã¾ãã
å·¦ã®ã¡ãã¥ã¼ããHelmãé¸æããã¨ãç¾å¨é¸æãã¦ããããã¸ã§ã¯ãã«ç»é²æ¸ã¿ã®Helmãªãªã¼ã¹*9ã®æ å ±ã表示ããã¾ãã
ãHRãã¢ã¤ã³ã³ãä»ããHelmãªãªã¼ã¹åï¼ããã§ã¯csi-driver-nfs
ï¼ã®ãªã³ã¯ãé¸æãã¾ãã
ãªã½ã¼ã¹ã¿ããé¸æããã¨ãHelmã§ã¤ã³ã¹ãã¼ã«ããããªã½ã¼ã¹ã®ååãã¿ã¤ããä¸è¦§ã§è¡¨ç¤ºããã¾ãã
3-4 ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã¨ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ã®ä½æ
ã¤ã³ã¹ãã¼ã«ããNFS CSIãã©ã¤ãã¼ã使ã£ã¦PVã®åçãããã¸ã§ãã³ã°ãè¡ãããã«ã¹ãã¬ã¼ã¸ã¯ã©ã¹ï¼StorageClassï¼ãä½æãã¾ãã ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã¨ã¯PVã®åçãããã¸ã§ãã³ã°ãå®ç¾©ããããã«ä½¿ç¨ããã¾ããã¦ã¼ã¶ã¼ã¯å¿ è¦ãªã¹ãã¬ã¼ã¸ã¯ã©ã¹ãæå®ãã¦æ°¸ç¶ããªã¥ã¼ã è¦æ±ï¼PVCï¼ãä½æãã¾ãã ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®è©³ç´°ã«ã¤ãã¦ã¯ä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
5.6. ããã©ã«ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®ç®¡ç | Red Hat Product Documentation
ã¾ããåããã¦OpenShift Virtualizationã§ä»®æ³ãã·ã³ã®ã¹ãããã·ã§ãããåå¾ããããã®ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ï¼VolumeSnapshotClassï¼ãä½æãã¾ãã ããªã¥ã¼ã ã¹ãããã·ã§ããã«ã¤ãã¦ã¯ä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
5.4. CSI ããªã¥ã¼ã ã¹ãããã·ã§ãã | Red Hat Product Documentation
ï¼1ï¼ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®ä½æ
ä¸è¨ã®ã³ãã³ãã§ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®ã«ã¹ã¿ã ãªã½ã¼ã¹ãstorageclass-nfs.yaml
ã¨ããååã§ä½æãã¾ãã
$ cat > storageclass-nfs.yaml <<EOF apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: nfs-csi provisioner: nfs.csi.k8s.io parameters: server: 192.168.1.206 share: /mnt/nfs reclaimPolicy: Delete volumeBindingMode: Immediate EOF
server: 192.168.1.206
ï¼NFSãµã¼ãã¼ã®IPã¢ãã¬ã¹ï¼ã¾ãã¯ãã¹ãåï¼ãæå®ãã¾ãshare: /mnt/nfs
ï¼NFSãµã¼ãã¼ä¸ã§ã¨ã¯ã¹ãã¼ããã¦ãããã¹åãæå®ãã¾ãreclaimPolicy: Delete
ï¼PVãåé¤ããæã«NFSãµã¼ãã¼ä¸ã®ãã¼ã¿ãä¿æãããã©ãããæå®ãã¾ããDelete
ã¯PVCã®åé¤ã¨åæã«PVãåé¤ãããNFSãµã¼ãã¼ä¸ã®å®ãã¼ã¿ãåé¤ããã¾ãã- PVCã®åé¤å¾ãPVã¨ãã¦æ®ãå ´åã¯
Retain
ãPVã¯åé¤ãã¤ã¤ãNFSãµã¼ãã¼ä¸ã®å®ãã¼ã¿ãæ®ãå ´åã¯Archive
ãæå®ãã¾ãã
- PVCã®åé¤å¾ãPVã¨ãã¦æ®ãå ´åã¯
ä¸è¨ã®ã³ãã³ãã§ã¹ãã¬ã¼ã¸ã¯ã©ã¹ãä½æãã¾ãã
$ oc create -f storageclass-nfs.yaml
ï¼2ï¼ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ã®ä½æ
ä¸è¨ã®ã³ãã³ãã§ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ã®ã«ã¹ã¿ã ãªã½ã¼ã¹ãsnapshotclass-nfs.yaml
ã¨ããååã§ä½æãã¾ãã
$ cat > snapshotclass-nfs.yaml <<EOF apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: csi-nfs-snapclass driver: nfs.csi.k8s.io deletionPolicy: Delete EOF
ä¸è¨ã®ã³ãã³ãã§ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ãä½æãã¾ãã
$ oc create -f snapshotclass-nfs.yaml
3-5 ããã©ã«ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®è¨å®
ããã©ã«ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ã¨ã¯2ã¤ä»¥ä¸ã®ã¹ãã¬ã¼ã¸ã¯ã©ã¹ãåå¨ããå ´åã«æ¨æºçã«ä½¿ç¨ãããã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®ãã¨ã§ãã ä»åã®æ§æã§ã¯ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã¯1ã¤ããä½æããã¦ãã¾ããããæ示çã«è¨å®ããã¦ãããã¨ã§ä»ã®ã¹ãã¬ã¼ã¸ã¯ã©ã¹ãããåªå çã«å©ç¨ããããã«ãã¦ããã¾ãã
ããã©ã«ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ãè¨å®ããã«ã¯ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
ä»åã¯ã¹ãã¬ã¼ã¸ã¯ã©ã¹åï¼nfs-csi
ã«å¯¾ãã¦é常ã®ã³ã³ããã¢ããªã±ã¼ã·ã§ã³ã¨ä»®æ³ãã·ã³ã®ä¸¡æ¹ã«ããã©ã«ãè¨å®ãè¡ãã¾ãã
$ oc patch storageclass nfs-csi -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' $ oc patch storageclass nfs-csi -p '{"metadata": {"annotations":{"storageclass.kubevirt.io/is-default-virt-class":"true"}}}'
åæ§ã«ããã©ã«ãããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ãè¨å®ããã³ãã³ããå®è¡ãã¾ãã
ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹åã¯csi-nfs-snapclass
ãæå®ãã¾ãã
$ oc patch volumesnapshotclass csi-nfs-snapclass --type merge -p '{"metadata": {"annotations":{"snapshot.storage.kubernetes.io/is-default-class":"true"}}}' $ oc patch volumesnapshotclass csi-nfs-snapclass --type merge -p '{"metadata": {"annotations":{"snapshot.storage.kubevirt.io/is-default-virt-class":"true"}}}'
è¨å®ãåæ ããã¦ãããä¸è¨ã®ã³ãã³ããå®è¡ãã¦ç¢ºèªãè¡ãã¾ãã
oc get
ã³ãã³ãã§å¼æ°ã«storageclass
ã¨nfs-csi
ãæå®ããããã«-o yaml
ãªãã·ã§ã³ã追å ãã¦ãã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®è¨å®å
容ãYAMLå½¢å¼ã§åºåãè¡ãã¾ãã
$ oc get storageclass nfs-csi -o yaml
åºåçµæå
ã®annotations:
ã«å
ã»ã©è¨å®ããå¤ãåæ ããã¦ããã確èªã§ãã¾ããä¸è¨ã®åºåçµæãå±éãã¦å
容ã確èªãã ããã
åºåçµæãéã
$ oc get storageclass nfs-csi -o yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: storageclass.kubernetes.io/is-default-class: "true" storageclass.kubevirt.io/is-default-virt-class: "true" creationTimestamp: "2024-07-23T05:35:49Z" name: nfs-csi resourceVersion: "596631" uid: 86a54044-89fa-4f49-8c35-6c5bc6cff696 parameters: server: 192.168.1.206 share: /mnt/nfs provisioner: nfs.csi.k8s.io reclaimPolicy: Delete volumeBindingMode: Immediate
åæ§ã«ããªã¥ã¼ã ã¹ãããã·ã§ããã¯ã©ã¹ã®è¨å®å
容ã確èªãã¾ãã
oc get
ã³ãã³ãã®å¼æ°ã¯volumesnapshotclass
ãcsi-nfs-snapclass
æå®ãã¾ãã
$ oc get volumesnapshotclass csi-nfs-snapclass -o yaml
åºåçµæãéã
$ oc get volumesnapshotclass csi-nfs-snapclass -o yaml apiVersion: snapshot.storage.k8s.io/v1 deletionPolicy: Delete driver: nfs.csi.k8s.io kind: VolumeSnapshotClass metadata: annotations: snapshot.storage.kubernetes.io/is-default-class: "true" snapshot.storage.kubevirt.io/is-default-virt-class: "true" creationTimestamp: "2024-07-23T05:37:13Z" generation: 1 name: csi-nfs-snapclass resourceVersion: "597248" uid: 774868f9-23f8-46c7-b02e-bf832d6c31ec
3-6 åçãããã¸ã§ãã³ã°ã®åä½ãã¹ã
NFS CSIãã©ã¤ãã¼ã®è¨å®ãã§ããã®ã§å®éã«ãµã³ãã«ã®Deploymentãå®è¡ãã¦åçãããã¸ã§ãã³ã°ã®åä½ãã¹ããè¡ãã¾ãã
ï¼1ï¼ãµã³ãã«ãã¡ã¤ã«ã®ãã¦ã³ãã¼ã
NFSãããã¸ã§ãã¼ã®ãªãã¸ããªã§å ¬éããã¦ãããµã³ãã«ã®ãã¡ã¤ã«ããã¦ã³ãã¼ããã¾ãã PVCã¨Podã®å®è¡ãå®ç¾©ãããDeploymentã®YAMLãã¡ã¤ã«ããã¦ã³ãã¼ããã¾ãã
$ wget https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/deploy/example/deployment.yaml $ ls -d deployment.yaml deployment.yaml
ï¼2ï¼PVCã¨Podã®ä½æ
oc create
ã³ãã³ãã§YAMLãã¡ã¤ã«ãããªã½ã¼ã¹ãä½æãã¾ãã-f
ãªãã·ã§ã³ã§èªã¿è¾¼ãYAMLãã¡ã¤ã«ãæå®ãã¾ãã
æåã«ãã¹ãå®è¡ç¨ã®ããã¸ã§ã¯ããä½æãããã®ããã¸ã§ã¯ãå
ã«ãªã½ã¼ã¹ãä½æãã¾ãã
ä¸è¨ã®ã³ãã³ãã§ããã¸ã§ã¯ããæ°è¦ä½æãã¾ããååã¯test
ã¨ãã¾ãã
å®è¡ã³ãã³ã
$ oc new-project test
å®è¡ã³ãã³ãã¨çµæ
$ oc new-project test Now using project "test" on server "https://api.ocp.home.lab:6443". You can add applications to this project with the 'new-app' command. For example, try: oc new-app rails-postgresql-example to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application: kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.43 -- /agnhost serve-hostname
ç¶ãã¦Deploymentãªã½ã¼ã¹ãä½æãã¾ãã
å®è¡ã³ãã³ã
$ oc create -f deployment.yaml
å®è¡ã³ãã³ãã¨çµæ
$ oc create -f deployment.yaml persistentvolumeclaim/pvc-deployment-nfs created deployment.apps/deployment-nfs created
PVCã¨Podã®å®è¡ãå®ç¾©ããDeploymentãä½æããã¾ããã
ï¼3ï¼ç¢ºèª
Webã³ã³ã½ã¼ã«ã®ç®¡çè
åã表示ã®ã¡ãã¥ã¼ãããã¹ãã¬ã¼ã¸ï¼PersistentVolumeClaimsããé¸æããã¨ãä½æãããPVCã¨ãã¤ã³ããããPVãä¸è¦§ã§è¡¨ç¤ºããã¾ãã
ãããã¸ã§ã¯ããé¸æãã«ãã¦ã³ããtest
ãé¸ã¶ã¨ãå
ã»ã©ä½æããtest
ããã¸ã§ã¯ãä¸ã«ä½æãããPVCã表示ããã¾ãã
ãã®ãµã³ãã«ã§ã¯ä¸è¨ã®æ å ±ã確èªã§ãã¾ãã
- PVCï¼pvc-deployment-nfs
- PVï¼pvc-43c68d68-95f2-4b2a-99cf-4eef0debba39
- PVã®å®¹éï¼10 GiB
- 使ç¨ããã¹ãã¬ã¼ã¸ã¯ã©ã¹ï¼nfs-csi
è¸ã¿å°ãµã¼ãã¼ä¸ã®NFSã¨ã¯ã¹ãã¼ããã£ã¬ã¯ããªã確èªããã¨ãPVç¨ã®ãã£ã¬ã¯ããªãèªåã§ä½æããã¦ãããã¨ãåããã¾ãã
$ tree /mnt/nfs/ /mnt/nfs/ âââ pvc-43c68d68-95f2-4b2a-99cf-4eef0debba39 âââ outfile 1 directory, 1 file
NFSãµã¼ãã¼ä¸ã«ä½æããããã£ã¬ã¯ããªã®å½åè¦åã¯
PVå
ã¨åããã®ã«ãªãã¾ãã
Webã³ã³ã½ã¼ã«ã®ç®¡çè
åã表示ã®ã¡ãã¥ã¼ãããWorkloadsï¼Podsããé¸æããã¨ãå®è¡ä¸ã®Podãä¸è¦§ã§è¡¨ç¤ºããã¾ãã
ãµã³ãã«ã®Podï¼deployment-nfs-7579c47f6-r6zbq
ï¼ã®ã¹ãã¼ã¿ã¹ãRunning
ã«ãªã£ã¦ããããã®Podãæ£å¸¸ã«å®è¡ãã¦ãããã¨ãåããã¾ãã
Podåã®deployment-nfs-7579c47f6-r6zbq
ã®ãªã³ã¯ãé¸æããã¨Podã®è©³ç´°ç»é¢ã表示ããã¾ãã
ãã®ã³ã³ãããmcr.microsoft.com/oss/nginx/nginx
ã³ã³ããã¤ã¡ã¼ã¸ããä½æããã¦ãã¦ç¶æ
ãRunning
ã«ãªã£ã¦ãããã³ã³ããã®å®è¡ãç¶ç¶ãã¦ãããã¨ã確èªã§ãã¾ãã
ã¾ãããã®ã³ã³ããã§ã¯PVã¯nfs
ã¨ããååã§ããªã¥ã¼ã ã¨ãã¦æ±ããã¦ãããã³ã³ããå
ã®/mnt/nfs
ãã£ã¬ã¯ããªã«èªã¿æ¸ãå¯è½ã§ãã¦ã³ãããã¦ãã¾ãã
ãã®ãµã³ãã«ã§ã¯ã³ã³ããã®å®è¡ã³ãã³ãã¨ãã¦ãã¹ãåã¨æ¥æã1ç§ãã¨ã«ã«ã¼ãã§æ¸ãè¾¼ã¿ç¶ããããã«ããã°ã©ã ããã¦ãã¾ã*10ã
ãã®ããããµã³ãã«ã®Podèµ·åå¾ã«NFSãµã¼ãã¼ä¸ã®ãã£ã¬ã¯ããªã確èªããã¨ãã³ã³ããã®ä¸ã§ä½æãããoutfile
ãã¡ã¤ã«ã«ç¶ç¶çã«ãã¼ã¿ãæ¸ãè¾¼ã¿ç¶ãã¦ãããã¨ãåããã¾ãã
$ tail -f /mnt/nfs/pvc-43c68d68-95f2-4b2a-99cf-4eef0debba39/outfile deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:02 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:03 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:04 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:05 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:06 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:07 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:08 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:09 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:10 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:11 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:12 UTC 2024 deployment-nfs-7579c47f6-r6zbq Tue Jul 23 08:04:13 UTC 2024 ...
ï¼4ï¼ãµã³ãã«ã®Podã¨PVã®åé¤
ä½æãããµã³ãã«ã®Podã¨PVãåé¤ããå ´åã¯ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
oc delete project
ã³ãã³ãã§ããã¸ã§ã¯ããã¨OpenShiftä¸ã®ãªã½ã¼ã¹ãåé¤ãã¾ãã
å®è¡ã³ãã³ã
$ oc delete project test
å®è¡ã³ãã³ãã¨çµæ
$ oc delete project test project.project.openshift.io "test" deleted
å®è¡ä¸ã®ã³ã³ãããå¼·å¶çã«åæ¢ãããã¹ã¦ã®ãªã½ã¼ã¹ãåé¤ããã¾ã§æ°åç§ç¨åº¦ãããã¾ãã
PVåé¤å¾ã®NFSãµã¼ãã¼ä¸ã®å®ä½ãã£ã¬ã¯ããªã¯ä¸è¨ã®ããã«ãªãã¾ãã
$ tree /mnt/nfs/ /mnt/nfs/ 0 directories, 0 files
PVåé¤ã¨åæã«å®ä½ã®ãã£ã¬ã¯ããªãåé¤ããã¾ã
ï¼5ï¼NFS CSIãã©ã¤ãã¼ã®åé¤
NFS CSIãã©ã¤ãã¼ã®åé¤ãè¡ãå ´åã¯helm delete
ã³ãã³ããå®è¡ãã¾ãã
helm delete
ã³ãã³ãã«å¼æ°ã¨ãã¦csi-driver-nfs
ã¨ãã¼ã ã¹ãã¼ã¹ã«kube-system
ãæå®ãã¦å®è¡ãã¾ãã
$ helm uninstall csi-driver-nfs -n kube-system
4. ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã®è¨å®
NFS CSIãã©ã¤ãã¼ãè¨å®ãããã¨ã§æ°¸ç¶ããªã¥ã¼ã ãå©ç¨ã§ããããã«ãªãã¾ããã 次ã¯ãOpenShiftã®ã¤ã³ã¹ãã¼ã«å¾ã®ä½æ¥ã®1ã¤ã§ããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã®è¨å®ãè¡ãã¾ãã
ãã®ä½æ¥ã¯ã¹ãã¬ã¼ã¸ã®è¨å®ãäºåã«å¿ è¦ãªããã第2åã®ã¤ã³ã¹ãã¼ã«å¾ã®ä½æ¥ã§ã¯å¯¾è±¡å¤ã¨ãã¾ãã
4-1 ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®æ§æ
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¯OpenShiftã®å é¨ã§å®è¡ãããã³ã³ããã¬ã¸ã¹ããªã¼ã§ãã ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã¯ãããªãã¯ãªã³ã³ããã¬ã¸ã¹ããªã¼ã¨åæ§ã«ãOpenShiftä¸ã§ãã«ãããã³ã³ããã¤ã¡ã¼ã¸ãç»é²ããããç»é²ããã³ã³ããã¤ã¡ã¼ã¸ããã³ã³ãããå®è¡ã§ãã¾ãã ã¾ããOpenShiftã®å¤é¨ã¨ã®æ¥ç¶å£ï¼ã«ã¼ãï¼ãä½æãããã¨ã§ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãå¤é¨ã¸å ¬éã§ãã¾ãã
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®è¨å®æ¹æ³ã¯OpenShiftã®ã¤ã³ã¹ãã¼ã«ããã¥ã¡ã³ãã«è¨è¼ãããã¾ããä¸è¨ã®ããã¥ã¡ã³ããåç §ãã¦ãã ããã
第24ç« ä»»æã®ãã©ãããã©ã¼ã ã¸ã®ã¤ã³ã¹ãã¼ã« | Red Hat Product Documentation
å®ç¨¼åç°å¢ã«ãããã¬ã¸ã¹ããªã¼ã®æ¨å¥¨ã¹ãã¬ã¼ã¸ã¯ãªãã¸ã§ã¯ãã¹ãã¬ã¼ã¸ã§ãï¼æ¬¡ç¹ã¯ãããã¯ã¹ãã¬ã¼ã¸ï¼ã æ¬è¨äºã§ç´¹ä»ãããã¡ã¤ã«ã¹ãã¬ã¼ã¸ã使ã£ãæ§æã¯ããã¾ã§æ¤è¨¼ç¨éã§ã®å©ç¨ãåæã¨ãã¦ãã¾ãã
ãã¡ã¤ã«ã¹ãã¬ã¼ã¸ã¯ãå®ç¨¼åã¯ã¼ã¯ãã¼ãã使ç¨ãã OpenShift ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã¯ã©ã¹ã¿ã¼ã®ãããã¤ã¡ã³ãã«ã¯æ¨å¥¨ããã¾ããã
4-2 ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®è¨å®
ã¾ããç¾å¨ã®ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®è¨å®ã確èªãã¾ãã
ä¸è¨ã®ã³ãã³ãã§configs.imageregistry.operator.openshift.io
ã®ãªã½ã¼ã¹ããstorage
ã¨managementState
ã®å¤ãåå¾ãã¾ãã
å®è¡ã³ãã³ã
$ oc get configs.imageregistry.operator.openshift.io -o json | jq '.items[] | {storage: .spec.storage, managementState: .spec.managementState}'
å®è¡ã³ãã³ãã¨çµæ
$ oc get configs.imageregistry.operator.openshift.io -o json | jq '.items[] | {storage: .spec.storage, managementState: .spec.managementState}' { "storage": {}, "managementState": "Removed" }
storage
ã¯ç©ºã®å¤ãmanagementState
ã¯Removed
ãã»ããããã¦ãã¾ãã
次ã«ãä¸è¨ã®ã³ãã³ããå®è¡ãã¦ã¬ã¸ã¹ããªã¼Podãåå¨ããªããã¨ã確èªãã¾ãã
oc get pod
ã³ãã³ãã§-l
ãªãã·ã§ã³ã使ç¨ããã©ãã«ãdocker-registry=default
ã§ãããããããã£ã«ã¿ãªã³ã°ãã¾ãã
å®è¡ã³ãã³ã
$ oc get pod -n openshift-image-registry -l docker-registry=default
å®è¡ã³ãã³ãã¨çµæ
$ oc get pod -n openshift-image-registry -l docker-registry=default No resources found in openshift-image-registry namespace.
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãã¾ã è¨å®ããã¦ããªããã¨ã確èªã§ãã¾ãããä¸è¨ã®ã³ãã³ããå®è¡ããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãæå¹åãã¾ãã
å®è¡ã³ãã³ã
$ oc patch config.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"storage":{"pvc":{"claim":""}}}}' $ oc patch config.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"managementState":"Managed"}}'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch config.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"storage":{"pvc":{"claim":""}}}}' config.imageregistry.operator.openshift.io/cluster patched $ oc patch config.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"managementState":"Managed"}}' config.imageregistry.operator.openshift.io/cluster patched
ã³ãã³ãã®å®è¡å¾ãå
ã»ã©ã®è¨å®ãå度確èªãã¾ãã
claim
ã«image-registry-storage
ã®å¤ãèªåã§è¿½å ããã¦ãã¾ãã
å®è¡ã³ãã³ã
$ oc get configs.imageregistry.operator.openshift.io -o json | jq '.items[] | {storage: .spec.storage, managementState: .spec.managementState}'
å®è¡ã³ãã³ãã¨çµæ
$ oc get configs.imageregistry.operator.openshift.io -o json | jq '.items[] | {storage: .spec.storage, managementState: .spec.managementState}' { "storage": { "managementState": "Managed", "pvc": { "claim": "image-registry-storage" } }, "managementState": "Managed" }
ãã°ãããã¦ããã¬ã¸ã¹ããªã¼Podã確èªããã¨ãä¸è¨ã®ããã«å ã»ã©ã¯ç¡ãã£ãã¬ã¸ã¹ããªã¼Podãèµ·åãã¦ãããã¨ãåããã¾ãã
$ oc get pod -n openshift-image-registry -l docker-registry=default NAME READY STATUS RESTARTS AGE image-registry-5cd6bf8ddf-mgkpm 1/1 Running 0 53s
ããã©ã«ãã§ã¯ã¬ã¸ã¹ããªã¼Podã®ã¬ããªã«æ°ã¯1ã§å®è¡ããã¾ãã PVã®ã¢ã¯ã»ã¹ã¢ã¼ããRWXããµãã¼ããã¦ããå ´åã¯ã¬ã¸ã¹ããªã¼Podã®ã¬ããªã«æ°ã2ã«ãã¦é«å¯ç¨æ§æ§æãå¯è½ã§ãã
ä¸è¨ã®ã³ãã³ããå®è¡ãã¦èªåã§ä½æãããPVCã¨PVã®è¨å®ã確èªãã¾ãã ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®PVã¯ããã©ã«ãã§100GiBã®å®¹éã使ç¨ãã¾ãã
$ oc get pvc -n openshift-image-registry NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE image-registry-storage Bound pvc-b3c88568-404c-40c1-a4c8-d252b804a9fc 100Gi RWX nfs-csi <unset> 2m4s $ oc get pv -n openshift-image-registry NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE pvc-b3c88568-404c-40c1-a4c8-d252b804a9fc 100Gi RWX Delete Bound openshift-image-registry/image-registry-storage nfs-csi <unset> 2m11s
4-3 ã¬ã¸ã¹ããªã¼ã®å ¬é
OpenShiftä¸ã§èµ·åããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãå¤é¨ããå©ç¨ã§ããããã«å ¬éè¨å®ãè¡ãã¾ãã ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®å ¬éæ¹æ³ã®ããã¥ã¡ã³ãã¯ä¸è¨ã§ãã
第5ç« ã¬ã¸ã¹ããªã¼ã®å ¬é | Red Hat Product Documentation
ä¸è¨ã®ã³ãã³ããå®è¡ãã¦ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãå ¬éãã¾ãã
å®è¡ã³ãã³ã
$ oc patch configs.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"defaultRoute":true}}'
å®è¡ã³ãã³ãã¨çµæ
$ oc patch configs.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"defaultRoute":true}}' config.imageregistry.operator.openshift.io/cluster patched
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®å
¬éå¾ãä¸è¨ã®ã³ãã³ãã§æ¥ç¶ããããã®URLï¼HOST/PORT
)ã確èªã§ãã¾ãã
$ oc get route default-route -n openshift-image-registry NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD default-route default-route-openshift-image-registry.apps.ocp.home.lab image-registry <all> reencrypt None
4-4 ã¬ã¸ã¹ããªã¼ã®æä½
ï¼1ï¼ãã°ã¤ã³
å¤é¨ã®ã³ã³ãããã¼ã«ï¼ä»åã¯Podmanã使ç¨ãã¾ãï¼ããå ¬éããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãå©ç¨ããããã«ã¯ã³ã³ããã¬ã¸ã¹ããªã¼ã¸ã®ãã°ã¤ã³ãå¿ è¦ã§ãã ä¸è¨ã®ã³ãã³ããå®è¡ãã¦ã³ã³ããã¬ã¸ã¹ããªã¼ã¸ã®ãã°ã¤ã³ãè¡ãã¾ãã
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®URLãåå¾ãHOST
ç°å¢å¤æ°ã¸ã»ãããã¾ãã
$ HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}') $ echo ${HOST} default-route-openshift-image-registry.apps.ocp.home.lab
Ingress Operatorã®è¨¼ææ¸ãåå¾ãã¦ã·ã¹ãã ã®ä¿¡é ¼ããã証ææ¸ã¹ãã¢ã«è¿½å ãããã¨ã§ãã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã¸ã®HTTPSã§ã®ã¢ã¯ã»ã¹ãè¡ããããã«ãã¾ãã
oc get secret
ã§è¨¼ææ¸ãåå¾ããè¸ã¿å°ãµã¼ãã¼ä¸ã®è¨¼ææ¸ã¹ãã¢ã«ä¿åãã¾ãã
$ oc get secret -n openshift-ingress router-certs-default -o go-template='{{index .data "tls.crt"}}' | base64 -d | sudo tee /etc/pki/ca-trust/source/anchors/${HOST}.crt > /dev/null
ä¿¡é ¼ãããã«ã¼ã証ææ¸ã®ä¸è¦§ãæ´æ°ãã¾ãã
$ sudo update-ca-trust enable
podman login
ã³ãã³ããå®è¡ãã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã¸ãã°ã¤ã³ãè¡ãã¾ãã
ãã°ã¤ã³ã«ä½¿ç¨ããã¦ã¼ã¶ã¼ã¯ocpadmin
ã使ç¨ãã¾ãã
ocpadmin
ã§ãã°ã¤ã³ãã¦ããªãå ´åã¯äºåã«oc login
ãå®è¡ãã¾ãï¼é£è¼ç¬¬2åãåç
§ï¼ã
$ unset KUBECONFIG $ oc login -u ocpadmin https://api.ocp.home.lab:6443 $ podman login -u ocpadmin -p $(oc whoami -t) ${HOST}
Login Succeeded!
ã表示ãããããã°ã¤ã³æåã§ãã
ï¼2ï¼ã¤ã¡ã¼ã¸ã®ããã·ã¥
Podmanã§ãµã³ãã«ã®ã³ã³ããã¤ã¡ã¼ã¸ãä½æããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã¸ããã·ã¥ãã¾ãã
ä¸è¨ã®ã³ãã³ããå®è¡ãããã¼ã¹ã¤ã¡ã¼ã¸ã«UBI9ã使ç¨ããContainerfileãä½æãã¾ãã
$ cat > Containerfile <<EOF FROM ubi9 RUN echo "hello" | tee hello.txt EOF
podman build
ã³ãã³ãã§ã³ã³ããã¤ã¡ã¼ã¸ããã«ããã¾ãã
$ podman build -t ${HOST}/openshift/push-test .
åºåçµæãéã
$ podman build -t ${HOST}/openshift/push-test . STEP 1/2: FROM ubi9 Resolved "ubi9" as an alias (/etc/containers/registries.conf.d/001-rhel-shortnames.conf) Trying to pull registry.access.redhat.com/ubi9:latest... Getting image source signatures Checking if image destination supports signatures Copying blob f50ab65647ec done | Copying config e9beb314b7 done | Writing manifest to image destination Storing signatures STEP 2/2: RUN echo "hello" | tee hello.txt hello COMMIT default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test --> 4d7c9eb63a75 Successfully tagged default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test:latest 4d7c9eb63a75563e6c4deee82d472ddf5fd0770ca4850b0e2e379ee03fe280fc
podman push
ã³ãã³ãã§ã³ã³ããã¤ã¡ã¼ã¸ãããã·ã¥ãã¾ãã
$ podman push ${HOST}/openshift/push-test
åºåçµæãéã
$ podman push ${HOST}/openshift/push-test Getting image source signatures Copying blob 09a48287d5f7 done | Copying blob f36b8ecab85c done | Copying config 4d7c9eb63a done | Writing manifest to image destination
ï¼3ï¼ããã·ã¥ããã¤ã¡ã¼ã¸ã®ç¢ºèª
Skopeoã使ã£ã¦ããã·ã¥ããã³ã³ããã¤ã¡ã¼ã¸ãã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã«ç»é²ããã¦ããã確èªãã¾ãã
ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãã
ãã§ã«podamn login
ãå®è¡ãã¦ããããskopeo login
ã®å®è¡ã¯ä¸è¦ã§ãï¼Skopeoã¯Podmanã®ãã°ã¤ã³æ
å ±ãå©ç¨ã§ãã¾ãï¼ã
$ skopeo inspect docker://${HOST}/openshift/push-test
ä¸è¨ãå±éãã¦åºåçµæã確èªãã ããã
åºåçµæãéã
$ skopeo inspect docker://${HOST}/openshift/push-test { "Name": "default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test", "Digest": "sha256:4c537beccd99c1853f7e242dcfab054cbaf0bf5535233bcb2ac24335f2f8492f", "RepoTags": [ "latest" ], "Created": "2024-07-09T21:16:33.272504929Z", "DockerVersion": "", "Labels": { "architecture": "x86_64", "build-date": "2024-06-28T07:36:05", "com.redhat.component": "ubi9-container", "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", "description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", "distribution-scope": "public", "io.buildah.version": "1.33.7", "io.k8s.description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", "io.k8s.display-name": "Red Hat Universal Base Image 9", "io.openshift.expose-services": "", "io.openshift.tags": "base rhel9", "maintainer": "Red Hat, Inc.", "name": "ubi9", "release": "1123.1719560047", "summary": "Provides the latest release of Red Hat Universal Base Image 9.", "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi9/images/9.4-1123.1719560047", "vcs-ref": "92a4a475241865d0d11bd861fb2b29fbd9b17df0", "vcs-type": "git", "vendor": "Red Hat, Inc.", "version": "9.4" }, "Architecture": "amd64", "Os": "linux", "Layers": [ "sha256:f50ab65647ec96ba313779f24c41e04bc6fde3e3ee79ee377ea8fd1901b896d5", "sha256:68513cceebd5b717b7e307a2c2ff646147e5a84b16657755c25da1be2732bf15" ], "LayersData": [ { "MIMEType": "application/vnd.oci.image.layer.v1.tar+gzip", "Digest": "sha256:f50ab65647ec96ba313779f24c41e04bc6fde3e3ee79ee377ea8fd1901b896d5", "Size": 79313334, "Annotations": null }, { "MIMEType": "application/vnd.oci.image.layer.v1.tar+gzip", "Digest": "sha256:68513cceebd5b717b7e307a2c2ff646147e5a84b16657755c25da1be2732bf15", "Size": 270, "Annotations": null } ], "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "container=oci" ] }
Webã³ã³ã½ã¼ã«ä¸ã§ç¢ºèªããå ´åã¯ãã¡ãã¥ã¼ã®ãBuildsï¼ImageStreamsããé¸æãã¾ãã
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã«ç»é²ããã¦ããã¤ã¡ã¼ã¸ã®ä¸è¦§ã表示ããã¾ãã
ååã§æ¤ç´¢ã§ãã¾ãã®ã§ããã·ã¥ããã¤ã¡ã¼ã¸åï¼push-test
ãå
¥åãã¾ãã
push-test
ã®ãªã³ã¯ãé¸æããã¨ã¤ã¡ã¼ã¸ã®è©³ç´°ç»é¢ã表示ããã¾ãã
ãããªãã¯ã¤ã¡ã¼ã¸ãªãã¸ããªã¼ã«è¡¨ç¤ºããã¦ããURLããOpenShiftã®å¤é¨ãããã®ã¤ã¡ã¼ã¸ããã«ããæã®URLã«ãªãã¾ãã
ï¼4ï¼OpenShiftä¸ã®ã¤ã¡ã¼ã¸ããã«ãã
OpenShiftä¸ã®ã¤ã¡ã¼ã¸ããã¼ã«ã«ã«ãã«ãããã¹ããè¡ãã¾ãã
ãã¼ã«ã«ã«ããã³ã³ããã¤ã¡ã¼ã¸ãåé¤ãã¾ãã
$ podman images $ podman rmi push-test:latest
åºåçµæãéã
$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test latest 4d7c9eb63a75 19 minutes ago 220 MB registry.access.redhat.com/ubi9 latest e9beb314b7a2 11 days ago 220 MB $ podman rmi push-test:latest Untagged: default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test:latest Deleted: 4d7c9eb63a75563e6c4deee82d472ddf5fd0770ca4850b0e2e379ee03fe280fc
podman pull
ã³ãã³ãã§ã¤ã¡ã¼ã¸ããã«ãã¾ãã
$ podman pull ${HOST}/openshift/push-test $ podman images
åºåçµæãéã
$ podman pull ${HOST}/openshift/push-test Trying to pull default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test:latest... Getting image source signatures Copying blob f50ab65647ec skipped: already exists Copying blob 68513cceebd5 done | Copying config 4d7c9eb63a done | Writing manifest to image destination 4d7c9eb63a75563e6c4deee82d472ddf5fd0770ca4850b0e2e379ee03fe280fc $ podman images REPOSITORY TAG IMAGE ID CREATED SIZE default-route-openshift-image-registry.apps.ocp.home.lab/openshift/push-test latest 4d7c9eb63a75 21 minutes ago 220 MB registry.access.redhat.com/ubi9 latest e9beb314b7a2 11 days ago 220 MB
ã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ä¸ã®ã¤ã¡ã¼ã¸ããã«ãããã¨ãã§ãã¾ããã
ã¾ã¨ã
OpenShift Virtualizationã§ä½¿ç¨ããããã®å ±æã¹ãã¬ã¼ã¸ã®ä½æãè¡ãã¾ããã æ±ç¨çãªNFSãµã¼ãã¼ãããã¯ã¨ã³ãã«ä½¿ç¨ããNFS CSIãã©ã¤ãã¼ã使ç¨ãããã¨ã§PVã®åçãªãããã¸ã§ãã³ã°ãè¡ãã¾ãã ãã®ã¹ãã¬ã¼ã¸ã¯OpenShift Virtualization以å¤ã§ã使ç¨ã§ãããããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ã®ã¤ã¡ã¼ã¸ä¿åç¨ã®ã¹ãã¬ã¼ã¸ã®è¨å®ãè¡ãã¾ããã ã¾ããã¤ã¡ã¼ã¸ã¬ã¸ã¹ããªã¼ãå ¬éè¨å®ãè¡ããã¨ã«ãããOpenShiftã®å¤é¨ããã¤ã¡ã¼ã¸ãããã·ã¥ããã«ã§ããããã«ãªãã¾ãã 第1åããããã¾ã§ã®ä½æ¥ã§ããããOpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ãè¡ãæºåãæ´ãã¾ããã 次ã¯ããããOpenShift Virtualizationã®è¨å®ã«ãªãã¾ãã
ï¼æ¬¡åäºåï¼ æ¬¡åã¯OpenShift Virtualizationã®ã¤ã³ã¹ãã¼ã«ã¨ä»®æ³ãã·ã³ã®å®è¡æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ãã
*1:Red Hat OpenShift Kubernetes Engine | Red Hat
*2:Red Hat OpenShift Platform Plus ã¨ã¯ï¼ããããããã解説
*3:Red Hat OpenShift Data Foundation | Red Hat
*4:7.1.2.1. ç¹å®ã¢ããªã±ã¼ã·ã§ã³ã®ã¹ãã¬ã¼ã¸ã®æ¨å¥¨äºé ãåç § 第7ç« ã¹ã±ã¼ã©ããªãã£ã¨ããã©ã¼ãã³ã¹ã®æé©å | Red Hat Product Documentation
*5:container-storage-interface/spec: Container Storage Interface (CSI) Specification.
*7:Releases · kubernetes-csi/csi-driver-nfs
*8:Releases · kubernetes-csi/csi-driver-nfs
*9:OpenShiftä¸ã«Helmã§ãããã¤ãããã¢ããªã±ã¼ã·ã§ã³ããµã¼ãã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã®ãã¨
*10:詳細ãç¥ãããæ¹ã¯deployment.yamlãã¡ã¤ã«ã®ä¸èº«ãåç §ãã ãã