starwitorg/httpd-git-chart

By starwitorg

Updated 4 months ago

Helm
0

403

starwitorg/httpd-git-chart repository overview

Apache httpd with git

Based on official httpd image, this image adds git client and a script, that pulls static web page from a git repo.

Overview

This Helm chart deploys an Apache HTTP server that automatically pulls and serves static content from a Git repository. The container includes a cron job that periodically updates the website content.

Installation

From Docker Hub
helm repo add starwitorg https://hub.docker.com/r/starwitorg/httpd-git-chart
helm install my-httpd-git starwitorg/httpd-git-chart
From Source
helm install my-httpd-git ./helm

Configuration

Image Parameters
ParameterDescriptionDefault
image.repositoryDocker image repositorystarwitorg/httpd-git
image.tagDocker image tag2.4.66
image.pullPolicyImage pull policyIfNotPresent
Application Parameters
ParameterDescriptionDefault
repoUrlGit repository URL to pull content fromhttps://codeberg.org/ztarbug/gtp-landingpage.git
branchGit branch to checkoutmain
cronScheduleCron schedule for updating content*/5 * * * * (every 5 minutes)
replicaCountNumber of replicas1
Service Parameters
ParameterDescriptionDefault
service.typeKubernetes service typeClusterIP
service.portService port80
Ingress Parameters
ParameterDescriptionDefault
ingress.enabledEnable ingresstrue
ingress.classNameIngress class nametraefik
ingress.hostsIngress hosts configurationlanding.cluster.local
ingress.annotationsIngress annotations{}
ingress.tlsTLS configuration[]
Resource Management
ParameterDescriptionDefault
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode selector for pod assignment{}
tolerationsTolerations for pod assignment[]
affinityAffinity rules for pod assignment{}

Usage Examples

Basic Installation
helm install my-site ./helm
Custom Git Repository
helm install my-site ./helm \
  --set repoUrl=https://github.com/myuser/mysite.git \
  --set branch=production
Custom Update Schedule
helm install my-site ./helm \
  --set cronSchedule="0 */2 * * *"  # Update every 2 hours
With Custom Values File

Create a custom-values.yaml:

repoUrl: https://github.com/myorg/website.git
branch: main
cronSchedule: "0 */1 * * *"  # Every hour

ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: mysite.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: mysite-tls
      hosts:
        - mysite.example.com

resources:
  requests:
    memory: "64Mi"
    cpu: "250m"
  limits:
    memory: "128Mi"
    cpu: "500m"

Then install:

helm install my-site ./helm -f custom-values.yaml

Environment Variables (Container Level)

The following environment variables are automatically set by the Helm chart:

  • REPO_URL: Git repository URL
  • BRANCH: Git branch to checkout
  • CRON_SCHEDULE: Cron schedule for content updates

How It Works

  1. The container starts and immediately pulls content from the specified Git repository
  2. A cron job runs according to the cronSchedule to periodically update content
  3. Apache HTTP server serves the content from /usr/local/apache2/htdocs/
  4. Logs are written to /var/log/update_site.log

Troubleshooting

Check Update Logs
kubectl logs deployment/my-httpd-git
kubectl exec deployment/my-httpd-git -- tail -f /var/log/update_site.log
Verify Environment Variables
kubectl exec deployment/my-httpd-git -- env | grep -E "REPO_URL|BRANCH|CRON_SCHEDULE"

Tag summary

Content type

Helm

Digest

sha256:3bf3e9cc1

Size

3 kB

Last updated

4 months ago

helm pull oci://registry-1.docker.io/starwitorg/httpd-git-chart --version 1.0.3