| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contains a Node.js application (index.js) and the necessary infrastructure as code to deploy it on Google Kubernetes Engine (GKE). The infrastructure is managed using Terraform, and the application is containerized using Docker. The project also includes Kubernetes manifests for deployment and a CI/CD pipeline for automation, using GitHub Actions for Continuous Integration and ArgoCD for Continuous Deployment.
This repository provides a modular Terraform setup for provisioning infrastructure along with a CI pipeline for automation, validation, and deployment.
The project is designed to:
The repository follows a modular architecture, making it reusable, scalable, and maintainable.
. ├── modules/ │ ├── network/ │ ├── gke/ │ ├── .github/workflows/ │ └── ci.yml │ └── README.md
Each module is self-contained and includes:
main.tf → Core resources
variables.tf → Input variables
outputs.tf → Outputs for reuse\
How to Use
terraform init
terraform validate
terraform plan
terraform apply
This repository uses a Docker-based CI pipeline that builds, scans (lint), pushes images, and updates the GitOps repo used by ArgoCD.
name: Docker CI
on:
push:
branches: [ "main", "master" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Generate short SHA
- name: Extract metadata
id: meta
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
# Linting
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run ESLint
run: npm run lint
# Docker login
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
# Build & Push
- name: Build and Push Docker Image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/node-hello:latest
${{ secrets.DOCKER_USERNAME }}/node-hello:${{ steps.meta.outputs.SHORT_SHA }}
# Update ArgoCD repo
- name: Update ArgoCD repo with new image tag
run: |
SHORT_SHA=${{ steps.meta.outputs.SHORT_SHA }}
git config --global user.name "github-actions"
git config --global user.email "actions@github.com"
git clone https://x-access-token:${{ secrets.ARGOCD_REPO_TOKEN }}@github.com/M-Samii/node-hello-argocd.git
cd node-hello-argocd
sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/node-hello:${SHORT_SHA}|g" k8s/deployment.yaml
git add k8s/deployment.yaml
git commit -m "Update image tag to ${SHORT_SHA}" || echo "No changes"
git pushThis pipeline implements a full CI + GitOps workflow:
Code Quality Check Runs ESLint to ensure clean and consistent code before building.
Docker Build & Versioning Builds the application image and tags it with:
Push to Docker Hub Publishes the image so it can be pulled by Kubernetes.
GitOps Update (ArgoCD)
Automatic Deployment via ArgoCD ArgoCD detects the repo change and syncs the new version to the cluster automatically.
👉 Result: Every push to main triggers a full build → push → deploy cycle.
GitOps with ArgoCD (Required Before New Relic)
Deploy ArgoCD to manage applications in a GitOps workflow before installing New Relic.
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
kubectl create namespace argocd
helm install argocd argo/argo-cd -n argocdkubectl apply -f argocd/application.yamlEnsure your application.yaml points to the correct repo, path, and destination cluster/namespace.
This project supports integrating New Relic for application and infrastructure monitoring.
Add your New Relic license key to:
GitHub Secrets (for CI/CD)
You can deploy New Relic using Helm:
helm repo add newrelic https://helm-charts.newrelic.com
helm repo updateCreate a values.yaml file:
global:
licenseKey: YOUR_NEW_RELIC_LICENSE_KEY
cluster: your-cluster-name
kubeEvents:
enabled: true
logging:
enabled: trueThen deploy using:
helm upgrade --install newrelic-bundle newrelic/nri-bundle \
-f values.yamlThis approach allows better configuration management and version control compared to inline --set flags.
| Back | FazBrowse Home | New Git URL |