Skip to content

do3-2023/thomas-kube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TP Kubernetes

Description

The goal of this project is to deploy a simple architecture using kubernetes. Here is a schema of the architecture:

schema

It is composed of a Next js frontend rendering files in SSR (server side rendering). A Go API providing a /city/random and a /healthz route. And a Postgres database to store the data. Each service are in different namespaces and only the frontend is exposed using a nodePort

Installation

Create the kubernetes cluster using k3d, if you don't have it installed you can follow the installation guide

k3d cluster create kube

Create the namespaces

kubectl create ns frontend
kubectl create ns backend
kubectl create ns db

Apply the charts

kubectl apply -Rf ./kube

this might take a while, you can check the status of the pods using:

kubectl get pods -A

Retrieve the ip and nodeport of the frontend

kubectl get svc -n kube-system

find the "EXTERNAL IP"

and then ou can hit on the following url:

http://<EXTERNAL IP>:30080/cities