For the perfect template. 🔥🔥🔥
- Routing - Gin Web Framework ---------------------------- 📚
- CLI - Cobra ------------------------------------------------- 📚
- DI pattern - Fx --------------------------------------------- 📚
- Environment - Viper ---------------------------------------
- Logging - Zap ----------------------------------------------
- PostgreSQL ORM - GORM --------------------------------- 📚
- Redis ORM - Go-Redis ------------------------------------- 📚
- DB Viewer - pgAdmin4 (Web) ----------------------------- 📚 🐳
- Authentication - JWT (Access + Refresh) ----------------- 📚
- Makefile - make -------------------------------------------- 📚
- CI/CD - GitHub-Actions ------------------------------------ 📚
- CNI(Container Network Interface)- flannel ---------------
- Load Balancer - MetalLB ----------------------------------- 📚
- Ingress - NGINX -------------------------------------------- 📚
- AutoScaling - k8s-HPA ------------------------------------- 📚
Make sure you have make
installed.
$ sudo apt install make
$ make deploy-to-docker-desktop
# Check the IP of the Kubernetes control plane.
$ kubectl cluster-info
Kubernetes control plane is running at https://10.0.0.8:6443
CoreDNS is running at https://10.0.0.8:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
# Edit the addresses of ipaddress-pools.yaml.
$ vi k8s/ipaddress-pools.yaml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: first-pool
namespace: metallb-system
spec:
addresses:
- 10.0.0.8-10.0.0.8 <---- edit IP
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: l2-advert
namespace: metallb-system
$ make deploy-to-cloud
# Push the API Docker Image to the DockerHub.
$ make push_api
# Push the PostgreSQL Docker Image to the DockerHub.
$ make push_postgres
# Push the Redi Docker Image to the DockerHub.
$ make push_redis
# Push the pgAdmin4 Docker Image to the DockerHub.
$ make push_pgadmin4
# Push the All Docker Image to the DockerHub.
$ make push_all
# Deploy to the Docker Desktop. (WSL + Docker Desktop)
$ make deploy-to-docker-desktop
# Undeploy to the Docker Desktop. (WSL + Docker Desktop)
$ make delete-to-docker-desktop
# Deploy to the Public Cloud.
$ make deploy-to-cloud
# Undeploy to the Public Cloud.
$ make delete-to-cloud