teaguestockwell / aks-nodejs-cd

A template for continuous delivery of a node service to Azure Kubernetes Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MIT License LinkedIn


Logo

AKS Node CD

Report Bug

Table of Contents

  • About The Project
  • Pre Requisites
  • Getting Started
  • Deployment
  • Helpful Links
  • Roadmap
  • License
  • Contact
  • About The Project

    A template for continuous delivery of a nodejs service to Azure Kubernetes Service

    Node Service

    • jest
    • supertest
    • prettier
    • eslint
    • typescript
    • webpack
    • local docker builds
    • babel
    • rest client
    • autocannon

    Pipeline

    1. lints
    2. unit / integration tests
    3. compiles
    4. webpack bundles
    5. builds docker image
    6. publishes the image to an azure container registry
    7. syncs github action secrets to the aks cluster
    8. triggers a rolling deployment of the image to the cluster

    Deployment

    • cert manager
    • nginx https ingress

    Pre Requisites

    • docker
    • git
    • node

    Getting Started

    To get a local copy up and running follow these simple steps.

    1. use this template to create a new repo
    2. clone your new repo
    3. install dependencies
    yarn
    1. run the server
    yarn docker:start
    1. navigate to http://localhost:3000

    Deployment

    Secrets and Components

    • 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 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 from az aks get-credentials --resource-group k8s-demo-ss --name k8s-demo-cluster-ss --file secret.kubeconfig

    HTTPS Ingress

    1. grep node-boiler.teaguestockwell.com and replace it with the the host you assigned to the a record
    2. grep tsappdevelopment@gmail.com and replace it with your email
    3. helm repo add cert-manager https://charts.jetstack.io
    4. helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    5. helm install cert-manager cert-manager/cert-manager --set installCRDs=true
    6. helm install nginx-ingress ingress-nginx/ingress-nginx
    7. 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 dns
    8. wait for the dns to propagate, you can verify this when ping $host matches the ip address you set in the a record
    9. apply the ingress controller to the cluster kubectl apply -f k8/ingress.yml
    10. apply the cert issuer to the cluster kubectl apply -f k8/issuer.yml
    11. bump the pipeline / manually redeploy as needed

    Helpful Links

    Roadmap

    See the open issues for a list of proposed features (and known issues).

    License

    Distributed under the MIT License. See LICENSE for more information.

    Contact

    Teague Stockwell - LinkedIn

    About

    A template for continuous delivery of a node service to Azure Kubernetes Service

    License:MIT License


    Languages

    Language:TypeScript 50.6%Language:JavaScript 44.0%Language:Shell 5.4%