This project outlines the deployment of a Node.js application on a local Kubernetes cluster using ArgoCD for continuous delivery. The build and deployment process is automated with a Jenkins pipeline.
- VM for Jenkins
- Docker installed on the Jenkins VM
- VM for Minikube and kubectl
- Minikube installed on the second VM
- ArgoCD installed on Minikube
- Jenkins installed on the first VM
- GitHub account
- Docker Hub account
- Go to the Node.js GitHub repository.
- Fork the repository to your GitHub account.
git clone https://github.com/mo8310/nodejs.org.git
cd nodejs.org
- Install dependencies:
npm install
- Run the development server:
npx turbo dev
- The site should now be available at
http://localhost:3000
.
- Ensure the application is functioning as expected by running:
npm test
- Create and Build a
dockerfile
in the project directory and Push the Dockerfile to repo.
- Install Docker on Jenkins VM to allow Jenkins to build Docker images and Create a
Jenkins pipeline
- Set up Docker Hub credentials in Jenkins to enable pushing images.
-
Install Minikube and kubectl:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube /usr/local/bin/ minikube start
-
Install ArgoCD:
kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
-
Access ArgoCD Dashboard:
kubectl port-forward svc/argocd-server -n argocd 8080:443
- Create a
deployment.yaml
for service and app and Push to my repo. - Configure ArgoCD to point to my GitHub repo for continuous delivery.
ذ