Skip to Content

SysOps infrastructure for project management

September 9, 2024 by
SysOps infrastructure for project management
Ezekiel-Victor


Role: 

Lead DevOps Engineer


Summary: 

Building a robust infrastructure for the deployment and management of applications and web apps requires the integration of several powerful tools and technologies. By leveraging Docker, Kubernetes, Portainer, Argo CD, and GitLab CI/CD, we can create a highly scalable, automated, and efficient system for managing applications in a Kubernetes environment.


Key Responsibilities

  • 2 servers for Kubernetes cluster, one in Finland and one in Germany, 2 nodded Kubernetes cluster
  • Docker for Containerization: The foundation of this infrastructure begins with Docker, which enables us to package applications and their dependencies into lightweight, portable containers. This ensures consistency across different environments, whether it's local development, staging, or production. Docker simplifies the process of building, shipping, and running applications, making them easier to manage and deploy at scale.
  • Kubernetes for Orchestration: Once applications are containerized, Kubernetes takes over to handle the orchestration. Kubernetes manages the deployment, scaling, and availability of containerized applications. It ensures that each service is running smoothly, balancing workloads, and automatically scaling based on demand. With features like self-healing and rolling updates, Kubernetes provides a resilient and flexible infrastructure that can support both small and large-scale applications.
  • Portainer for Simplified Management: Portainer serves as a user-friendly management interface for Docker and Kubernetes environments. It simplifies the complex tasks of managing containers, images, networks, and volumes. By using Portainer, both developers and administrators can easily monitor and control the entire container ecosystem, making it much more accessible for teams to oversee deployments and resolve issues.
  • Argo CD for Continuous Deployment: Argo CD introduces GitOps-based continuous delivery, automating the deployment of applications into the Kubernetes environment. By synchronizing the desired application state (defined in Git) with the actual state in the Kubernetes cluster, Argo CD ensures that applications are deployed consistently. Any changes made to the codebase in Git trigger automated updates in the Kubernetes environment, keeping everything aligned.
  • GitLab CI/CD for Continuous Integration and Delivery: GitLab CI/CD integrates seamlessly into this setup, providing a powerful toolchain for automating the testing, building, and deployment processes. With pipelines defined in .gitlab-ci.yml files, GitLab CI/CD can handle everything from code validation and unit tests to pushing Docker images to a registry and triggering deployments through Argo CD. This ensures that every commit undergoes thorough testing and that new features or fixes are delivered rapidly and safely.

End-to-End Workflow Overview:

  1. Code Changes: Developers commit code to GitLab, which triggers the CI pipeline.
  2. CI Pipeline Execution: GitLab CI runs automated tests, builds Docker images, and pushes them to the Docker registry.
  3. Argo CD Sync: Argo CD monitors the Git repository and, upon detecting changes, automatically updates the Kubernetes environment with the new application version.
  4. Kubernetes Orchestration: Kubernetes manages the deployment, scaling, and monitoring of the updated application, ensuring smooth rollouts or rollbacks if needed.
  5. Portainer Oversight: Administrators use Portainer to monitor the containers and deployments, ensuring that everything is running efficiently and troubleshooting if necessary.

This infrastructure setup ensures seamless integration between development, testing, and deployment, leading to faster, more reliable delivery of applications. Through the combination of Docker for containerization, Kubernetes for orchestration, Argo CD for deployment automation, and GitLab for CI/CD, we achieve a highly efficient and scalable solution tailored to modern DevOps practices.

Tech Stack

  • Docker
  • Helm
  • Kubernetes
  • Linux 
  • Bash Scripting
  • Metal B
  • Ingress Nginx
  • CI/CD Scripting
  • Gitlab
  • Gitlab repo
  • Portainer
  • Podman
  • Certbot


Challenges & Solutions

  • One of the main challenges in managing such an infrastructure is ensuring security and avoiding breaches, especially when dealing with a multi-node environment. Protecting sensitive data and preventing unauthorized access across containers and servers is crucial. Additionally, efficiently scaling applications in response to traffic fluctuations—whether increasing or decreasing—is a key concern, requiring dynamic management to optimize resource allocation and prevent over-provisioning.
  • In my experience, a major challenge during the setup was the complexity of connecting nodes to Portainer while using different containerization tools across servers. Specifically, I was using Docker on the master server for container orchestration and Podman on the second server. It was an interesting learning experience because these systems have differences in how they handle containers. Ultimately, I overcame the problem by deploying an agent that connected both clusters, allowing seamless integration with Portainer, ensuring that both servers could be monitored and managed efficiently from a single interface.


Results

  • Efficient Management of Multiple Applications: By utilizing Kubernetes for orchestration, the infrastructure allows for streamlined management of multiple applications, ensuring that resources are allocated efficiently across the environment.
  • Simplified Deployment: The integration of Docker, GitLab CI/CD, and Argo CD automates the deployment pipeline, making it easy to push updates and new features into production seamlessly.
  • Scalability Made Easy: Kubernetes automatically handles scaling based on traffic demand, both up and down, ensuring that the system remains responsive under varying loads without manual intervention.
  • Zero Downtime During Upgrades: Rolling updates in Kubernetes ensure that applications are updated with zero downtime, maintaining high availability even during version releases or critical updates.
  • Free External Ingress Networking: Leveraging external ingress solutions, the infrastructure enables cost-efficient routing of traffic, reducing overhead while still ensuring secure and scalable access to applications.
  • Easy Management and Monitoring with Portainer: Portainer provides a centralized interface for overseeing the entire container ecosystem, simplifying both day-to-day management and troubleshooting.
  • Cross-Platform Container Management: With Docker on the master server and Podman on the secondary server, the system supports diverse environments, allowing flexibility in how containers are run and managed.
  • Increased Security through Isolation: Containerized applications provide isolation between services, reducing the risk of cross-contamination from vulnerabilities and ensuring a more secure environment.
  • Automated Failover and Recovery: Kubernetes’ self-healing capabilities ensure automatic recovery from failures, minimizing service disruptions by restarting or replacing failed containers.
  • Version Control and Rollback Capabilities: Using GitOps principles with Argo CD, changes to the environment are version-controlled, making it easy to track, audit, and roll back deployments if necessary. 
  • Cost-Efficient Resource Utilization: Kubernetes dynamically allocates resources, ensuring efficient use of CPU, memory, and storage, reducing unnecessary costs while maximizing performance.


Code & Demo

  • GitHub Repo | Live Demo


Screens / Pictures

  • Infrastructure overview with Portainer, both servers overseen with portainer.


  • Overview of resources on the Master Node


  • Overview of the worker Node.


  • All application on the master Node

  • Gitlab with Working Pipelines


  • CI/CD Bash scripting



Share this post
Tags