Skip to content

Instantly share code, notes, and snippets.

steps:
# build the container image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "gcr.io/vivo-ussd-november-26th-2019/bboxxapi", "."]
# push container image
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/vivo-ussd-november-26th-2019/bboxxapi"]
# deploy container image to GKE
@JaniKibichi
JaniKibichi / deployment.yaml
Created June 29, 2021 15:51
Deployment with Rolling Updates and Health Probes
apiVersion: apps/v1
kind: Deployment
metadata:
name: bboxx-deployment
labels:
app: bboxx
spec:
replicas: 1
selector:
matchLabels:
@JaniKibichi
JaniKibichi / horizontalpodautoscaler.yaml
Created June 29, 2021 15:52
Horizontal Pod Autoscaler
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: bboxx-horizontal-pod-autoscaler
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: bboxx-deployment
minReplicas: 1
@JaniKibichi
JaniKibichi / ingress.yaml
Created June 29, 2021 15:53
Initial Ingress
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: bboxx-ingress
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: "payments.bboxx.clients.decoded.africa"
http:
@JaniKibichi
JaniKibichi / ingressupdate.yaml
Created June 29, 2021 16:00
Ingress Update
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: bboxx-ingress
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
# Email address used for ACME registration
email: [email protected]
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
apiVersion: v1
kind: Service
metadata:
name: bboxx-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 7500
selector:

INTRODUCTION

ABOUT BBOXX API
  • Allow users to query a shortcode and pay for their electricity meter bill
  • Allow users to query their meter balance
TECHNOLOGY
  • API : Akka
  • DB : Firestore
  • Mobile Money : Safaricom API
@JaniKibichi
JaniKibichi / deployment.yaml
Created June 30, 2021 08:47
Utility USSD Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: ussd-deployment
labels:
app: ussd
spec:
replicas: 1
selector:
matchLabels:
@JaniKibichi
JaniKibichi / Dockerfile
Created June 30, 2021 08:52
sbt native packager generated
FROM openjdk:8 as stage0
LABEL snp-multi-stage="intermediate"
LABEL snp-multi-stage-id="52ff43b3-42bb-43db-a05f-231396a6736c"
WORKDIR /opt/docker
COPY 1/opt /1/opt
COPY 2/opt /2/opt
USER root
RUN ["chmod", "-R", "u=rX,g=rX", "/1/opt/docker"]
RUN ["chmod", "-R", "u=rX,g=rX", "/2/opt/docker"]
RUN ["chmod", "u+x,g+x", "/1/opt/docker/bin/utility-ussd"]