- Allow users to query a shortcode and pay for their electricity meter bill
- Allow users to query their meter balance
- API : Akka
- DB : Firestore
- Mobile Money : Safaricom API
- Short Code : Africa's Talking API
- Deployed : Google Cloud Platform
- gcloud init && gcloud compute machine-types list --filter="zone:(us-central1-a)"
- gcloud container clusters create bboxx-cluster --zone us-central1-a --num-nodes 1 --enable-autoscaling --min-nodes 1 --max-nodes 10 --machine-type=n1-standard-1
- gcloud container clusters get-credentials bboxx-cluster --zone us-central1-a --project vivo-ussd-november-26th-2019
- gcloud projects add-iam-policy-binding vivo-ussd-november-26th-2019 --member=serviceAccount:[email protected] --role=roles/container.developer
Set Up CloudBuild to: Build Image, Upload Image to GCR, Deploy Image to GKE
- Run sbt stage to create files to target/universal/stage/bin
- Generate Dockerfile using sbt docker:stage
- This file can be found at target/docker/stage/Dockerfile
- Create the CloudBuild Yaml
- gcloud builds submit --timeout=900S --project=vivo-ussd-november-26th-2019 --config cloudbuild.yaml
- echo "Configure The Service"
- kubectl apply -f deploy/service.yaml
- kubectl get svc
- echo "Configure Horizontal Autoscaling"
- kubectl apply -f deploy/horizontalpodautoscaler.yaml
- kubectl get hpa
- echo "Add Helm Nginx Repo"
- helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
- helm repo update
- helm install nginx-ingress ingress-nginx/ingress-nginx --set controller.publishService.enabled=true
- kubectl --namespace default get services -o wide -w nginx-ingress-ingress-nginx-controller
- echo "Add Kubernetes Ingress"
- kubectl apply -f deploy/ingress.yaml
- echo "Creating Cert Manager Name Space"
- kubectl create namespace cert-manager
- echo "Add Jetstack Helm Chart"
- helm repo add jetstack https://charts.jetstack.io
- helm repo update
- echo "Install Cert Manager into the cert-manager namespace"
- helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v1.2.0 --set installCRDs=true
- echo "Creating Production Issuer"
- kubectl apply -f deploy/productionissuer.yaml
- echo "Introduce Certificates to Ingress Resource"
- kubectl apply -f deploy/ingressupdate.yaml
- echo "Check Certificate Issuance Progress"
- kubectl describe certificate hello-kubernetes-tls
- gcloud init && git config credential.helper gcloud.sh
- gcloud source repos create bboxxapi
- gcloud source repos list
- git init && git remote add google https://source.developers.google.com/p/vivo-ussd-november-26th-2019/r/bboxxapi
- git add . && git commit -m "Update to project structure"
- git push --all google
- Create service account in the GCP Project with roles Viewer, Cloud Builder Editor and Storage Admin
- GCP IAM > Service Accounts, create JSON Key and Download.
- Gitlab Settings > CI/CD, Add Variable GCP_PROJECT_ID, GCP_SERVICE_KEY
- Operations > Kubernetes
- Enter Kubernetes cluster name, API URL, CA Certificate
- Apply the service account : kubectl apply -f gitlab-admin-service-account.yaml
- Enter Token from : kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep gitlab | awk '{print $1}')
- Ingress: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-on-digitalocean-kubernetes-using-helm
- Ingress 2: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes
- Dockerizing AKKA : https://medium.com/@konstantinbodnia/create-and-deploy-a-scala-http-server-to-google-kubernetes-engine-gke-36a25e395d48