Skip to content

Axiaaa/IoT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Inception of Things (IoT) - Kubernetes & GitOps Project

Kubernetes Vagrant ArgoCD GitLab

πŸ“‹ Table of Contents

🎯 Overview

The Inception of Things (IoT) project is an in-depth learning project covering Kubernetes, containerization technologies, and GitOps practices. It consists of four progressive parts that cover:

  1. K3s Infrastructure: Kubernetes cluster deployment with Vagrant
  2. Traffic Management: Ingress Controller configuration with multiple applications
  3. GitOps with ArgoCD: Automated continuous deployment
  4. CI/CD Pipeline: Complete GitLab + ArgoCD + K3d integration

πŸ› οΈ Prerequisites

Required Tools

  • VirtualBox 7.0+
  • Vagrant 2.0+
  • Docker 20.0+
  • kubectl 1.28+
  • k3d 5.0+
  • ArgoCD CLI 2.0+
  • Helm 3.0+
  • Git 2.0+

Automated Installation

Run the installation script to set up all necessary tools:

chmod +x install.sh
./install.sh

System Requirements

  • RAM: 8GB minimum (12GB recommended)
  • Disk Space: 20GB available
  • OS: Linux (Debian/Ubuntu recommended)
  • Network: Stable Internet connection

πŸ“ Project Structure

inception-of-things/
β”œβ”€β”€ install.sh                 # Tools installation script
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ p1/                        # Part 1: K3s + Vagrant
β”‚   β”œβ”€β”€ Makefile
β”‚   β”œβ”€β”€ Vagrantfile
β”‚   └── scripts/
β”‚       β”œβ”€β”€ server.sh
β”‚       └── worker.sh
β”œβ”€β”€ p2/                        # Part 2: Ingress Controller
β”‚   β”œβ”€β”€ Makefile
β”‚   β”œβ”€β”€ Vagrantfile
β”‚   β”œβ”€β”€ confs/
β”‚   β”‚   β”œβ”€β”€ httpd.yaml
β”‚   β”‚   β”œβ”€β”€ nginx.yaml
β”‚   β”‚   β”œβ”€β”€ helloworld.yaml
β”‚   β”‚   └── ingress.yaml
β”‚   └── scripts/
β”‚       └── server.sh
β”œβ”€β”€ p3/                        # Part 3: ArgoCD
β”‚   β”œβ”€β”€ makefile
β”‚   β”œβ”€β”€ confs/
β”‚   β”‚   β”œβ”€β”€ k3d.yaml
β”‚   β”‚   β”œβ”€β”€ configmap.yaml
β”‚   β”‚   └── ingress.yaml
β”‚   └── scripts/
β”‚       └── script.sh
└── bonus/                     # Bonus Part: CI/CD Pipeline
    β”œβ”€β”€ makefile
    β”œβ”€β”€ confs/
    β”‚   β”œβ”€β”€ k3d.yaml
    β”‚   β”œβ”€β”€ gitlab.yaml
    β”‚   β”œβ”€β”€ gitlab-ingress.yaml
    β”‚   β”œβ”€β”€ argo-ingress.yaml
    β”‚   └── configmap.yaml
    └── scripts/
        β”œβ”€β”€ setup.sh
        └── generatetoken.rb

πŸš€ Installation

  1. Clone the project

    git clone https://github.com/Axiaaa/IoT/
    cd inception-of-things
  2. Install dependencies

    chmod +x install.sh
    ./install.sh
  3. Add your user to Docker group

    sudo usermod -aG docker $USER
    newgrp docker

πŸ“¦ Part 1 - K3s and Vagrant

Objective

Create a K3s cluster with one server and one worker using Vagrant.

Architecture

  • lcamerlyS (Server): 192.168.56.110 - 2GB RAM, 2 CPU
  • lcamerlySW (Worker): 192.168.56.111 - 2GB RAM, 2 CPU

Deployment

cd p1
make all          # Create VMs and cluster
make clean        # Destroy VMs
make fclean       # Complete cleanup

Verification

# On the server VM
vagrant ssh lcamerlyS
sudo kubectl get nodes -o wide

Expected output:

NAME        STATUS   ROLES                  AGE   VERSION
lcamerlyS   Ready    control-plane,master   1m    v1.28.7+k3s1
lcamerlyS   Ready    <none>                 1m    v1.28.7+k3s1

🌐 Part 2 - K3s and Ingress

Objective

Configure a Traefik Ingress Controller to route traffic to different applications.

Deployed Applications

  • App1 (httpd): Accessible via app1.com
  • App2 (nginx): Accessible via app2.com - 3 replicas
  • App3 (hello-kubernetes): Accessible via app3.com + default route

Deployment

cd p2
make all          # Create VM and deploy apps

Testing Applications

# Test each application
make app1         # curl -H "Host:app1.com" 192.168.56.110
make app2         # curl -H "Host:app2.com" 192.168.56.110  
make app3         # curl -H "Host:app3.com" 192.168.56.110
make default      # curl 192.168.56.110 (default route)

Network Configuration

Applications are also accessible via:

βš™οΈ Part 3 - K3d and ArgoCD

Objective

Deploy ArgoCD in a K3d cluster and configure automatic application deployment.

Architecture

  • K3d Cluster: 1 server + 2 agents
  • ArgoCD: Continuous deployment web interface
  • Application: Auto-deployed from GitHub repository

Deployment

cd p3
make all          # Create cluster and deploy ArgoCD
make clean        # Delete cluster

Service Access

Features

  • βœ… Automatic synchronization from GitHub
  • βœ… Accessible ArgoCD web interface
  • βœ… Deployment to dev namespace
  • βœ… Ingress configuration with Traefik

🎯 Bonus Part - GitLab CI/CD

Objective

Complete CI/CD pipeline with GitLab, ArgoCD and K3d for advanced GitOps workflow.

Complete Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   GitLab    │────▢│     K3d     │───▢│   ArgoCD    │───▢│ Application β”‚
β”‚   (SCM)     β”‚      β”‚ (Runtime)   β”‚    β”‚  (GitOps)   β”‚     β”‚   (App)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Deployed Services

Deployment

cd bonus
make all          # Complete deployment (~15-20 minutes)
make clean        # Cleanup

GitOps Workflow

  1. Code Push β†’ GitLab detects changes
  2. GitLab β†’ Provides source repository
  3. ArgoCD β†’ Automatically syncs manifests
  4. K3d Cluster β†’ Deploys updated application

Advanced Features

  • βœ… Integrated GitLab with automatic authentication
  • βœ… Automatic token generation
  • βœ… Bidirectional GitOps synchronization
  • βœ… Multi-service Ingress with Traefik
  • βœ… Visual monitoring via ArgoCD UI
  • βœ… Zero-downtime deployment

Access Credentials

Credentials are displayed at the end of deployment:

# GitLab
Username: root
Password: <automatically generated>

# ArgoCD  
Username: admin
Password: <automatically generated>

πŸ“š Useful Resources

Official Documentation

Key Concepts

  • GitOps: Deployment practice using Git as source of truth
  • Ingress Controller: HTTP/HTTPS ingress traffic management
  • Service Mesh: Secure inter-service communication
  • CI/CD Pipeline: Continuous integration and deployment

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is developed for educational purposes. See LICENSE for more details.


About

42 Project | Inception of Things (IoT) - Kubernetes & GitOps Project

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •