tomcat

by HelmForge

Helm chartv1.0.11App 11.0.29Apache-2.0Verified publisher

Apache Tomcat Helm chart with official image, Gateway API, JMX, and production controls

About this chart

Apache Tomcat

Production-oriented Apache Tomcat chart for Kubernetes using the official docker.io/library/tomcat image.

Features

  • Official Tomcat image pinned to 11.0.27-jdk17-temurin-noble by default.
  • Deterministic default ROOT application for probes and Helm tests.
  • Preservation of WARs and exploded applications baked into immutable images.
  • Non-root execution with a read-only root filesystem and explicit writable runtime volumes.
  • Ingress and Gateway API HTTPRoute exposure.
  • Optional JMX registry and RMI endpoints.
  • Dual-stack Services, NetworkPolicy, HPA, PDB, persistent webapps and logs, scheduling controls, and extension hooks.

Architecture

The chart runs one Tomcat Deployment behind a named-port Service. The official image listens on HTTP port 8080; service.ports.http is the independent client-facing Service port. Ingress and HTTPRoute resources route to that Service. Optional JMX registry and RMI ports are exposed only when JMX is enabled.

Tomcat needs writable webapps, logs, temp, work, and conf/Catalina/localhost paths. The chart mounts those paths explicitly while keeping the image root filesystem read-only. Webapps and logs can use generated or existing PVCs; the remaining runtime paths use emptyDir.

See DESIGN.md for the complete topology, trust boundaries, and design decisions.

Security

The default pod runs as UID/GID 1001, drops all Linux capabilities, disables privilege escalation, uses RuntimeDefault seccomp, and does not mount a Kubernetes API token. The root filesystem is read-only except for explicit runtime volumes.

NetworkPolicy is opt-in because application egress and ingress-controller selectors are environment-specific. Enabling it isolates ingress; egress stays unrestricted unless networkPolicy.egress.enabled is true or complete networkPolicy.egress.extraEgress rules are supplied. Before egress enforcement, declare every required DNS and application destination. JMX is also opt-in; restrict it to trusted peers and configure authentication and TLS before production use.

Security Scan: tomcat

FrameworkScore
MITRE + NSA + SOC295%

The remaining findings are documented product exceptions for opt-in NetworkPolicy boundaries.

Installation

helm install tomcat oci://repo.helmforge.dev/charts/tomcat \
  --namespace tomcat \
  --create-namespace \
  --wait

Verify the release:

helm test tomcat -n tomcat
kubectl get pods -n tomcat -l app.kubernetes.io/instance=tomcat

Configuration

Deploying applications

The official image starts without a production application. This chart seeds a small ROOT application so /health.jsp works immediately. For production, deploy a versioned WAR or exploded application with an immutable image or an init container.

When an immutable image contains applications under /usr/local/tomcat/webapps, keep webapps.copyImageContent.enabled=true. The chart copies image content only when the mounted webapps volume is empty. Set webapps.defaultRoot.enabled=false when your image owns the ROOT application.

Applications without /health.jsp must use an application-specific probe path or TCP probes:

webapps:
  defaultRoot:
    enabled: false

startupProbe:
  mode: tcp
livenessProbe:
  mode: tcp
readinessProbe:
  mode: tcp

HTTP listener and Service ports

The official image's primary HTTP Connector remains on port 8080. containerPorts.http is retained as a compatibility value and is constrained to 8080; it is not a client-facing port. Change service.ports.http to expose the application on a different Service port.

Custom tomcat.serverXml or tomcat.existingServerXmlConfigMap values may set proxy attributes such as proxyName, proxyPort, and scheme, but the primary HTTP Connector must continue to listen on 8080 so it matches the named Service target and probes.

Exposure

Ingress and Gateway API are both optional. Gateway API requires the CRDs and a parent Gateway managed by the platform team.

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

JMX

JMX is disabled by default because an unsecured remote management interface is unsafe. jmx.port configures the JVM registry port, and jmx.rmiPort configures the RMI endpoint. The chart advertises the Pod IP unless jmx.hostname is set.

jmx:
  enabled: true
  hostname: tomcat.example.local

For authentication or TLS, mount the required files with extraVolumes and extraVolumeMounts, then add the corresponding JVM flags through jmx.extraOpts.

Examples

  • Production baseline
  • Persistent webapps
  • JMX
  • Production operations guide

Upgrading

Tomcat 11.0.27 contains bug fixes, dependency updates, and stability improvements without a chart values migration. Review the official Tomcat 11 changelog and application compatibility before rollout.

For mutable webapps, back up the PVC before an upgrade. For immutable images, test the new image with the same probes and route configuration in a staging namespace. Custom clustering or server.xml configurations remain the operator's responsibility.

Key values

KeyDefaultDescription
replicaCount1Pod count when HPA is disabled
image.repositorydocker.io/library/tomcatOfficial image repository
image.tag11.0.27-jdk17-temurin-noblePinned image tag
containerPorts.http8080Fixed official HTTP Connector port
service.ports.http80Client-facing Service port
webapps.defaultRoot.enabledtrueSeed deterministic ROOT health app
webapps.copyImageContent.enabledtruePreserve image-baked webapps on an empty volume
webapps.persistence.enabledfalsePersist the webapps directory
logs.persistence.enabledfalsePersist Tomcat logs
tomcat.serverXml""Inline server.xml override
tomcat.existingServerXmlConfigMap""Existing ConfigMap with server.xml
startupProbe.modehttpStartup check mode: http or tcp
jmx.enabledfalseEnable JMX registry and RMI ports
ingress.enabledfalseRender an Ingress
gatewayAPI.enabledfalseRender an HTTPRoute
networkPolicy.enabledfalseRender a NetworkPolicy
serviceAccount.automountServiceAccountTokenfalseMount Kubernetes API credentials
securityContext.readOnlyRootFilesystemtrueKeep the image filesystem read-only
autoscaling.enabledfalseRender an HPA
pdb.enabledfalseRender a PodDisruptionBudget

Every supported value and its default is documented in values.yaml and validated by values.schema.json.

Validation

CI renders standalone, Ingress, Gateway API, dual-stack, JMX, and hardening scenarios. Unit tests cover workload security, writable paths, image webapp copying, probes, routing, JMX, NetworkPolicy, HPA, PDB, Services, and Helm test behavior. The release gate also runs strict lint, kubeconform, Artifact Hub lint, and behavioral k3d validation.

Troubleshooting

  • If the Pod is not Ready, verify that the selected probe path exists in the deployed application or switch the probes to tcp.
  • If an image-baked application is missing, confirm that webapps.copyImageContent.enabled=true and that a reused PVC was empty on its first deployment. The chart does not overwrite an initialized PVC.
  • If requests contain the wrong external scheme or hostname, configure proxy attributes in tomcat.serverXml while keeping the HTTP Connector on 8080.
  • If JMX connects to the registry but not RMI, verify jmx.hostname, jmx.rmiPort, service.ports.jmxRmi, and NetworkPolicy peers together.
  • If NetworkPolicy blocks the application, declare the ingress controller and all required egress destinations before enabling enforcement.

Links

Artifact Hub

artifacthub.io/category: integration-delivery
keywords: tomcat, apache, java, jakarta-ee, servlet, jsp, gateway-api

Deploy tomcat with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tomcat on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttomcat is pinned at v1.0.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply