memcached

by sammyeby

Helm chartv1.0.3App 1.6.24Verified publisher

Memcached caching system deployment using official Docker images

About this chart

Memcached Helm Chart

A Helm chart for deploying Memcached on Kubernetes.

Overview

This chart deploys Memcached, a high-performance distributed memory object caching system, on Kubernetes using official Memcached Docker images.

Features

  • Official Images: Uses official Memcached Alpine images
  • Lightweight: Minimal resource footprint
  • Scalable: Easy horizontal scaling with multiple replicas
  • Security: Comprehensive securityContext and network policy support
  • High Availability: Support for multi-replica deployments

Prerequisites

  • Kubernetes 1.23+
  • Helm 3.8+

Installing the Chart

From OCI Registry

helm install memcached oci://ghcr.io/sammyeby/charts/memcached \
  --namespace cache \
  --create-namespace

From Source

helm install memcached ./memcached \
  --namespace cache \
  --create-namespace

Configuration

The following tables document all available configuration options in values.yaml.


Global Parameters

ParameterTypeDefaultDescription
global.imageRegistrystring""Global Docker Image registry
global.imagePullSecretsarray[]Global Docker registry secret names as an array
global.defaultStorageClassstring""Global default StorageClass for Persistent Volume(s)

Common Parameters

ParameterTypeDefaultDescription
nameOverridestring""String to partially override common.names.fullname
fullnameOverridestring""String to fully override common.names.fullname
namespaceOverridestring""String to fully override common.names.namespace
commonLabelsobject{}Add labels to all deployed resources
commonAnnotationsobject{}Add annotations to all deployed resources
clusterDomainstring"cluster.local"Kubernetes cluster domain
extraDeployarray[]Array of extra objects to deploy with the release

Image Parameters

ParameterTypeDefaultDescription
image.registrystring"docker.io"Memcached image registry
image.repositorystring"memcached"Memcached image repository
image.tagstring"1.6.24-alpine"Memcached image tag (immutable tags recommended)
image.digeststring""Memcached image digest (overrides tag if set)
image.pullPolicystring"IfNotPresent"Memcached image pull policy
image.pullSecretsarray[]Memcached image pull secrets
image.debugbooleanfalseEnable debug mode

Authentication Parameters

ParameterTypeDefaultDescription
auth.enabledbooleanfalseEnable SASL authentication
auth.usernamestring""SASL username
auth.passwordstring""SASL password
auth.existingPasswordSecretstring""Existing secret with Memcached credentials (must contain memcached-password key)

Memcached Configuration Parameters

ParameterTypeDefaultDescription
architecturestring"standalone"Memcached architecture (standalone or high-availability)
replicaCountnumber1Number of Memcached replicas to deploy
commandarray[]Override default container command
argsarray[]Override default container args
extraEnvVarsarray[]Extra environment variables
extraEnvVarsCMstring""ConfigMap with extra env vars
extraEnvVarsSecretstring""Secret with extra env vars
containerPorts.memcachednumber11211Memcached container port
extraContainerPortsarray[]Extra list of additional ports for container

Deployment Parameters

ParameterTypeDefaultDescription
updateStrategy.typestring"RollingUpdate"Statefulset strategy type
schedulerNamestring""Use alternate scheduler (e.g., stork)
terminationGracePeriodSecondsstring""Seconds pod needs to terminate gracefully
topologySpreadConstraintsarray[]Topology spread constraints for pod assignment
priorityClassNamestring""Priority Class to use for pods
automountServiceAccountTokenbooleanfalseMount Service Account token in pods
hostAliasesarray[]Pod host aliases
extraVolumesarray[]Extra list of additional volumes
extraVolumeMountsarray[]Extra list of additional volumeMounts
sidecarsarray[]Add additional sidecar containers
initContainersarray[]Add additional init containers
podLabelsobject{}Extra labels for pods
podAnnotationsobject{}Annotations for pods

Pod Scheduling Parameters

ParameterTypeDefaultDescription
podAffinityPresetstring""Pod affinity preset (soft or hard)
podAntiAffinityPresetstring""Pod anti-affinity preset (soft or hard)
nodeAffinityPreset.typestring""Node affinity preset type (soft or hard)
nodeAffinityPreset.keystring""Node label key to match
nodeAffinityPreset.valuesarray[]Node label values to match
affinityobject{}Affinity for pod assignment
nodeSelectorobject{}Node labels for pod assignment
tolerationsarray[]Tolerations for pod assignment

Resource Management Parameters

ParameterTypeDefaultDescription
resourcesPresetstring"nano"Resource preset (none, nano, micro, small, medium, large, xlarge, 2xlarge)
resourcesobject{}Container resource requests and limits (overrides resourcesPreset)

Security Context Parameters

ParameterTypeDefaultDescription
podSecurityContext.enabledbooleantrueEnable pods' Security Context
podSecurityContext.fsGroupChangePolicystring"Always"Filesystem group change policy
podSecurityContext.sysctlsarray[]Set kernel settings using sysctl interface
podSecurityContext.supplementalGroupsarray[]Set filesystem extra groups
podSecurityContext.fsGroupnumber11211Pod Security Context fsGroup
containerSecurityContext.enabledbooleantrueEnable containers' Security Context
containerSecurityContext.seLinuxOptionsobject{}SELinux options in container
containerSecurityContext.runAsUsernumber11211Containers' Security Context runAsUser
containerSecurityContext.runAsGroupnumber11211Containers' Security Context runAsGroup
containerSecurityContext.runAsNonRootbooleantrueRun containers as non-root
containerSecurityContext.privilegedbooleanfalseSet container privileged
containerSecurityContext.readOnlyRootFilesystembooleanfalseSet read-only root filesystem
containerSecurityContext.allowPrivilegeEscalationbooleanfalseAllow privilege escalation
containerSecurityContext.capabilities.droparray["ALL"]List of capabilities to drop
containerSecurityContext.seccompProfile.typestring"RuntimeDefault"Seccomp profile type

