ติดตั้ง Red Hat CodeReady Containers ไว้ใช้งานที่ Laptop ของเราเอง

Alisara Hincheeranan
3 min readDec 11, 2020

เนื่องจากจะต้องพัฒนาระบบโดยใช้ OpenShift และมีความรู้ในทางด้านนี้น้อยมาก จึงหาหนทางจะทำอย่างไรดี ที่เราต้องสามารถ Run OpenShift ที่เครื่องของเราได้นะ

จึงขอนำเสนอการติดตั้ง OpenShift: Red Hat CodeReady Containers เพื่อใช้งานที่ Laptop ของเครื่องเราเองได้ ซึ่งสะดวกมากมายสำหรับ Developer ที่ต้องการสร้าง Application สักตัวหนึ่ง เพื่อ Run บน OpenShift

  1. Go to => https://developers.redhat.com/products/codeready-containers/overview
เลือก Install OpenShift on your laptop

2.สำหรับใครที่ยังไม่มี Account ของ Red Hat สามารถสมัครเพื่อขอ Account ได้ และผู้ที่มี Account แล้วจะปรากฏหน้าจอ ดังนี้

1.1) Download OS ตามที่เราใช้ ในตัวอย่าง Windows -> Download Code-Ready Containers

1.2) Download pull secret

2) Click Get started

3. ทำการแตกไฟล์ Code-Ready Container ที่ได้ Download มาไปไว้ที่ C:\crc-windows (สามารถตั้งชื่อ Folder อะไรก็ได้ตามที่สะดวก)

4.ทำการติดตั้ง CRC ดังนี้

4.1 ทำการ setup crc

CMD: crc setup

crc setup

4.2 ทำการ start crc และต้องใส่ pull-secret.txt ในขั้นตอนนี้ด้วยนะ

CMD: crc start -p C:\crc\pull-secret.txt

crc start -p C:\crc\pull-secret.txt

เมื่อ Started the OpenShift cluster ได้แล้ว เราจะมา Run crc console ในขั้นตอนถัดไป

5. ทำการ Run crc console

CMD: crc console

crc console

ระบบจะทำการเปิดหน้า Web Console ให้เรา ดังรูป

Web Console

เราสามารถ Log in ได้ 2 Options ได้แก่

  • Kube:admin
  • htpasswd_provider

สามารถใช้ crc console — credential เพื่อแสดง User & Password ที่ใช้ในการ Login ดังรูป

crc console — credential

6.Login to Web Console

6.1 Kube: admin จะเป็นการ Login ด้วย User: kubeadmin Password: HqC3I-wgtiB-q7qCf-KEsuK

6.2 htpasswd_provider จะเป็นการ Login ด้วย User: developer Password: developer

บทสรุป

ผู้เขียนหวังว่าบทความนี้ พอจะเป็นประโยชน์ให้แก่พัฒนาที่มีความสนใจในเรื่อง OpenShift และกำลังมองหาที่จะใช้งานได้บน Laptop ของตัว และหาวิธีในการติดตั้งถ้าหากในบทความนี้ข้อมูลบกพร่องประการใด สามารถแจ้งเพื่อเปลี่ยนแปลงแก้ไข และน้อมรับฟังความคิดเห็น เพื่อแลกเปลี่ยนเป็นความรู้ทุกประการ

Reference

  1. https://developers.redhat.com/blog/2020/09/09/how-to-run-red-hat-codeready-containers-on-windows-10-enterprise/
  2. https://developers.redhat.com/blog/2020/09/09/install-red-hat-openshift-operators-on-your-laptop-using-red-hat-codeready-containers-and-red-hat-marketplace/
  3. https://developers.redhat.com/blog/2019/09/05/red-hat-openshift-4-on-your-laptop-introducing-red-hat-codeready-containers/?sc_cid=701f20000012i69AAA
  4. https://medium.com/@stefaan.degeyter/installing-codeready-containers-openshift4-on-hyper-v-win-10-9c8d8a510c01

--

--