PierreBeucher / devops-lifecyle-playground

Playground to manage the DevOps lifecycle of a simple app using various tools and practices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevOps Lifecycle Playground

Playground project demonstrating DevOps lifecycle implementation for a small application and infrastructure:

Infrastructure

Kubernetes HA cluster (K3S) running on AWS with EC2 Spot Instances.

graph TD
    K3S1[K3s Server 1<br>EC2 Spot Instance]
    K3S2[K3s Server 2<br>EC2 Spot Instance]
    K3S3[K3s Server 3<br>EC2 Spot Instance]

    Vol1[K3s Data 1<br>EBS Volume]
    Vol2[K3s Data 2<br>EBS Volume]
    Vol3[K3s Data 3<br>EBS Volume]

    K3S1---Vol1
    K3S2---Vol2
    K3S3---Vol3

    DNS[k3s.devops.crafteo.io<br>Route53 DNS A record]
    DNS-->K3S1
    DNS-->K3S2
    DNS-->K3S3

Directory structure:

├─ infra/   # Infrastructure stacks managed with Pulumi
│  ├─ aws/  # AWS infra (EC2, DNS record...)
│  ├─ k8s/  # Kubernetes infra (Traefik, Cert Manager...)
├─ deploy/  # Deploy app as Docker image on Kubernetes cluster with Kustomize
├─ src/     # Application source code

Usage

Available stacks:

  • Kubernetes cluster (K3S)
  • Traefik with Cert Manager
  • Datadog
  • Logging: Elasticsearch, Fluentd, Kibana (EFK)
  • Application: whoami
  • Application: Example Voting App

Kubernetes cluster (K3S)

HA Kubernetes cluster (K3S) running on AWS EC2 spot instances

# Deploy Kubernetes cluster with Traefik and Cert Manager
make infra

# Or you can run each step one per one
# make aws              # Deploy fresh K8S cluster with K3S
# make k8s-kubeconfig   # Download Kubeconfig locally
# make traefik          # Deploy Traefik with Cert Manager (use DNS challange)

Expose Traefik dashboard to access ia via http://localhost:9000/dashboard/

make traefik-dashboard

Datadog

Datadog deployment

# Datadog API key is required, create config from template and set API key
cp infra/datadog/helm/secrets-datadog.template.yml infra/datadog/helm/secrets-datadog.yml
nano infra/datadog/helm/secrets-datadog.yml

make datadog

Logging: Elasticsearch, Fluentd, Kibana (EFK)

make efk

# Or per component
# make elasticsearch
# make kibana
# make fluentd
  • Access via https://kibana.devops.crafteo.io
  • Protected by basic auth with username crafteo, see auto-generated file infra/efk/base/auth.clear for password.
  • Initiliaze index pattern: Stack Management > Index Patterns > Create fluentd*

Application: whoami

Simple whoami container, handy to test overall accessibility and Traefik/Cert Manager deployment:

make whoami

Application: Example Voting App

Docker Example Voting App using adapated Kustomize (see Docker Samples - Example Voting App repo)

make vote

About

Playground to manage the DevOps lifecycle of a simple app using various tools and practices


Languages

Language:TypeScript 75.5%Language:Makefile 12.7%Language:JavaScript 10.9%Language:Dockerfile 0.9%