Skip to content

    Kubernetes

    ForgeGuard publishes a Helm chart for Markdown Live Preview. The chart runs the static container with a hardened security posture: non-root, dropped capabilities, no privilege escalation, a read-only root filesystem, and a RuntimeDefault seccomp profile.

    • A Kubernetes cluster and kubectl context.
    • Helm 3.
    • Cluster access to pull ghcr.io/forgeguard-ai/markdown-live-preview.
    FieldValue
    Chart path (in repo)charts/markdown-live-preview
    Chart version0.1.1
    App version1.0.0
    Default imageghcr.io/forgeguard-ai/markdown-live-preview:latest
    ServiceClusterIP on port 80, targeting container port 80 (http)
    ProbesHTTP GET / liveness and readiness
    Resourcesrequests 50m CPU / 64Mi; limits 200m CPU / 128Mi
    IngressDisabled by default
    ServiceAccountNot created by default (serviceAccount.create: false)

    From a checkout of this repository:

    Terminal window
    helm upgrade --install markdown-live-preview charts/markdown-live-preview \
    --set image.tag=latest

    Lint and render the chart without applying it:

    Terminal window
    helm lint charts/markdown-live-preview
    helm template markdown-live-preview charts/markdown-live-preview

    The chart is also published to GHCR as an OCI artifact under oci://ghcr.io/forgeguard-ai/helm-charts:

    Terminal window
    helm pull oci://ghcr.io/forgeguard-ai/helm-charts/markdown-live-preview --version 0.1.1
    helm upgrade --install markdown-live-preview \
    oci://ghcr.io/forgeguard-ai/helm-charts/markdown-live-preview --version 0.1.1

    If the package is private, authenticate first:

    Terminal window
    helm registry login ghcr.io -u <github-user>

    Read-only root filesystem: writable volumes required

    Section titled “Read-only root filesystem: writable volumes required”

    The chart sets securityContext.readOnlyRootFilesystem: true. Nginx needs to write to a few paths at runtime (cache, PID, and temporary files), which a read-only root filesystem forbids. On most clusters you must provide writable emptyDir volumes for those paths, or the container will fail to start. The chart does not mount these by default, so add them through your own values or a patch, for example:

    # values you supply to helm upgrade --install ... -f writable.yaml
    extraVolumes:
    - name: nginx-cache
    emptyDir: {}
    - name: nginx-run
    emptyDir: {}
    - name: tmp
    emptyDir: {}

    The bundled chart templates do not yet expose extraVolumes/extraVolumeMounts. Until they do, mount the writable paths with a Kustomize patch or a post-render step, or relax readOnlyRootFilesystem for a specific environment. Validate on a non-production namespace first. This limitation is tracked as a known issue.

    Ingress is disabled by default. Enable it and set a host/class through values:

    Terminal window
    helm upgrade --install markdown-live-preview charts/markdown-live-preview \
    --set ingress.enabled=true \
    --set ingress.className=nginx \
    --set ingress.hosts[0].host=markdown.example.com \
    --set ingress.hosts[0].paths[0].path=/ \
    --set ingress.hosts[0].paths[0].pathType=Prefix
    Terminal window
    kubectl get pods -l app.kubernetes.io/name=markdown-live-preview
    kubectl port-forward svc/markdown-live-preview 8080:80
    curl --fail http://localhost:8080/