Skip to content

Apache

Apache HTTP Server chart for Kubernetes using the official docker.io/library/httpd image. The chart is designed for static sites, reverse-proxy front doors, and simple web workloads that need a secure default runtime.

Key Features

  • Official httpd image pinned to Apache HTTP Server 2.4.67
  • Non-root runtime on port 8080 with hardened pod and container security contexts
  • Inline content, existing ConfigMap content, and extra Apache configuration
  • Ingress and Gateway API through the single gateway values block
  • Optional Basic Auth through an existing Secret
  • Apache exporter sidecar, ServiceMonitor, HPA, PDB, NetworkPolicy, and dual-stack Services
  • External Secrets Operator support for managed credentials

Installation

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install apache helmforge/apache --namespace apache --create-namespace
helm install apache oci://ghcr.io/helmforgedev/helm/apache --namespace apache --create-namespace

Examples

Custom static content:

content:
  files:
    index.html: |
      <h1>Hello from Apache</h1>

Gateway API exposure:

gateway:
  enabled: true
  parentRefs:
    - name: public-gateway
      namespace: gateway-system
  hostnames:
    - apache.example.com

Operations

Use serverStatus.require carefully when metrics are enabled. The Apache exporter reads mod_status; keep status paths restricted to the metrics sidecar or trusted networks in production.

Architecture

The chart runs Apache HTTP Server as a non-root Deployment listening on port 8080. The web root is populated from content.files or from content.existingConfigMap, while the generated Apache configuration keeps logs on stdout/stderr and avoids writable paths outside the configured volumes.

Typical production traffic is:

  1. Client traffic enters through Ingress or Gateway API.
  2. The HelmForge Service forwards requests to Apache pods.
  3. Apache serves static files, reverse-proxy rules, or extra virtual hosts from chart-managed configuration.
  4. Optional metrics scraping reaches the exporter sidecar and mod_status.
  5. Optional Basic Auth material is mounted from a Secret or an ExternalSecret-managed target Secret.

Production Values

Use explicit content, resources, replica count, disruption budgets, and network boundaries for production:

replicaCount: 3

content:
  existingConfigMap: apache-site-content

resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 1
    memory: 512Mi

pdb:
  enabled: true
  minAvailable: 1

networkPolicy:
  enabled: true
  egress:
    enabled: true
    allowDns: true
    allowInternet: false

Use immutable ConfigMaps for content releases. If a CI system rebuilds site assets, publish a new ConfigMap name and roll the release instead of mutating files inside the running container.

Routing

Ingress uses ingress.ingressClassName, matching the rest of the HelmForge chart catalog:

ingress:
  enabled: true
  ingressClassName: nginx
  hosts:
    - host: apache.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: apache-tls
      hosts:
        - apache.example.com

Gateway API uses the single gateway block:

gateway:
  enabled: true
  parentRefs:
    - name: public-gateway
      namespace: gateway-system
  hostnames:
    - apache.example.com
  path: /
  pathType: PathPrefix

Dual-stack Service fields are exposed directly:

service:
  ipFamilyPolicy: PreferDualStack
  ipFamilies:
    - IPv4
    - IPv6

Authentication And Secrets

Basic Auth is optional and expects an htpasswd file in an existing Secret:

basicAuth:
  enabled: true
  existingSecret: apache-basicauth
  htpasswdKey: htpasswd

For GitOps platforms, let External Secrets Operator reconcile that Secret:

basicAuth:
  enabled: true
  existingSecret: apache-basicauth

externalSecrets:
  enabled: true
  secretStoreRef:
    name: cluster-secrets
    kind: ClusterSecretStore
  data:
    - secretKey: htpasswd
      remoteRef:
        key: apache/basicauth
        property: htpasswd

The chart intentionally does not install a certificate manager, ingress controller, Gateway implementation, or WAF. Those platform responsibilities should be managed outside the Apache release.

Observability

Enable the exporter only when serverStatus.require allows the sidecar or a trusted scrape path to read mod_status:

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    labels:
      release: prometheus

serverStatus:
  require: 'all granted'

In locked-down environments, prefer restricting metrics with NetworkPolicy and ServiceMonitor selectors instead of opening mod_status to arbitrary client traffic.

Validation

After deployment:

helm test apache -n apache
kubectl get pods -n apache -l app.kubernetes.io/name=apache
kubectl logs -n apache deploy/apache --since=10m
kubectl get events -n apache --sort-by=.lastTimestamp

The chart exposes /healthz for probes and Helm tests. If you replace the generated configuration, keep the health endpoint or update probes to a path served by your application.

Common Issues

SymptomLikely CauseFix
403 from /server-statusserverStatus.require blocks the exporterPermit the exporter path or disable metrics.
Pods restart after adding contentConfigMap checksum changedExpected rollout; publish immutable ConfigMaps for controlled releases.
Ingress works but Gateway does notparentRefs points to the wrong Gateway or namespaceVerify Gateway API resources and listener hostnames.
Basic Auth is ignoredSecret key does not match basicAuth.htpasswdKeyCheck Secret data keys and ExternalSecret target keys.

Values

ParameterDefaultDescription
replicaCount2Number of Apache pods when autoscaling is disabled.
image.repositorydocker.io/library/httpdOfficial Apache HTTP Server image.
content.files{}Inline files rendered into the web root.
content.existingConfigMap""Existing ConfigMap with site content.
httpd.extraConfig""Additional Apache configuration.
basicAuth.enabledfalseEnable Basic Auth from an existing Secret.
service.ipFamilyPolicynullOptional Kubernetes Service IP family policy.
ingress.enabledfalseRender Kubernetes Ingress.
gateway.enabledfalseRender Gateway API HTTPRoute.
metrics.enabledfalseEnable Apache exporter sidecar.
externalSecrets.enabledfalseRender ExternalSecret resources.