memcached

by KubeGems

Helm chartv2.0.0App 1.5.22

Memcached Service, it is a single node service.

About this chart

一. Memcached

1. 简介

Memcached(1.5.22)服务,支持如下功能:

  • 单节点部署
  • 监控服务自动发现

2. 参数

如果存在父charts需要requirement当前charts,部分变量需要传递下来,目前常见覆盖的变量如下:

ParameterDescriptionDefaultDefault Value
nameOverride实例和Service的命名.Chart.Namecloud-memcached
architecture实例模式standalonestandalone,high-availability
nodeSelectorNode亲和性调度nullnull
tolerations调度容忍nullnull
metrics.enabled监控开关nulltrue

3. 样例

3.1 直接部署

直接通过helm部署memcache执行以下即可:

  • 下载cloud-memcached的charts包
  • 解压并进入到charts目录
  • 执行命令安装
helm template --name stable --namespace <namespace> --set nameOverride=<memcache服务名>  . - | kubectl apply -f -

3.2 应用Charts引用

应用Helm如需应用MYSQL中间件,请参考如下步骤

  • 在values.yaml自定义参数
memcached:
  nameOverride: smartvoice-memcached

二、原生Memcached

更多参数

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.registryMemcached image registrydocker.io
image.repositoryMemcached Image namebitnami/memcached
image.tagMemcached Image tag{TAG_NAME}
image.pullPolicyMemcached image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
nameOverrideString to partially override memcached.fullname template with a string (will prepend the release name)nil
fullnameOverrideString to fully override memcached.fullname template with a stringnil
clusterDomainKubernetes cluster domaincluster.local
replicas Number of containers1
extraEnv Additional env vars to pass{}
arguments Arguments to pass["/run.sh"]
memcachedUsernameMemcached admin usernil
memcachedPasswordMemcached admin passwordnil
service.typeKubernetes service type for MemcachedClusterIP
service.portMemcached service port11211
service.clusterIPSpecific cluster IP when service type is cluster IP. Use None for headless servicenil
service.nodePortKubernetes Service nodePortnil
service.loadBalancerIPloadBalancerIP if service type is LoadBalancernil
service.annotationsAdditional annotations for Memcached service{}
resources.requestsCPU/Memory resource requests{memory: "256Mi", cpu: "250m"}
resources.limitsCPU/Memory resource limits{}
persistence.enabledEnable persistence using PVCtrue
persistence.storageClassPVC Storage Class for Jenkins volumenil (uses alpha storage class annotation)
persistence.accessModePVC Access Mode for Jenkins volumeReadWriteOnce
persistence.sizePVC Storage Request for Jenkins volume8Gi
securityContext.enabledEnable security contexttrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
securityContext.readOnlyRootFilesystemEnable read-only filesystemfalse
podAnnotationsPod annotations{}
affinityMap of node/pod affinities{} (The value is evaluated as a template)
nodeSelectorNode labels for pod assignment{} (The value is evaluated as a template)
tolerationsTolerations for pod assignment[] (The value is evaluated as a template)
metrics.enabledStart a side-car prometheus exporterfalse
metrics.image.registryMemcached exporter image registrydocker.io
metrics.image.repositoryMemcached exporter image namebitnami/memcached-exporter
metrics.image.tagMemcached exporter image tag{TAG_NAME}
metrics.image.pullPolicyImage pull policyIfNotPresent
metrics.image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
metrics.podAnnotationsAdditional annotations for Metrics exporter{prometheus.io/scrape: "true", prometheus.io/port: "9150"}
metrics.resourcesExporter resource requests/limit{}
metrics.service.typeKubernetes service type for Prometheus metricsClusterIP
metrics.service.portPrometheus metrics service port9150
metrics.service.annotationsPrometheus exporter svc annotations{prometheus.io/scrape: "true", prometheus.io/port: "9150"}

The above parameters map to the env variables defined in bitnami/memcached. For more information please refer to the bitnami/memcached image documentation.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install my-release --set memcachedUsername=user,memcachedPassword=password bitnami/memcached

The above command sets the Memcached admin account username and password to user and password respectively.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install my-release -f values.yaml bitnami/memcached

Tip: You can use the default values.yaml

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 v2.0.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