Skip to content

This repo provides a complete env based on k8s to host a containerized apps.

Notifications You must be signed in to change notification settings

saloyiana/devops-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devops-tasks

Application flow - K8S Level

When the client hits the app endpoint, the k8s level flow as below:

app-overview

to run the app locally:

  1. clone the repo git clone -b main https://github.com/saloyiana/devops-tasks
  2. change dir to devops-tasks/todo_app by cd devops-tasks/todo_app/
  3. run docker-compose up
  4. to access the app, go to: http://localhost:8000/todos/list/

to run the app on k8s env

  1. add your creds to the platform/k8s-cluster/terraform.tfvars
  2. run make cluster up or
cd platform/k8s-cluster
terraform init
terraform apply -auto-approve

echo "Preparing the namespaces"
kubectl create namespace nginx-ingress
kubectl create namespace argocd
kubectl create namespace kyverno
kubectl create namespace monitoring
kubectl create namespace logging
kubectl create namespace app-test
kubectl create namespace db
kubectl create namespace app-prod
  1. start installing the tools by running make tools or sh tools.sh
  2. create the db and argocd apps by running make db argocd-test db argocd-prod or
echo "Prepare the DB for the APP"
helm repo add bitnami https://charts.bitnami.com/bitnami &&\
    helm repo update &&\
    helm install postgres -n db --set primary.persistence.enabled=false,global.postgresql.auth.database=postgres,global.postgresql.auth.postgresPassword=postgres,global.postgresql.auth.username=postgres,tls.preferServerCiphers=false,readReplicas.persistence.enabled=false,serviceAccount.automountServiceAccountToken=false bitnami/postgresql --version 12.8.0

kubectl apply -f argocd-objects/repo.yaml -n argocd
kubectl apply -f argocd-objects/test.yaml -n argocd
kubectl apply -f argocd-objects/prod.yaml -n argocd

note: if you wish to install the app in push-mode, check app.sh

Images

K8S Resources

k8s-ns

CI/CD Steps

cicd-overview

Argocd Apps

argocd-ui

Kibana Dashboard

kibana-dashbord

Grafana Dashboard

app-monitoring

Kyverno Polices

kyverno-policy

Notes:

  1. there is still need to manage the env secrets, to be improved.
  2. the database for test and prod need to different, however it is one instance here for demo purposes.
  3. it is better to have two different repos for app and k8s config.

About

This repo provides a complete env based on k8s to host a containerized apps.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published