Skip to content

Latest commit

 

History

History
48 lines (44 loc) · 1.17 KB

README.md

File metadata and controls

48 lines (44 loc) · 1.17 KB

k8s-lab

Deploying a microservice app (based on weather api) as part of learning k8s

Environment

kind version 0.24.0
kubernetes v1.31.0
containerd v1.7.18

App Architecture

app-architecture

Deployment

Create namespace for the app

kubectl create namespace weather-app

Create secret for mysql auth database

A user named 'auth' will be created for interacting with weather-app database.

kubectl create secret generic mysql-secret \
  --from-literal=root-password='<root-pw>' \
  --from-literal=auth-password='<password-for-auth-user>' \
  --from-literal=secret-key='<secret-for-jwt>' \
  -n weather-app

Generate self-signed certificates for ingress

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=weatherapp.local/O=weatherapp"

Create a tls secret

kubectl create secret tls weatherapp-ui-tls --cert=tls.crt --key=tls.key

Apply Manifests

kubectl apply -f k8s/auth/mysql
kubectl apply -f k8s/auth

Modify secret.yaml to add your RAPIDAPI KEY

kubectl apply -f k8s/weather
kubectl apply -f k8s/ui