kypp / go-gitlab-k8s

Template for Kubernetes-deployable Gitlab-CI-buildable golang microservices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-gitlab-k8s

This is a complete template for a golang microservice deployed on a Kubernetes cluster via gitlab-ci.

The bare docker image with an http server and ca-certificates weights < 6MB.


Quick parachute drop without cloning:

  curl -L https://github.com/kypp/go-gitlab-k8s/archive/master.tar.gz | tar xz --strip-components 1

Stuff you might want to do after the drop:

  1. Change the go module name in app/go.mod and chart name in chart/Chart.yaml
  2. Ensure the KUBE_INGRESS_BASE_DOMAIN is set, either on a higher level (see documentation) or by uncommenting the 7th line in the .gitlab-ci.yml file
  3. Create the GitLab project
  4. In Settings->Repository->Deploy Tokens create a token named gitlab-deploy-token with read_registry scope (see here for explanation)
  5. Push to GitLab

Includes:

  • two-stage production Dockerfile for optimal image size
  • docker-compose for development with live reload (for local development simply docker-compose up)
  • automated kubernetes deployment based on GitLab autodevops
  • basic health check endpoint (at /healthz)

Credits:

About

Template for Kubernetes-deployable Gitlab-CI-buildable golang microservices

License:MIT License


Languages

Language:Shell 43.1%Language:Smarty 30.9%Language:Dockerfile 14.8%Language:Go 11.1%