Generic Helm Chart

August 12, 2023 · View on GitHub

This chart is a template for common Kubernetes resource manifests, which should cover most use cases. Please read through the list of possible configuration parameters. If you miss a specific feature, you can easily add it via a pull request. If you don't think you can do that, just create a JIRA issue in the Container Platform Team JIRA project (Key: COP)

Change Log

In CHANGELOG.md are all changes since version 1.0.0 tracked with the corresponding migration guides.

Examples

You can find an example setup using the generic-chart in the examples directory. If you search of a more specific use-case, have a look at the test values.yaml in the tests/ directory.

Configuration

ParameterDescriptionDefault
replicaCountAmount of Pod replicas1
topologyKeytopologyKey``
revisionHistoryLimitAmount of old ReplicaSets for this Deployment should be retained1
image.repositoryURL to the container registry with organisation and repositorynil
image.tagImage tag of the provided container repositorynil
image.pullPolicyThe pull policy when a image should be pulled (IfNotPresent, Always)IfNotPresent
imagePullSecretsReference a Secret which should be use to authenticate against a container registrynil
nameOverrideOverride the fullname with this name""
namespaceOverrideOverrides the namespace in every resourcenil
serviceAccount.createIf a ServiceAccount should be created. If false a ServiceAccount must be provided and configured correctly with its name under serviceAccount.name.true
serviceAccount.nameName of the ServiceAccount. If not set and create is true, a name is generated using the name templatenil
serviceAccount.automountServiceAccountTokenIf true the Secret with the Token and Certificates of the ServiceAccount is mounted. Only required when access to the master API is necessaryfalse
serviceAccount.annotationsSets annotations for the ServiceAccount{}
networkMap of ports which should be exposed for services type ClusterIP. Adds ports section to the Pod template, adds ports section to Service and can create Ingress or Route and ServiceMonitor for the ports.network.http.servicePort: 8080
network.{}.servicePortPort number of the Service (e.g. 8080, 8443). If nil no port on the Service is exposednil
network.{}.containerPortThe port which is exposed on the Pod. If nil corresponds to the network.{}.servicePortnil
network.{}.ingressIf not nil creates an Ingress or Route for the Service and its servicePort. If set to {} see ingress.zonenil
network.{}.ingress.hostSets the hostname for the Ingress or Route. If nil see ingress.zonenil
network.{}.ingress.annotationsSets annotations for the Ingress or Route instance{}
network.{}.ingress.pathSets the path for the Ingress or Route instance/
network.{}.ingress.terminationTLS termination for the Ingress or Route instance. Possible values are edge, passthrough or reencryptedge
network.{}.ingress.enableIstioIngressGatewayPublish this service outside service meshfalse
network.{}.ingress.addAsEnvIf true, adds network.{}.ingress.host as environment variable. Default name is "INGRESS_HOST_"false
network.{}.ingress.envNameOverrideOverrides the generated environment variable name which is set by network.{}.ingress.addAsEnvnil
network.{}.ingress.enableIstioIngressGatewayPublish this service outside service meshfalse
network.{}.serviceMonitorIf set to {} creates a ServiceMonitor for the Service and its servicePort with default values for interval,path and schemenil
network.{}.serviceMonitor.intervalInterval at which metrics should be scraped30s
network.{}.serviceMonitor.pathHTTP path to scrape for metrics./metrics
network.{}.serviceMonitor.schemeHTTP scheme to scrape metricshttp
network.{}.serviceMonitor.extraConfigAny additional configuration available under endpoints of the ServiceMonitornil
serviceLoadBalancerMap of ports which should be exposed for services type LoadBalancer. Adds ports section to the Pod template, adds ports section to Service and can create ServiceMonitor for the ports.nil
serviceLoadBalancer.{}.servicePortPort number of the Service (e.g. 8080, 8443). If nil no port on the Service is exposednil
serviceLoadBalancer.{}.containerPortThe port which is exposed on the Pod. If nil corresponds to the network.{}.servicePortnil
serviceLoadBalancer.{}.serviceMonitorIf set to {} creates a ServiceMonitor for the Service and its servicePort with default values for interval,path and schemenil
serviceLoadBalancer.{}.serviceMonitor.intervalInterval at which metrics should be scraped30s
serviceLoadBalancer.{}.serviceMonitor.pathHTTP path to scrape for metrics./metrics
serviceLoadBalancer.{}.serviceMonitor.schemeHTTP scheme to scrape metricshttp
serviceLoadBalancer.{}.serviceMonitor.extraConfigAny additional configuration available under endpoints of the ServiceMonitornil
serviceLoadBalancerIPLoadBalancer IP on which service will be exposednil
serviceLoadBalancerAnnotationsSets annotations for the LoadBalancer type Servicenil
service.typeService type (ClusterIP, NodePort, ExternalName)ClusterIP
service.annotationsSets annotations for the Service
ingress.controllerSets the type of the ingress controller (e.g. Route, Ingress)Route
ingress.zoneDeprecated: If set to ch or sh and network.{}.ingress.host is nil, the hostname is generated (~ CHARTNAMECHART_NAME-RELEASE_NAME.ZONEZONEENV.os1.balgroupit.com)nil
externalSecret.secretStoreRef.spec.secretStoreRef of ExternalSecret{}
externalSecret.target.spec.target of ExternalSecretexternalSecret.target
externalSecret.addAsEnvMounts all referenced secret keys as environment variablestrue
externalSecret.mountPathIf set, mounts all referenced Secret keys as file. Path should NOT end with a /.nil
externalSecret.overrideNameOverrides default name of ExternalSecret or its resulting Secret.Release.Name
externalSecret.refsReferences to secrets in HashiCorp Vault[]
externalSecret.refs.vaultPathPath to secret in HashiCorp Vault (e.g. secrets/apps/exampleApplication/T/exampleSecret)[]
externalSecret.refs.vaultKeyKey of the secret in HashiCorp Vault (e.g. password)nil
externalSecret.refs.secretKeyKey for secret in the Kubernetes Secret (e.g. USERNAME). If not defined, externalSecret.refs.vaultKey is used.externalSecret.refs.vaultKey
externalSecret.refs.addAsEnvIf true, secretKey is mounted as environment variable. Overrides externalSecret.addAsEnvexternalSecret.addAsEnv
externalSecret.refs.mountPathIf set, secretKey is mounted as file on given mountPath. Can only overrides externalSecret.mountPath but disable itexternalSecret.mountPath
externalSecret.refsFromReferences to secrets in HashiCorp Vault using all KV-pairs from a specified path[]
externalSecret.refsFrom.vaultPathPath to secret in HashiCorp Vault (e.g. secrets/apps/exampleApplication/T/exampleSecret), all contained KV-pairs will be added[]
envList of environment variables for the Deploymentnil
envFromSet environment variables from a ConfigMap or Secret. See envFromnil
deployment.stateful.enabledIf true uses StatefulSet instead of Deploymentfalse
deployment.stateful.podManagementPolicyDefines podManagementPolicy for the StatefulSetOrderedReady
deployment.stateful.servicePerPodIf deployment.stateful is true, a Service per stateful Pod is created. Required for e.g. Remote EJBstrue
deployment.stateful.routePerServiceIf deployment.stateful is true, a Route per stateful Service is created. Required for e.g. Remote EJBstrue
deployment.strategySpecifies the strategy used to replace old Pods by new onestype: RollingUpdate
persistence.enabledIf true a PVC is createdfalse
persistence.nameThe name of the PVCgeneric-chart.name
persistence.accessModesaccessModes of the PVC (ReadWriteOnce, ReadWriteMany)ReadWriteOnce
persistence.storageClass[storageClass] of the PVC (trident-nfs-snapshot, trident-nfs)nil
persistence.sizeSize of the PVC (e.g. 512Mi, 10Gi, 1Ti)nil
persistence.volumeMountPathPath where to volume should be mounted (e.g. /var/data/). If set, volumes and volumeMounts are configurednil
persistence.annotationsSets annotations for the PersistentVolumeClaim{}
volumesSet Volumes available to the Pod[]
volumeMountsMounts a Volume defined in volumes in the container.[]
readinessProbeDefines the readinessProbe{}
livenessProbeDefines the livenessProbe{}
startupProbeDefines the startupProbe{}
resourcesCPU/Memory resource requests/limits{}
podSecurityContextsecurityContext of the Pod{}
securityContextsecurityContext for the container{}
nodeSelectornodeSelector schedules Pods only on matching nodes{}
tolerationstolerations allows to schedule Pods on nodes with taints{}
affinitySet affinity to control how pods are scheduled{}
defaultAffinityRules.enabledIf true prevents that the Pod defined in replicaCount are not scheduled on the same nodetrue
annotationsSets annotations for the Pod{}
commandSets command for the Pod.[]
argsSets args for the Pod.[]
initContainersSets initContainers for the Pod.[]
additionalContainersDefine additional containers for the Pod.[]
enableServiceMeshEnable or disable deployment of pods in a service meshfalse
enableReloaderEnable or disable automatic restarts of pods if a referenced ConfigMap or Secret has changed. More Infofalse

Contributions

If you contribute new featuers or fix a bug, please update the .version in the Chart.yaml according to SemVer and update the documentation.

Testing

To run tests

make test

To update the snapshot files

make test-update

If you want to add your own test case, simply copy tests/simple in a new directory and adjust the test.yaml and values.yaml accordingly.