instant-chart

by Teguru

Helm chartv1.0.1

A Helm chart enables rapid deployment

About this chart

Instant Helm Chart

A Helm chart enables rapid deployment.

Features

  • Supports Deployment, StatefulSet, DaemonSet, and CronJob
  • Config management via ConfigMap and Secret
  • Includes Service and Ingress resources
  • ArgoCD, FluxCD compatible

Prerequisites

  1. Kubernetes 1.16+
  2. Helm (preferably v3) installed – instructions are here.
  3. PheLab Helm repo configured
helm repo add phelab https://charts.phelab.com
helm repo update

Get Started

Get the default values:

helm show values phelab/instant-chart

The output:

## Number of pod replicas
##
replicas: 1

## A list of containers belonging to the pod
## E.g.
## containers:
##   - name: "my-container"
##     image: "my-image:latest"
##     ports:
##       - containerPort: 80
##     volumeMounts:
##       - name: "my-volume"
##         mountPath: "/data"
##         subPath: "my-subpath"
##         readOnly: true
containers: []

## Additional initialization containers
##
initContainers: []

## ....

Install Helm Chart

helm upgrade --install [RELEASE_NAME] phelab/instant-chart

See configuration below.

See helm install for command documentation.

Uninstall Helm Chart

helm uninstall [RELEASE_NAME]

This removes all the Kubernetes components associated with the chart and deletes the release.

See helm uninstall for command documentation.

Parameters

Global parameters

NameDescriptionDefault
global.appVersionSet app version label app.kubernetes.io/version.""
global.labelsAdd additional labels to the resources.{}
global.annotationsAdd additional annotations to the resources.{}
global.defaultStorageClassDefault storage class name for PVC.""

Name override

NameDescriptionDefault
nameOverrideOverride the default chart name.""
fullnameOverrideOverride the full name of resources.""

Deployment parameters

NameDescriptionDefault
replicasNumber of pod replicas.1
containersA list of containers belonging to the pod.[]
initContainersAdditional initialization containers.[]
volumesA list of volumes to be added to the pod. PVC will be created if volumes.persistentVolumeClaim.requests found.[]
imagePullSecretsReference to one or more secrets to be used when pulling images.[]
registryLoginCreate a Secret to provide the registry credentials for pulling private images.[]
securityContextDefine privilege and access control settings for a Pod or Container.{}
dnsConfigDNS configuration for the pod.{}
hostAliasesHost aliases for the pod.[]
overheadOverhead for the pod.{}
readinessGatesReadiness gates for the pod.[]
restartPolicyRestart policy for all containers within the pod .OnFailure
updateStrategyDefines the update strategy configuration for Deployment, StatefulSet, DaemonSet.

Configuration parameters

NameDescriptionDefault
configMapsList of ConfigMaps to create for storing non-sensitive data.{}
secretsList of Secrets to create for storing sensitive data.{}

Service parameters

NameDescriptionDefault
service.enabledSpecifies whether a service should be created.true
service.typeThe type of the service (ClusterIP, NodePort, LoadBalancer, ExternalName).ClusterIP
service.portsThe ports that the service should expose.[]
service.annotationsAnnotations to add to the service.{}
service.externalNameSet external name when using ExternalName Service{}
  • If service.ports is empty or service.ports.port is not specified, the first container port of the first container (default 80) will be used for both Service port and targetPort.
  • If service.ports.targetPort is not specified, service.ports.port will be used for targetPort.

Ingress parameters

NameDescriptionDefault
ingress.enabledSpecifies whether an ingress should be created.false
ingress.classNameIngress class name.""
ingress.annotationsOptionally specify additional annotations for the ingress.{}
ingress.rulesThe list of rules for the ingress.[]
ingress.tlsIngress TLS configuration.[]

Pod Scheduling parameters

NameDescriptionDefault
affinityAssign custom affinity rules to the pod.{}
nodeSelectorDefine which Nodes the Pods are scheduled on.{}
nodeNameAssign Pods to a specific node name.""
tolerationsTolerations for use with node taints.[]
topologySpreadConstraintsList of topology spread constraints to control how Pods are spread across your cluster among failure-domains.[]

Service Account parameters

NameDescriptionDefault
serviceAccount.createSpecifies whether a service account should be created.true
serviceAccount.nameThe name of the service account to use."default"
serviceAccount.automountSpecifies whether to automatically mount the API credentials for the service account.true
serviceAccount.annotationsAnnotations to add to the service account.{}

Container Healthcheck parameters

The livenessProbe, readinessProbe and startupProbe can be enabled by adding the corresponding fields. The default probe will use tcpSocket with the first container port detected (default 80).

For example:

# values.yaml
containers:
- image: my-app:latest
  ports:
  - containerPort: 3000
  livenessProbe:
    enabled: true

# output:
containers:
- name: container-0
  image: my-app:latest
  ports:
  - containerPort: 3000
  livenessProbe:
    tcpSocket:
      port: 3000
    initialDelaySeconds: 10
    periodSeconds: 10
    timeoutSeconds: 5
    failureThreshold: 5
    successThreshold: 1

Resource kind

NameDescriptionDefault
kindDeployment, StatefulSet, DaemonSet, CronJobDeployment

StatefulSet parameters

NameDescriptionDefault
ordinalsConfiguration for managing StatefulSet pod ordinals.{}
serviceNameThe name of the service that governs this StatefulSet. If not provided, it is generated by default.""
podManagementPolicyControls how pods are created during initial scale up, replacement, or scaling down.""
persistentVolumeClaimRetentionPolicyConfiguration for retention policy of persistent volume claims.
volumeClaimTemplatesConfiguration templates for defining volume claims in the StatefulSet.

CronJob

NameDescriptionDefault
scheduleThe schedule in Cron format. More info* * * * *
timeZoneThe time zone name for the given schedule. More info""
concurrencyPolicySpecifies how to treat concurrent executions of a Job.Allow
backoffLimitNumber of retries before marking a Job as failed.
backoffLimitPerIndexNumber of retries per index before marking a Job as failed.
parallelismNumber of concurrent Jobs allowed to run.
completionsNumber of successfully completed pods required to mark the Job as complete.
activeDeadlineSecondsDuration in seconds for which the Job can remain active before terminating.
completionModeMode for tracking Job completions.
manualSelectorSpecifies if the selector for Jobs should be manually defined.
maxFailedIndexesMaximum failed indexes before marking Job as failed.
podFailurePolicyConfiguration for handling pod failures.
podReplacementPolicyPolicy for replacing failed or terminating pods.
ttlSecondsAfterFinishedTime to retain Job resources after completion.

Deploy instant-chart with OpenTenant

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