tomcat

by KubeGems

Helm chartv9.2.15App 10.0.8

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

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
global.storageClassGlobal storage class for dynamic provisioningnil

Common parameters

ParameterDescriptionDefault
nameOverrideString to partially override common.names.fullnamenil
fullnameOverrideString to fully override common.names.fullnamenil
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainDefault Kubernetes cluster domaincluster.local
extraDeployArray of extra objects to deploy with the release[] (evaluated as a template)
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)nil

Tomcat parameters

ParameterDescriptionDefault
image.registryTomcat image registrydocker.io
image.repositoryTomcat image namebitnami/tomcat
image.tagTomcat image tag{TAG_NAME}
image.pullPolicyTomcat image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.debugSpecify if debug logs should be enabledfalse
hostAliasesAdd deployment host aliases[]
tomcatUsernameTomcat admin useruser
tomcatPasswordTomcat admin passwordrandom 10 character alphanumeric string
tomcatAllowRemoteManagementEnable remote access to management interface0 (disabled)
commandOverride default container command (useful when using custom images)nil
argsOverride default container args (useful when using custom images)nil
extraEnvVarsExtra environment variables to be set on Tomcat container{}
extraEnvVarsCMName of existing ConfigMap containing extra env varsnil
extraEnvVarsSecretName of existing Secret containing extra env varsnil

Tomcat deployment parameters

ParameterDescriptionDefault
deployment.typeUse Deployment or StatefulSetdeployment
replicaCountSpecify number of Tomcat replicas1
containerPortHTTP port to expose at container level8080
containerExtraPortsExtra ports to expose at container level{}
podSecurityContextTomcat pods' Security ContextCheck values.yaml file
containerSecurityContextTomcat containers' Security ContextCheck values.yaml file
resources.limitsThe resources limits for the Tomcat container{}
resources.requestsThe requested resources for the Tomcat container{"memory": "512Mi", "cpu": "300m"}
livenessProbeLiveness probe configuration for TomcatCheck values.yaml file
readinessProbeReadiness probe configuration for TomcatCheck values.yaml file
customLivenessProbeOverride default liveness probenil
customReadinessProbeOverride default readiness probenil
updateStrategyStrategy to use to update PodsCheck values.yaml file
podAffinityPresetPod affinity preset. Ignored if affinity is set. Allowed values: soft or hard""
podAntiAffinityPresetPod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hardsoft
nodeAffinityPreset.typeNode affinity preset type. Ignored if affinity is set. Allowed values: soft or hard""
nodeAffinityPreset.keyNode label key to match. Ignored if affinity is set.""
nodeAffinityPreset.valuesNode label values to match. Ignored if affinity is set.[]
affinityAffinity for pod assignment{} (evaluated as a template)
nodeSelectorNode labels for pod assignment{} (evaluated as a template)
tolerationsTolerations for pod assignment[] (evaluated as a template)
podLabelsExtra labels for Tomcat pods{} (evaluated as a template)
podAnnotationsAnnotations for Tomcat pods{} (evaluated as a template)
extraVolumeMountsOptionally specify extra list of additional volumeMounts for Tomcat container(s)[]
extraVolumesOptionally specify extra list of additional volumes for Tomcat pods in Deployment[]
extraVolumeClaimTemplatesOptionally specify extra list of additional volume claim templates for Tomcat pods in StatefulSet[]
initContainersAdd additional init containers to the Tomcat pods{} (evaluated as a template)
sidecarsAdd additional sidecar containers to the Tomcat pods{} (evaluated as a template)
persistence.enabledEnable persistencetrue
persistence.storageClassPVC Storage Class for Tomcat volumenil (uses alpha storage class annotation)
persistence.existingClaimAn Existing PVC name for Tomcat volumenil (uses alpha storage class annotation)
persistence.accessModesPVC Access Modes for Tomcat volumeReadWriteOnce
persistence.sizePVC Storage Request for Tomcat volume8Gi
persistence.selectorLabelsSelector labels to use in volume claim template for Tomcat volume (Applicable when deployment.type is statefulset)nil

Exposure parameters

ParameterDescriptionDefault
service.typeKubernetes Service typeLoadBalancer
service.portService HTTP port80
service.nodePortKubernetes http node port""
service.loadBalancerIPKubernetes LoadBalancerIP to requestnil
service.externalTrafficPolicyEnable client source IP preservationCluster
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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttomcat is pinned at v9.2.15 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