titanicai.dev

Deployment Process

Docker Compose

Location: .cicd/compose and .cicd/compose/cicd-compose.sh

Start up with Docker Compose

1
2
3
4
5
# using GitHub local source code
docker-compose -f .cicd/compose/docker-compose.GitHub.yaml up

# using DockerHub image repository
docker-compose -f .cicd/compose/docker-compose.DockerHub.yaml up

Launch

1
start http://localhost:8010

Take Down with Docker Compose

1
2
3
4
5
# using GitHub local source code
docker-compose -f .cicd/compose/docker-compose.GitHub.yaml down

# using DockerHub image repository
docker-compose -f .cicd/compose/docker-compose.DockerHub.yaml down

Kubernetes

Location: .cicd/kubernetes and .cicd/kubernetes/cicd-kubernetes.sh

Configure Kubernetes Context

1
2
3
kubectl config get-contexts
kubectl config use-context docker-desktop
kubectl config current-context

Deploy to Kubernetes

1
2
3
4
5
# deploy
kubectl apply -f .cicd/kubernetes/deploy.yaml

# check deployment
kubectl get all -n titanicai

Launch

1
start http://localhost:8010

Take Down from Kubernetes

1
kubectl delete namespace titanicai

Helm

Location: .cicd/helm and .cicd/helm/cicd-helm.sh

Configure Kubernetes Context

1
2
3
kubectl config get-contexts
kubectl config use-context docker-desktop
kubectl config current-context

Deploy to Kubernetes with Helm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# deploy webapp & api
helm upgrade titanicai-webapp -i --create-namespace --namespace titanicai .cicd/helm/titanicai-webapp
helm upgrade titanicai-api -i --create-namespace --namespace titanicai .cicd/helm/titanicai-api

# deploy ingress controller
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx \
--namespace titanicai \
--set controller.replicaCount=1 \
--set controller.admissionWebhooks.enabled=false \
--set controller.service.externalTrafficPolicy=Local

# check deployments
kubectl get all -n titanicai
kubectl get ingress -n titanicai
helm list --all -n titanicai

Launch

1
2
start http://web.titanicai.localhost
start http://api.titanicai.localhost/__docs__/

Take Down from Kubernetes

1
kubectl delete namespace titanicai