Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.54 KB

deployment.md

File metadata and controls

82 lines (61 loc) · 2.54 KB

Deploy to Production

1. Create GKE cluster and connect to it

gcloud beta container --project "centsideas" clusters create "centsideas"\
  --zone "europe-west3-b" --no-enable-basic-auth --cluster-version "1.16.9-gke.6"\
  --machine-type "n1-standard-1" --disk-size "10" --preemptible --num-nodes "3"\
  --enable-autoscaling --min-nodes "0" --max-nodes "3"

gcloud container clusters get-credentials centsideas --zone europe-west3-b --project centsideas

2. Setup Helm

helm repo add stable https://kubernetes-charts.storage.googleapis.com/ && \
helm repo add jetstack https://charts.jetstack.io && \
helm repo update

3. Create an NGINX Ingress

kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account) && \
helm install nginx-ingress stable/nginx-ingress

4. Point Domain to IP

Go to the created Load Balancer and point your domain to this IP address via an "A" record.

Record Type Domain Value
A centsideas.com ip-address
A api.centsideas.com ip-address
A admin.centsideas.com ip-address

5. Setup Cert Manager

helm install \
  cert-manager jetstack/cert-manager \
  --namespace cert-manager --create-namespace \
  --version v0.15.0 \
  --set installCRDs=true

6. Setup Kafka Cluster

kubectl create namespace kafka
kubectl apply -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
kubectl apply -f packages/kubernetes/kafka-ephemeral.yaml -n kafka

7. Setup Elasticsearch Cluster

kubectl apply -f https://download.elastic.co/downloads/eck/1.1.2/all-in-one.yaml
kubectl apply -f packages/kubernetes/elasticsearch.yaml

8. Setup MongoDB

git clone https://github.com/mongodb/mongodb-kubernetes-operator && \
cd mongodb-kubernetes-operator && \
kubectl create namespace mongodb && \
kubectl create -f deploy/crds/mongodb.com_mongodb_crd.yaml && \
kubectl create -f deploy/ --namespace mongodb

cd ..
microk8s.kubectl apply -f packages/kubernetes/event-store.yaml -n mongodb && \
microk8s.kubectl apply -f packages/kubernetes/read-database.yaml -n mongodb

9. Deploy services

yarn deploy