Skip to content

ibrahim88ku/mywebapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Web App - Helm Chart Deployment

This repository contains a Helm chart for deploying a simple NGINX-based web application (mywebapp) into a Kubernetes cluster using GitHub Actions for CI/CD and GitHub Pages to host the chart as a Helm repository.

🧱 Repository Structure

mywebapp_helm/
├── charts/
│   ├── index.yaml                          # Helm chart index
│   ├── mywebapp/                           # Helm chart directory
│   │   ├── Chart.yaml
│   │   ├── values.yaml
│   │   ├── app/index.html                  # Static web content
│   │   └── templates/                      # Kubernetes manifest templates
│   │       ├── configmap.yaml
│   │       ├── deployment.yaml
│   │       ├── ingress.yaml
│   │       ├── service.yaml
│   │       └── _helpers.tpl
├── .github/workflows/
│   └── helm-release.yaml                   # GitHub Actions workflow
└── README.md

🚀 Features

  • Helm chart with NGINX serving custom HTML via ConfigMap
  • Ingress support with configurable hostname and path
  • GitHub Actions-based deployment to Kubernetes cluster
  • Helm chart hosting using GitHub Pages

⚙️ Prerequisites

  • A Kubernetes cluster (e.g., minikube, k3s, EKS, etc.)
  • kubectl and helm installed locally
  • NGINX Ingress Controller (if using ingress)
  • GitHub Personal Access Token (PAT) with repo and optionally workflow scope
  • KUBECONFIG secret in GitHub repository (for GitHub Actions)

📦 Packaging the Chart

cd charts/
helm package mywebapp
helm repo index . --url https://ibrahim88ku.github.io/mywebapp

🌐 GitHub Pages Setup

  1. Switch to gh-pages branch:
    git checkout gh-pages
  2. Move Helm package and index.yaml to the root:
    cp charts/index.yaml charts/mywebapp-<version>.tgz .
  3. Commit and push:
    git add index.yaml mywebapp-<version>.tgz
    git commit -m "Release Helm chart version <version>"
    git push origin gh-pages

Ensure GitHub Pages is enabled in repository settings:

✅ CI/CD Workflow

The GitHub Actions workflow .github/workflows/helm-release.yaml:

  • Triggers on main branch push
  • Sets up Helm
  • Applies deployment to your cluster using the KUBECONFIG secret

📥 Installing the Helm Chart

Add the repo:

helm repo add mywebapp https://ibrahim88ku.github.io/mywebapp
helm repo update

Install the chart:

helm install mywebapp mywebapp/mywebapp --version 0.1.5 -n staging --create-namespace

Or upgrade an existing release:

helm upgrade mywebapp mywebapp/mywebapp --version 0.1.5 -n staging

🔧 Customizing Values

Example in values.yaml:

ingress:
  enabled: true
  className: nginx
  hosts:
    - host: mywebapp.local
      paths:
        - path: /
          pathType: Prefix

👨‍💻 Author

Ibrahim Khalil
GitHub: @ibrahim88ku

📝 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published