Skip to content

Kubernetes

Francis Daigle edited this page Apr 19, 2022 · 2 revisions

Kubernetes

Setup

  1. Install NGINX Ingress controller

     helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
    
  2. Install Sealed Secrets controller

     kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.17.2/controller.yaml
    
  3. Install cert-manager

     kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.7.0/cert-manager.yaml
    
  4. Fetch Sealed Secrets controller public key

     npm run fetch:cert
    
  5. Create environment file secret

     kubectl create secret generic secret-env \
     --dry-run=client -o yaml \
     --from-env-file ./kustomize/overlays/[development|production|staging]/.env | \
     kubeseal --format yaml --cert sealed-secrets.pem >> ./kustomize/overlays/[development|production|staging]/secret-env.yaml
    
  6. Create registry secret

     kubectl create secret docker-registry secret-registry \
     --dry-run=client -o yaml \
     --docker-server=ghcr.io \
     --docker-username=foobar \
     --docker-password=ghp_1234567890abcdef \
     --docker-email=foo@bar.com | \
     kubeseal --format yaml --cert sealed-secrets.pem >> ./kustomize/overlays/[development|production|staging]/secret-registry.yaml
    
  7. Patch service account

     kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "secret-registry"}]}'
    

Run

Development

    npm run apply:dev

Production

    npm run apply:prod

Staging

    npm run apply:staging
Clone this wiki locally