Skip to content

GraphtyLove/kubernetes-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-demo

Small Demo to show how to deploy on Kubernetes.

Slides here

API

The API is a simple FastAPI application.

Build & push the image

Create an account on Docker Hub.

# Login to Docker Hub
docker login
# Build the image
docker build -t <your-docker-hub-username>/api-demo:latest .
# Push the image
docker push inoopa/api-demo:latest

If you are on a Mac with M1, M2, M3,... you can use the following command to build & push the image:

More information

docker buildx build --platform linux/amd64 --push -t <your-docker-hub-username>/api-demo:latest .

Run locally

docker run -p 80:80 <your-docker-hub-username>/api-demo:latest

Kubernetes

The Kubernetes manifests are in the kubernetes folder.

kubectl apply -f kubernetes/manifest.yaml

Then you need to forward the port to your local machine:

kubectl port-forward -n api-demo-namespace service/api-demo-service 8080:80

About

Small Demo to show how to deploy on Kubernetes

Topics

Resources

Stars

Watchers

Forks