Health Check Parameters

ParameterTypeDefaultDescription
livenessProbe.enabledbooleantrueEnable livenessProbe
livenessProbe.tcpSocket.portstring"memcached"Port for TCP socket probe
livenessProbe.initialDelaySecondsnumber30Initial delay for livenessProbe
livenessProbe.periodSecondsnumber10Period seconds for livenessProbe
livenessProbe.timeoutSecondsnumber5Timeout seconds for livenessProbe
livenessProbe.failureThresholdnumber6Failure threshold for livenessProbe
livenessProbe.successThresholdnumber1Success threshold for livenessProbe
readinessProbe.enabledbooleantrueEnable readinessProbe
readinessProbe.tcpSocket.portstring"memcached"Port for TCP socket probe
readinessProbe.initialDelaySecondsnumber5Initial delay for readinessProbe
readinessProbe.periodSecondsnumber5Period seconds for readinessProbe
readinessProbe.timeoutSecondsnumber3Timeout seconds for readinessProbe
readinessProbe.failureThresholdnumber6Failure threshold for readinessProbe
readinessProbe.successThresholdnumber1Success threshold for readinessProbe
startupProbe.enabledbooleanfalseEnable startupProbe
startupProbe.tcpSocket.portstring"memcached"Port for TCP socket probe
startupProbe.initialDelaySecondsnumber30Initial delay for startupProbe
startupProbe.periodSecondsnumber10Period seconds for startupProbe
startupProbe.timeoutSecondsnumber5Timeout seconds for startupProbe
startupProbe.failureThresholdnumber6Failure threshold for startupProbe
startupProbe.successThresholdnumber1Success threshold for startupProbe
customLivenessProbeobject{}Custom livenessProbe
customReadinessProbeobject{}Custom readinessProbe
customStartupProbeobject{}Custom startupProbe
lifecycleHooksobject{}LifecycleHooks for additional configuration

Service Parameters

ParameterTypeDefaultDescription
service.typestring"ClusterIP"Kubernetes Service type
service.ports.memcachednumber11211Memcached service port
service.nodePorts.memcachedstring""Node port for Memcached
service.sessionAffinitystring"None"Session Affinity (None or ClientIP)
service.sessionAffinityConfigobject{}Additional settings for sessionAffinity
service.clusterIPstring""Static clusterIP or None for headless services
service.loadBalancerIPstring""Load balancer IP
service.loadBalancerSourceRangesarray[]Allowed addresses when service is LoadBalancer
service.externalTrafficPolicystring"Cluster"Enable client source IP preservation
service.annotationsobject{}Annotations for service
service.extraPortsarray[]Extra ports to expose in service

Service Account Parameters

ParameterTypeDefaultDescription
serviceAccount.createbooleantrueEnable creation of ServiceAccount
serviceAccount.namestring""Name of ServiceAccount to use
serviceAccount.automountServiceAccountTokenbooleanfalseAuto mount ServiceAccountToken
serviceAccount.annotationsobject{}Additional annotations for ServiceAccount

Pod Disruption Budget Parameters

ParameterTypeDefaultDescription
pdb.createbooleanfalseEnable Pod Disruption Budget creation
pdb.minAvailablestring""Minimum number/percentage of pods to remain scheduled
pdb.maxUnavailablestring""Maximum number/percentage of pods that may be unavailable

Autoscaling Parameters

ParameterTypeDefaultDescription
autoscaling.enabledbooleanfalseEnable Horizontal Pod Autoscaler
autoscaling.minReplicasnumber1Minimum number of replicas
autoscaling.maxReplicasnumber11Maximum number of replicas
autoscaling.targetCPUnumber50Target CPU utilization percentage
autoscaling.targetMemorynumber50Target Memory utilization percentage

Metrics Parameters

ParameterTypeDefaultDescription
metrics.enabledbooleanfalseEnable Prometheus metrics exporter
metrics.image.registrystring"docker.io"Metrics exporter image registry
metrics.image.repositorystring"prom/memcached-exporter"Metrics exporter image repository
metrics.image.tagstring"v0.14.0"Metrics exporter image tag
metrics.image.digeststring""Metrics exporter image digest
metrics.image.pullPolicystring"IfNotPresent"Image pull policy
metrics.image.pullSecretsarray[]Image pull secrets
metrics.containerPorts.metricsnumber9150Metrics container port
metrics.livenessProbe.enabledbooleantrueEnable livenessProbe
metrics.livenessProbe.initialDelaySecondsnumber15Initial delay
metrics.livenessProbe.periodSecondsnumber10Period seconds
metrics.livenessProbe.timeoutSecondsnumber5Timeout seconds
metrics.livenessProbe.failureThresholdnumber3Failure threshold
metrics.livenessProbe.successThresholdnumber1Success threshold
metrics.readinessProbe.enabledbooleantrueEnable readinessProbe
metrics.readinessProbe.initialDelaySecondsnumber5Initial delay
metrics.readinessProbe.periodSecondsnumber10Period seconds
metrics.readinessProbe.timeoutSecondsnumber3Timeout seconds
metrics.readinessProbe.failureThresholdnumber3Failure threshol

Deploy memcached with OpenTenant

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