A template for continuous delivery of a nodejs service to Azure Kubernetes Service
- jest
- supertest
- prettier
- eslint
- typescript
- webpack
- local docker builds
- babel
- rest client
- autocannon
- lints
- unit / integration tests
- compiles
- webpack bundles
- builds docker image
- publishes the image to an azure container registry
- syncs github action secrets to the aks cluster
- triggers a rolling deployment of the image to the cluster
- cert manager
- nginx https ingress
- docker
- git
- node
To get a local copy up and running follow these simple steps.
- use this template to create a new repo
- clone your new repo
- install dependencies
yarn
- run the server
yarn docker:start
- navigate to http://localhost:3000
- create a container registry in azure
- grep
buildablecr0.azurecr.io
and replace it with your login container registry login - grep
node-boilerplate
and replace it with a name for your project - create an aks cluster with this config
- create a github action secret named
REGISTRY_USERNAME
with the value of the registry username - create a github action secret named
REGISTRY_PASSWORD
with the value of the registry password - create a github action secret named
SECRETS
with the value of{"jwt": "abc123"}
secret used to verify req.headers.authorization - create github action secret named
KUBE_CONFIG
with the yml fromaz aks get-credentials --resource-group k8s-demo-ss --name k8s-demo-cluster-ss --file secret.kubeconfig
- grep
node-boiler.teaguestockwell.com
and replace it with the the host you assigned to the a record - grep
tsappdevelopment@gmail.com
and replace it with your email helm repo add cert-manager https://charts.jetstack.io
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install cert-manager cert-manager/cert-manager --set installCRDs=true
helm install nginx-ingress ingress-nginx/ingress-nginx
- create an a record for the ip address of the ingress controller. This can be found using the external ip listed when running
kubectl get svc
- wait for the dns to propagate, you can verify this when
ping $host
matches the ip address you set in the a record - apply the ingress controller to the cluster
kubectl apply -f k8/ingress.yml
- apply the cert issuer to the cluster
kubectl apply -f k8/issuer.yml
- bump the pipeline / manually redeploy as needed
See the open issues for a list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE
for more information.
Teague Stockwell - LinkedIn