Links

Deploy

SaaS Production Version using Terraform

Create infrastructure using Terraform

  1. 1.
    Update the variables.tf file
  2. 2.
    Deploy1terraform init 2terraform plan 3terraform apply
  3. 3.
    Take a note of all the Cognito outputs
  4. 4.
    Set your kube context by running the following1aws eks --region <AWS Region> update-kubeconfig --name <Cluster Name>

Deploy application using helm

  1. 1.
    Set env vars for deployment
1export CLUSTER_NAME="borneo-eks" 2export USER_POOL_CLIENT_ID="76qpqp38ft8j34opt14a78p6ec" 3export USER_POOL_ARN="arn:aws:cognito-idp:us-east-1:273440405556:userpool/us-east-1_EOmFOgJoP" 4export USER_POOL_DOMAIN="staging-use1-securezapp-io.auth.us-east-1.amazoncognito.com"
2. Add and update helm repos1helm repo add eks https://aws.github.io/eks-charts 2helm repo add runix https://helm.runix.net 3helm repo add airflow-stable https://airflow-helm.github.io/charts 4helm repo add bitnami https://charts.bitnami.com/bitnami 5helm repo add elastic https://helm.elastic.co 6helm repo add grafana https://grafana.github.io/helm-charts 7helm repo add prometheus-community https://prometheus-community.github.io/helm-charts 8helm repo update
3. Deploy backend components using helm1kubectl -n borneo apply -f ./manifests 2helm -n borneo upgrade -i -f ./values/loki-values.yaml loki grafana/loki --version 2.5.0 3helm -n borneo upgrade -i -f ./values/grafana-values.yaml grafana grafana/grafana --version 6.9.1 4helm -n borneo upgrade -i -f ./values/promtail-values.yaml promtail grafana/promtail --version 3.5.1 5helm -n borneo upgrade -i -f ./values/prometheus-values.yaml prometheus prometheus-community/prometheus --version 14.1.0 6kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml 7helm -n borneo upgrade -i -f ./values/postgres-values.yaml postgres bitnami/postgresql --version 10.3.14 8helm -n borneo upgrade -i -f ./values/pgadmin-values.yaml pgadmin runix/pgadmin4 --version 1.6.0 9helm -n borneo upgrade -i -f ./values/elastic-values.yaml elasticsearch elastic/elasticsearch --version 7.13.1 10helm -n borneo upgrade -i -f ./values/kibana-values.yaml kibana elastic/kibana --version 7.13.1 11helm -n borneo upgrade -i -f ./values/logstash-values.yaml logstash elastic/logstash --version 7.13.1
4. Install ALB controller1helm upgrade -i aws-load-balancer-controller eks/aws-load-balancer-controller \ 2 --set clusterName=${CLUSTER_NAME} \ 3 --set serviceAccount.create=false \ 4 --set serviceAccount.name=aws-load-balancer-controller \ 5 -n kube-system
5. Modify cognito variables for ingress resource1rm -rf /tmp/borneo && mkdir -p /tmp/borneo 2cp ./values/values.yaml /tmp/borneo/values.yaml 3sed -i.bkp "s~USER_POOL_ARN~${USER_POOL_ARN}~g" /tmp/borneo/values.yaml 4sed -i.bkp "s~USER_POOL_CLIENT_ID~${USER_POOL_CLIENT_ID}~g" /tmp/borneo/values.yaml 5sed -i.bkp "s~USER_POOL_DOMAIN~${USER_POOL_DOMAIN}~g" /tmp/borneo/values.yaml 6sed -i.bkp "s~CLUSTER_NAME~${CLUSTER_NAME}~g" /tmp/borneo/values.yaml
6. Install webapp using helm1helm -n borneo upgrade -i borneo . -f /tmp/borneo/values.yaml 2helm -n borneo upgrade -i airflow airflow-stable/airflow -f ./values/airflow-values.yaml --version 7.16.0

Create a CNAME for the dashboard domain

  1. 1.
    Get the “ADDRESS” from the following command 1kubectl -n borneo get ingress
  2. 2.
    Create a CNAME entry. Route53 example below. Remember to add dualstack to the load balancer public endpoint you got from the previous step.