generic-service

by NanoByte

Helm chartv1.15.0Verified publisher

runs a service (with monitoring, ingress, etc.)

About this chart

Generic Service Helm Chart

This Helm chart simplifies deploying a typical "80% case" service on Kubernetes. It takes care of creating common Resources such as Deployment, Service and Ingress. It also provides optional support for:

The Generic Service Grafana Dashboard is a useful companion to this chart.

Getting started

This chart is most commonly used as a dependency instead of installing it directly. You can reference it in your chart by adding this to your Chart.yaml:

dependencies:
  - name: generic-service
    version: ~1.15.0
    repository: https://helm.nano-byte.net
    alias: app

You can then add static configuration to your values.yaml like this:

app:
  image:
    repository: myservice
    tag: 1.2.3

Values

ValueDefaultDescription
nameRelease NameThe name of the service (used for app.kubernetes.io/name label)
fullnameRelease Name (+ name)The name of the service instance (used for resource names and app.kubernetes.io/instance label)
versionsame as image.tagThe version of the service (used for app.kubernetes.io/version label)
image.registrydocker.ioThe Registry containing the image to run
image.repositoryrequiredThe name of the image image to run (without the Registry)
image.tagrequiredThe tag of the image to run; start with @ for digest instead of tag (e.g., @sha256:abc...)
image.pullPolicyIfNotPresentSet to Always to try to pull new versions of the image
image.pullSecretName of the Kubernetes Secret providing credentials for pulling the image
securityContext.podruntime default seccompSecurity context to use for the pod
securityContext.containerdrop all capabilitesSecurity context to use for the container
command[]Overrides the command to launch in the image
args[]The command-line arguments passed to the service
env{}Environment variables passed to the service as a key-value map (keys and values support templating)
envFrom{}Environment variables from other sources (e.g., secretKeyRef); set an entry to null to remove it
config{}YAML/JSON configuration to be mounted as a file in the container
configMountPath/config/config.yamlThe file path in the container to mount the data from config into (exposed via $CONFIG_FILE)
additionalConfigs[]Additional ConfigMaps with key named data.yaml to be mounted (paths appended to $CONFIG_FILE)
secretConfig{}YAML/JSON configuration to be stored in a Secret and mounted as a JSON file in the container
secretConfigMountPath/secrets/secret.jsonThe file path in the container to mount the data from secretConfig into (exposed via $CONFIG_FILE)
secretConfigOptionalfalseStart the container even if the Secret for secretConfigEncrypted/secretConfigExternal is missing
secretConfigEncryptedkubeseal-encrypted JSON (key secret.json) used instead of secretConfig; creates SealedSecret
secretConfigSealingScopestrictThe kubeseal --scope used for secretConfigEncrypted (strict, namespace-wide or cluster-wide)
secretConfigExternalRemote secret key (with optional property/version) holding JSON config; creates ExternalSecret
secretConfigExternalStore.namerequired if externalThe name of the SecretStore to read secretConfigExternal from
secretConfigExternalStore.kindSecretStoreThe kind of the store (SecretStore or ClusterSecretStore)
secretConfigExternalRefreshInterval1hHow often to refresh the ExternalSecret for secretConfigExternal from the store
dnsConfigDNS config for the pod
startupProbeProbe that waits for the service to initially start up
livenessProbeProbe that causes the service to be restarted when failing
readinessProbeProbe that prevents the service from receiving traffic when failing
maxShutdownSeconds30The number of seconds the pod has to shutdown before it is terminated
labels{}Additional labels to set on all generated resources
annotations{}Additional annotations to set on the Pod controller and Pods
resources.requests.memory64MiThe amount of memory requested for the service (recommendation: slightly higher than average usage)
resources.requests.cpu10mThe number of CPU cores requested for the service
resources.limits.memory96MiThe maximum amount of memory the service may use (recommendation: slightly higher than worst-case usage)
resources.limits.cpu2000mThe maximum number of CPU cores the service may use
rollout.controllerDeploymentThe type of Pod controller to create (Deployment, StatefulSet, DaemonSet or ArgoRollout)
rollout.strategyRollingUpdateThe rollout strategy (RollingUpdate, Recreate, OnDelete, Canary or BlueGreen)
rollout.autoPromotiontrueAutomatically promote rollouts (if rollout.strategy is BlueGreen and rollout.flagger if false)
rollout.flaggerfalseUse Flagger to control rollouts (rollout.controller must be Deployment or StatefulSet)
rollout.analysisreq. for Canary or FlaggerFlagger or Argo Rollouts analysis for automatic Canary or BlueGreen promotion
rollout.canary.steps[]Argo Rollouts canary steps (e.g., setWeight, pause); makes rollout.analysis optional
rollout.blueGreen.postPromotionAnalysisArgo Rollouts analysis to run after promoting a BlueGreen rollout
rollout.blueGreen.scaleDownDelaySecondsSeconds to wait before scaling down the previous ReplicaSet after a BlueGreen promotion
rollout.revisionHistoryLimitnullNumber of old ReplicaSets to retain (rollout.controller must be Deployment or ArgoRollout)
rollout.progressDeadlineSecondsSeconds to make progress before rollout is considered failed (Deployment or ArgoRollout only)
rollout.progressDeadlineAbortfalseAbort the rollout when rollout.progressDeadlineSeconds is exceeded (ArgoRollout only)
rollout.minReadySecondsNumber of seconds a new Pod must be ready before it is considered available
rollout.maxSurgeNumber/percentage of Pods that can be created above replicas during RollingUpdate or Canary
rollout.maxUnavailableNumber/percentage of Pods that can be unavailable during RollingUpdate or Canary
rollout.rollbackWindowNumber of recent revisions to roll back to immediately, skipping analysis and steps (ArgoRollout only)
rollout.analysisSuccessfulRunHistoryLimitNumber of successful AnalysisRuns and Experiments to retain (ArgoRollout only)
rollout.analysisUnsuccessfulRunHistoryLimitNumber of unsuccessful AnalysisRuns and Experiments to retain (ArgoRollout only)
replicas1The number of instances of the service to run
autoscaling.enabledfalseEnables automatic starting of additional instances
autoscaling.typehpaThe type of autoscaler to use (hpa for HorizontalPodAutoscaler or keda for KEDA ScaledObject)
autoscaling.maxReplicas3The maximum number of instances to run (must be larger than replicas)
autoscaling.metric.typeResourceThe type of metric to use for scaling (Resource, Pods, Object or External) (HPA only)
autoscaling.metric.namecpuThe name of the metric to use for scaling (HPA only)
autoscaling.metric.objectreq. if type = ObjectReference to the Kubernetes object the metric describes (HPA only)
autoscaling.metric.selector{}Labels f

Deploy generic-service with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has generic-service 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 chartgeneric-service is pinned at v1.15.0 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