This repository presents a robust solution for deploying applications in a Kubernetes cluster while incorporating CI/CD practices using GitHub Actions. I created three branches - the main branch for primary development, a second branch for creating pull requests, and the last one for saving the Helm chart using GitHub Pages. This branch strategy enhances collaboration, code review, and Helm chart versioning, providing a comprehensive solution for deploying and managing applications in a Kubernetes environment.
- Main Branch: The primary branch containing the latest stable code.
- Pull Request Branch: A branch specifically for creating and managing pull requests.
- GitHub Pages Branch: Created a dedicated branch for storing the Helm chart using GitHub Pages. This branch may contain documentation and artifacts related to the Helm chart.
- I assume that you have k8s cluster running to deploy and perform the task, in my case i used AWS EKS.
-
create the k8s manifest files as required in task
-
Package the k8s files using helm chart
-
** create intial work flow to deploy you helm chart on k8s cluster for the first time**
note: You can deploy the cart manully in the first time.
-
Create second wokflow for creating the pull request
-
Create branch that's used to open the pull request from and trigger the PR workflow
-
create empty branch for storing the helm chart in it
-
create last work flow for merging the pull request in the cluster
-
run the first workflow manaully to deploy the helm chart
- do any chage in the pull request branch and then open the PR, it will trigger the workflow immediately
- enable the github pages on the repo that we created to store the helm chart
- **merge the pull request and then you will see that the merge pipeline work flow triggered **
In conclusion, this DevOps assignment employs a streamlined approach to deploy applications in a Kubernetes cluster, integrating CI/CD practices through GitHub Actions. The key steps include creating Kubernetes manifest files, packaging them using Helm charts, and establishing a robust branch strategy with dedicated workflows. By leveraging GitHub Actions, we've automated the deployment process, enhanced collaboration through pull requests, and ensured Helm chart versioning. Additionally, the implementation of GitHub Pages for Helm chart storage further facilitates accessibility and documentation. The combination of these steps results in an efficient and scalable solution for deploying and managing applications in a Kubernetes environment.