Homework Project: Implementing GitOps with Gitea and ArgoCD in Kubernetes
Objective
The goal of this project is to introduce students to GitOps principles by setting up a continuous deployment pipeline using Gitea and ArgoCD within a Kubernetes cluster. Students will:
- Install and configure Gitea as a self-hosted Git service.
- Install and configure ArgoCD to manage application deployments from Gitea repositories.
- Deploy a web application using ArgoCD.
- Implement a liveness probe for the Nginx application to ensure its health and availability.
Task 0: Setup (5 points)
Environment Preparation
We will utilize a virtual machine provided by the faculty's cloud infrastructure. All virtual machines must be created under the cc_hw_prj
OpenStack project.
Virtual Machine Configuration:
- Instance Name:
HW-<Your LDAP username>
(e.g.,HW-john.doe
) - Instance Boot Source: Boot from image
- Image Name: CC 2024-2025
- Flavor:
m1.xlarge
Initial Setup:
- Access the virtual machine via SSH.
- Update system packages.
- Install essential tools (Git, curl, wget, vim).
- Install Docker.
- Install
kubectl
. - Install Kind (Kubernetes in Docker).
Task 1: Create a Kubernetes Cluster (20 points)
- Initialize a Kubernetes cluster using Kind.
- Configure
kubectl
to use the new cluster. - Verify the cluster status and ensure nodes are ready.
Task 2: Install Gitea (20 points)
- Create a namespace for Gitea.
- Add the Gitea Helm repository.
- Install Gitea using Helm.
- Expose Gitea service to access the web interface. Hint: proxy to your browser.
- Complete the initial Gitea setup:
- Register a new user.
- Create a repository named
nginx-deployment
.
Task 3: Install ArgoCD (20 points)
- Create a namespace for ArgoCD.
- Install ArgoCD.
- Expose the ArgoCD server. Hint: proxy to your browser.
- Log in to ArgoCD.
- Connect the Gitea repository to ArgoCD.
Task 4: Deploy Nginx with ArgoCD (25 points)
For this task, you are going to deploy your own cloud-courses page.
- Create a Kubernetes manifest for an Nginx deployment and service in your Gitea repository.
- Push the manifest to the Gitea repository.
- Create an ArgoCD application that points to the repository and deploys the manifest.
- Apply the ArgoCD application manifest.
- Verify that the Nginx deployment and service are running.
Task 5: Add Liveness Probe to Nginx (10 points)
- Modify the deployment manifest to include a liveness probe.
- Push the updated manifest to Gitea.
- Confirm that ArgoCD syncs the changes and redeploys the application.
- Verify that the liveness probe is configured correctly.
Homework submission
To submit your homework, you have to upload on Moodle a zip archive named CC - <Your LDAP username here>.zip
(e.g. CC - ana.popescu3342.zip
that contains the following
files:
- The Manifests you used to deploy your Kubernetes containers.
- A screenshot with each solved task.
- A write-up on how your infrastructure should be reproduced (any ramp-up scripts work as well) and tested.
- A pdf file containing a write-up, screenshots for all solved tasks. This pdf file must be named
Proposed Solution - <Your LDAP username here>.pdf
(e.g.,Proposed Solution - ana.popescu3342.pdf
). - A README file.
The deadline for submitting your zip archive is the 5th of May 2025, 23:55.
Homework presentation
The homework must be presented during the remaining laboratories (14-27 May 2025). You will have to briefly present what and how you have set up for your infrastructure and demonstrate that it works. The homework will be presented during your lab slot as you were assigned at the beginning of the semester. The homework presentation is mandatory. You will not receive a grade on your homework if you do not present it.