Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Step.0

แก้ไข hosts

ทำการแก้ไขไฟล์ hosts ตาม OS

# Mac OS x
/etc/hosts

# Windows
C:\Windows\System32\drivers\etc\hosts

# เพิ่ม
127.0.0.1 k3d-registry.localhost

ทำการ build image พร้อมทั้งนำเข้าที่ repositories ของเรา

cd backend
docker build -t k3d-registry.localhost:12345/krismt/backend:latest .
docker push k3d-registry.localhost:12345/krismt/backend:latest

cd frontend
docker build -t k3d-registry.localhost:12345/krismt/frontend:latest .
docker push k3d-registry.localhost:12345/krismt/frontend:latest

Step.1

ทำการเริ่มใช้งาน terraform

terraform init

terraform plan

terraform apply

Step.2

deploy ตัวแอปพลิเคชัน

# creat secret
kubectl create secret generic db-secrets \
    --from-literal=DB_URL='postgresql://docker:example@db:5432/testdb'  \
    --from-literal=POSTGRES_PASSWORD='example' \
    --from-literal=POSTGRES_USER='docker' \
    --from-literal=POSTGRES_DB='testdb'

cd kubernetes
kubectl apply -f pvc.yaml
kubectl apply -f cm.yaml
kubectl apply -f db-deploy.yaml
kubectl apply -f backend-deploy.yaml
kubectl apply -f frontend-deploy.yaml
kubectl apply -f ingress.yaml

Step.3

ทดลองเรียกใช้งานตัวแอปพลิเคชัน

open http://localhost

About

Basic Kubernetes example

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages