slowhigh/goilerplate

Repository files navigation

For the perfect template. πŸ”₯πŸ”₯πŸ”₯

image

  • Routing - Gin Web Framework ---------------------------- πŸ“š :octocat:
  • CLI - Cobra ------------------------------------------------- πŸ“š :octocat:
  • DI pattern - Fx --------------------------------------------- πŸ“š :octocat:
  • Environment - Viper --------------------------------------- :octocat:
  • Logging - Zap ---------------------------------------------- :octocat:
  • PostgreSQL ORM - GORM --------------------------------- πŸ“š :octocat:
  • Redis ORM - Go-Redis ------------------------------------- πŸ“š :octocat:
  • DB Viewer - pgAdmin4 (Web) ----------------------------- πŸ“š 🐳 :octocat:
  • Authentication - JWT (Access + Refresh) ----------------- πŸ“š :octocat:
  • Makefile - make -------------------------------------------- πŸ“š
  • CI/CD - -Actions ------------------------------------ πŸ“š
  • CNI(Container Network Interface)- flannel --------------- :octocat:
  • Load Balancer - MetalLB ----------------------------------- πŸ“š :octocat:
  • Ingress - NGINX -------------------------------------------- πŸ“š
  • AutoScaling - k8s-HPA ------------------------------------- πŸ“š

Make sure you have make installed.

$ sudo apt install make
$ make deploy-to-docker-desktop

Run in Postman

https://pgadimin4.localhost

# 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

Run in Postman

https://pgadimin4.localhost

# 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