Git Product home page Git Product logo

kemkas-deployment's Introduction

Kemkas k8s Deployment

Currently running on managed Kubernetes and managed PostgreDB (with a staging enviroonemnt on a managed App Platform)

DigitalOcean Referral Badge

Note: the above button is a referal link.

ToC

Argo CD

Goal: continous deployment automation with rollback capability

Files:

TODO:

  • gRPC setup for ArgoCD to use the CLI. Workaround: k8s port proxy to localhost.

Setup instructions

  1. DO 1-click install argoCD into k8s cluster (TODO: replace with helm install command, I suspect behind the scenes the 1-click install does the same)
  2. DO 1-click install ingress-nginx into k8s cluster (TODO: replace with helm install command, I suspect behind the scenes the 1-click install does the same)
  3. DO 1-click install cert-manager into k8s cluster (TODO: replace with helm install command, I suspect behind the scenes the 1-click install does the same)
  4. helm upgrade ingress-nginx to fix cert-manager pod2pod communication and enable proxy protocoll helm upgrade ingress-nginx ingress-nginx/ingress-nginx --version 4.8.2 --namespace ingress-nginx --values ingress-nginx/values.yaml
  5. Create DNS A record for argocd.kemkas.hu pointing to the Load Balancer IP address (Load balancer is a DO object created with the ingress-nginx helm chart install)
  6. helm update argocd with helm upgrade argocd argo/argo-cd --version 4.9.4 --namespace argocd -f argocd-values.yaml
  7. Apply all files in argocd directory
    kubectl apply -f cert-manager-issuer.yaml
    kubectl apply -f argocd-ingress.yaml
    

1Password Connect Server

Goal: Store secrets in 1password instead of kubernetes, so we can push all kubernetes config while keeping the secrets safe in 1password

Files:

  • 1password-secret-store.yaml: kuberentes ESO Secret Store to be referenced by external secrets
  • connect-server-access-token-secret.yaml: kubernetes secret file to connect with the 1password connect server without the actual secret token. the token can be generated on 1password website or CLI.
  • docker-compose.yaml: docker compose config to run the 1password connect server on a separate machine. Requires a 1password-credentials.json file locally in the same directory, which can be obtained from the 1password website or CLI.
  • connect-server.conf nginx config for the SSL terminating proxy for the 1password connect server (so that secrets don't travel unencrypted)

TODO:

  • explore running the 1password connect server on the same k8s cluster to simplify infrastructure
  • write script to automate the setup instraction (using doctl for full infra automation)

Setup:

  1. create DO droplet (with docker template)
  2. create DNS A record pointing to the droplet
  3. install nginx, certbot sudo apt install nginx certbot python3-certbot-nginx
  4. copy docker-compose.yaml and 1password-credentials.json to the droplet and run docker compose up -d
  5. copy connect-server.conf nginx config to /etc/nginx/sites-available and link it to sites enabled ln -s /etc/nginx/sites-available/connect-server.conf /etc/nginx/sites-enabled/
  6. test nginx config nginx -t
  7. reload nginx config nginx -s reload
  8. create SSL certificate with certbot certbot --nginx -d 1password-connect.dev.kemkas.hu (email address and accepting terms is required!)
  9. setup firewall to block TCP/8080 and TCP/8081 to avoid unencrypted access to the connect server (allow TCP/443 and TCP/22)
  10. helm install the external secret operator helm repo add external-secrets https://charts.external-secrets.io and helm install external-secrets external-secrets/external-secrets -n external-secrets --create-namespace --set installCRDs=false (from https://external-secrets.io/)
  11. create namespace for secret store kubectl create ns kemkas
  12. create connect server access token secret in k8s kubectl apply -f ./1password-connect-server/connect-server-access-token-secret.yaml
  13. create secret store kubectl apply -f ./1password-connect-server/1password-secret-store.yaml

Kemkas

Goal: deploy an existing docker image into the k8s cluster with proper secrets and expose it on HTTPS with proper SSL cert

Files:

Setup:

  1. connect Digital Ocean Container Registry to the k8s cluster doctl registry kubernetes-manifest | kubectl apply -f -
  2. create external secrets for the upcoming kemkas deployment kubectl apply -f ./kemkas/kemkas-external-secrets.yaml
  3. create kemkas deployment kubectl apply -f ./kemkas/kemkas-deployment.yaml
  4. create service to export the kemkas deployment kubectl apply -f ./kemkas/kemkas-service.yaml
  5. create SSL cert issuer kubectl apply -f ./kemkas/kemkas-ssl-cert-issuer.yaml
  6. create ingress for the kemkas service kubectl apply -f ./kemkas/kemkas-ingress.yaml

kemkas-deployment's People

Contributors

morbalint avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.