tomcat
by KubeGems
Chart for Apache Tomcat
About this chart
Tomcat
Apache Tomcat, often referred to as Tomcat, is an open-source web server and servlet container developed by the Apache Software Foundation. Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages, Java EL, and WebSocket, and provides a "pure Java" HTTP web server environment for Java code to run in.
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/tomcat
Introduction
This chart bootstraps a Tomcat deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
Prerequisites
- Kubernetes 1.12+
- Helm 3.1.0
- PV provisioner support in the underlying infrastructure
- ReadWriteMany volumes for deployment scaling
Installing the Chart
To install the chart with the release name my-release:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/tomcat
These commands deploy Tomcat on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Parameters
The following tables lists the configurable parameters of the Tomcat chart and their default values per section/component:
Global parameters
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
global.storageClass | Global storage class for dynamic provisioning | nil |
Common parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override common.names.fullname | nil |
fullnameOverride | String to fully override common.names.fullname | nil |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
clusterDomain | Default Kubernetes cluster domain | cluster.local |
extraDeploy | Array of extra objects to deploy with the release | [] (evaluated as a template) |
kubeVersion | Force target Kubernetes version (using Helm capabilities if not set) | nil |
Tomcat parameters
| Parameter | Description | Default |
|---|---|---|
image.registry | Tomcat image registry | docker.io |
image.repository | Tomcat image name | bitnami/tomcat |
image.tag | Tomcat image tag | {TAG_NAME} |
image.pullPolicy | Tomcat image pull policy | IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.debug | Specify if debug logs should be enabled | false |
hostAliases | Add deployment host aliases | [] |
tomcatUsername | Tomcat admin user | user |
tomcatPassword | Tomcat admin password | random 10 character alphanumeric string |
tomcatAllowRemoteManagement | Enable remote access to management interface | 0 (disabled) |
command | Override default container command (useful when using custom images) | nil |
args | Override default container args (useful when using custom images) | nil |
extraEnvVars | Extra environment variables to be set on Tomcat container | {} |
extraEnvVarsCM | Name of existing ConfigMap containing extra env vars | nil |
extraEnvVarsSecret | Name of existing Secret containing extra env vars | nil |
Tomcat deployment parameters
| Parameter | Description | Default |
|---|---|---|
deployment.type | Use Deployment or StatefulSet | deployment |
replicaCount | Specify number of Tomcat replicas | 1 |
containerPort | HTTP port to expose at container level | 8080 |
containerExtraPorts | Extra ports to expose at container level | {} |
podSecurityContext | Tomcat pods' Security Context | Check values.yaml file |
containerSecurityContext | Tomcat containers' Security Context | Check values.yaml file |
resources.limits | The resources limits for the Tomcat container | {} |
resources.requests | The requested resources for the Tomcat container | {"memory": "512Mi", "cpu": "300m"} |
livenessProbe | Liveness probe configuration for Tomcat | Check values.yaml file |
readinessProbe | Readiness probe configuration for Tomcat | Check values.yaml file |
customLivenessProbe | Override default liveness probe | nil |
customReadinessProbe | Override default readiness probe | nil |
updateStrategy | Strategy to use to update Pods | Check values.yaml file |
podAffinityPreset | Pod affinity preset. Ignored if affinity is set. Allowed values: soft or hard | "" |
podAntiAffinityPreset | Pod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hard | soft |
nodeAffinityPreset.type | Node affinity preset type. Ignored if affinity is set. Allowed values: soft or hard | "" |
nodeAffinityPreset.key | Node label key to match. Ignored if affinity is set. | "" |
nodeAffinityPreset.values | Node label values to match. Ignored if affinity is set. | [] |
affinity | Affinity for pod assignment | {} (evaluated as a template) |
nodeSelector | Node labels for pod assignment | {} (evaluated as a template) |
tolerations | Tolerations for pod assignment | [] (evaluated as a template) |
podLabels | Extra labels for Tomcat pods | {} (evaluated as a template) |
podAnnotations | Annotations for Tomcat pods | {} (evaluated as a template) |
extraVolumeMounts | Optionally specify extra list of additional volumeMounts for Tomcat container(s) | [] |
extraVolumes | Optionally specify extra list of additional volumes for Tomcat pods in Deployment | [] |
extraVolumeClaimTemplates | Optionally specify extra list of additional volume claim templates for Tomcat pods in StatefulSet | [] |
initContainers | Add additional init containers to the Tomcat pods | {} (evaluated as a template) |
sidecars | Add additional sidecar containers to the Tomcat pods | {} (evaluated as a template) |
persistence.enabled | Enable persistence | true |
persistence.storageClass | PVC Storage Class for Tomcat volume | nil (uses alpha storage class annotation) |
persistence.existingClaim | An Existing PVC name for Tomcat volume | nil (uses alpha storage class annotation) |
persistence.accessModes | PVC Access Modes for Tomcat volume | ReadWriteOnce |
persistence.size | PVC Storage Request for Tomcat volume | 8Gi |
persistence.selectorLabels | Selector labels to use in volume claim template for Tomcat volume (Applicable when deployment.type is statefulset) | nil |
Exposure parameters
| Parameter | Description | Default |
|---|---|---|
service.type | Kubernetes Service type | LoadBalancer |
service.port | Service HTTP port | 80 |
service.nodePort | Kubernetes http node port | "" |
service.loadBalancerIP | Kubernetes LoadBalancerIP to request | nil |
service.externalTrafficPolicy | Enable client source IP preservation | Cluster |
service.annotations |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttomcat is pinned at v9.2.15 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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