Skip to content

do3-2023/mbo_kube_tp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mbo_kube_tp

How to deploy the whole setup, hopefully easily

Setup nodes, using k3d

k3d cluster create main-cluster --agents 2

Then we'll launch each section as a separate deployment. For convenience purposes, a default secret "db-secret" is present as a file. This is not safe to use the default value of course. Note the the secret is duplicated across namespaces.

Launch the database

kubectl apply -f ./api/infra/1_data/

Launch the backend

kubectl apply -f ./api/infra/2_back/

Launch the frontend

kubectl apply -f ./front-end/infra/

Since I'm using k3d in this setup, we're going to manually expose the frontend via a port forward.

Setup port forwarding

kubectl port-forward $(kubectl get pods -n next-front | tail -n 1 | cut -d ' ' -f 1) 3000:3000 -n next-front

Then you can head over to your browser to try out the "beautiful" website

Deleting the cluster

k3d cluster delete main-cluster

Nice architecture

Building images

All images can be built using docker build -t <whatyouwant> . in their respective folders:

  • /front-end for the front end
  • /api for the api