Harbor for small site (LV.1)
Architecture
1 VM & no HA
Pre-Requisite
Server minimum requirement
Firewall requirement
Setup
Install docker engine
(Optional) Install Docker-compose
Set GPG key
Prepare Server SSL certificate
เตรียม certificate ที่จะให้ harbor ใช้งาน เช่น จด cert จาก Let's Encrypt ด้วย certbot หรือซื้อ cert จาก trusted CA
Download harbor package
download package จากเว็บ github release
online package สำหรับกรณีทั่วไป offline package สำหรับ site ที่ไม่สามารถออก internet ได้หรือมีความเร็ว internet ที่ต่ำ
Config Harbor YAML file
แก้ไข yaml ดังนี้
Install
Test
เปิดเว็บ browser แล้วระบุ url ตามที่ set ใน hostname
Reconfigure
execute install script อีกรอบ เช่น add trivy โดยการ execute command ร่วมกับ option --with-trivy
Uninstall & Remove all data
การใช้ backend ของ container image เป็น S3
ในตัวอย่างนี้ เราจะใช้ AWS S3 เป็นพื้นที่เก็บ image แทน local storage ซึ่งจะช่วยป้องกันเรื่อง data loss ได้ ในกรณีเช่น VM พัง หรือ filesystem corrupt
สร้าง policy ซึ่งมี content ดังนี้
สร้าง user สำหรับเป็น service account ขึ้นใน AWS IAM user และ map policy
สร้าง access key และ secret key
config ใน harbor.yml
เพิ่ม ดังนี้
หลังจากนั้นสั่งคำสั่งเพื่อ generate compose ใหม่
Last updated
Was this helpful?