Giter VIP home page Giter VIP logo

assignmentnodejs's Introduction

Apologies for the oversight. Let's include the kubectl installation command in the documentation:


Node.js Application Deployment Documentation

This document provides detailed instructions on how to deploy the Node.js application to a Kubernetes cluster using Docker, Minikube, Argo CD, Helm charts, and GitHub Actions for CI/CD.

Step 1: Setup Development Environment

Docker Installation

sudo apt update
sudo apt install docker.io -y
sudo chmod 666 /var/run/docker.sock

Minikube Installation

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
minikube start --driver=docker

kubectl Installation

sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl

Step 2: Deploy Argo CD

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Step 3: Helm Installation

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

Step 4: Set Up GitHub Actions for CI/CD

  1. Configure GitHub Actions workflows in your GitHub repository to automate the Docker image build and push process upon changes.

  2. Make sure to add DockerHub credentials securely to GitHub repository secrets for access during CI/CD workflows.

Step 5: Deployment Process

GitHub Repository Setup

  1. Create a new GitHub repository in your account.

  2. Push the following files to your GitHub repository:

    • Node.js application code.
    • Dockerfile.
    • Helm chart for the application.
    • Argo CD YAML files for application deployment.

Docker Image on DockerHub

Ensure the Docker image for the Node.js application is available on DockerHub. Your DockerHub repository URL is: Your DockerHub Repository URL.

To access your DockerHub repository URL using kubectl, run the following command:

kubectl port-forward svc/helmrelease-nodeapp --address 0.0.0.0 3000:3000

Argo CD Deployment

  1. Provide Argo CD with necessary details:

    • Git repository URL.
    • Path to values.yaml file.
    • Path to Helm chart directory.
  2. Argo CD will automatically deploy the application to the Kubernetes cluster upon changes to the Helm chart or application code triggered by GitHub Actions.

Step 6: Accessing Deployed Resources

  1. Access the deployed Node.js application:

    kubectl port-forward svc/helmrelease-nodeapp --address 0.0.0.0 3000:3000

    The application will be accessible at http://localhost:3000.

  2. Access the Argo CD dashboard:

    kubectl port-forward svc/argocd-server -n argocd --address 0.0.0.0 8080:443

    The Argo CD dashboard will be accessible at https://localhost:8080.

Conclusion

Congratulations! You have successfully deployed the Node.js application to Kubernetes using Docker, Minikube, Argo CD, Helm charts, and GitHub Actions. Continuous integration and continuous deployment (CI/CD) pipelines ensure efficient development workflows and maintain the desired state of your application.


assignmentnodejs's People

Contributors

johnpapa avatar ram28ec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.