Commit dcc4ab39 by Guangbo Chen

Add memcached 2.3.1 backup

parent 380bd960
name: memcached
version: 2.3.1
appVersion: 1.5.6
description: Free & open source, high-performance, distributed memory object caching
system.
keywords:
- memcached
- cache
home: http://memcached.org/
icon: https://upload.wikimedia.org/wikipedia/en/thumb/2/27/Memcached.svg/1024px-Memcached.svg.png
sources:
- https://github.com/docker-library/memcached
maintainers:
- name: gtaylor
email: gtaylor@gc-taylor.com
- name: olemarkus
email: o.with@sportradar.com
- name: kennethaasan
email: k.aasan@sportradar.com
engine: gotpl
approvers:
- olemarkus
- gtaylor
- kennethaasan
reviewers:
- olemarkus
- gtaylor
- kennethaasan
## Configuration
The following table lists the configurable parameters of the Memcached chart and their default values.
| Parameter | Description | Default |
|---------------------------|---------------------------------|---------------------------------------------------------|
| `image` | The image to pull and run | A recent official memcached tag |
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `memcached.verbosity` | Verbosity level (v, vv, or vvv) | Un-set. |
| `memcached.maxItemMemory` | Max memory for items (in MB) | `64` |
| `metrics.enabled` | Expose metrics in prometheus format | false |
| `metrics.image` | The image to pull and run for the metrics exporter | A recent official memcached tag |
| `metrics.imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `metrics.resources` | CPU/Memory resource requests/limits for the metrics exporter | `{}` |
| `extraContainers` | Container sidecar definition(s) as string | Un-set |
| `extraVolumes` | Volume definitions to add as string | Un-set |
The above parameters map to `memcached` params. For more information please refer to the [Memcached documentation](https://github.com/memcached/memcached/wiki/ConfiguringServer).
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
$ helm install --name my-release \
--set memcached.verbosity=v \
stable/memcached
```
The above command sets the Memcached verbosity to `v`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
$ helm install --name my-release -f values.yaml stable/memcached
```
> **Tip**: You can use the default [values.yaml](values.yaml)
# Memcached
[Memcached](https://memcached.org/) is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Based on the [memcached](https://github.com/bitnami/charts/tree/master/bitnami/memcached) chart from the [Bitnami Charts](https://github.com/bitnami/charts) repository.
## Introduction
This chart bootstraps a [Memcached](https://hub.docker.com/_/memcached/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
categories:
- Cache
questions:
- variable: defaultImage
default: "true"
description: "Use default Docker image"
label: Use Default Images
type: boolean
show_subquestion_if: false
group: "Container Images"
subquestions:
- variable: image
default: "memcached"
description: "Memcached Docker image"
type: string
label: Memcached Docker Image
- variable: imageTag
default: "1.5.6-alpine"
description: "memcached Docker image tag"
type: string
label: Memcached Docker Image Tag
- variable: replicaCount
default: "3"
description: "Number or Memcached pods to run"
type: string
required: true
label: Memcached Replicas
group: "Memcached Settings"
- variable: AntiAffinity
default: "hard"
description: "Select AnitAffinity as either hard or soft, default is soft"
type: enum
options:
- "soft"
- "hard"
required: true
label: AnitAffinity
group: "Memcached Settings"
- variable: showMemcachedOptions
default: "false"
description: "More Details:(https://github.com/memcached/memcached/wiki/ConfiguringServer#commandline-arguments)"
label: Set Advanced Memcached Configurations
type: boolean
show_subquestion_if: true
group: "Memcached Settings"
subquestions:
- variable: memcached.maxItemMemory
default: "64"
description: "Max memory to use for items(in MB), from 1-65535"
type: string
label: max_memory(MB)
required: true
- variable: memcached.verbosity
default: "v"
description: "Verbosity level (v, vv, or vvv)"
type: enum
label: Verbosity Level
options:
- "v"
- "vv"
- "vvv"
required: true
- variable: metrics.enabled
default: false
description: "Expose metrics in prometheus format"
label: Enable Memcached Metrics
type: boolean
show_subquestion_if: true
group: "Metrics Settings"
subquestions:
- variable: metrics.image
default: "quay.io/prometheus/memcached-exporter"
description: "Docker repository of memcached metrics exporter"
type: string
label: Metrics Image Repository
required: true
- variable: metrics.imageTag
default: "v0.4.1"
description: "memcached metrics image tag"
type: string
required: true
label: Metrics Image Tag
Memcached can be accessed via port 11211 on the following DNS name from within your cluster:
{{ template "memcached.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
If you'd like to test your instance, forward the port locally:
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "memcached.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 11211
In another tab, attempt to set a key:
$ echo -e 'set mykey 0 60 5\r\nhello\r' | nc localhost 11211
You should see:
STORED
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "memcached.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "memcached.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "memcached.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
minAvailable: {{ .Values.pdbMinAvailable }}
\ No newline at end of file
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ template "memcached.fullname" . }}
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
serviceName: {{ template "memcached.fullname" . }}
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
affinity:
podAntiAffinity:
{{- if eq .Values.AntiAffinity "hard" }}
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "memcached.fullname" . }}
release: {{ .Release.Name | quote }}
{{- else if eq .Values.AntiAffinity "soft" }}
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 5
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "memcached.fullname" . }}
release: {{ .Release.Name | quote }}
{{- end }}
containers:
- name: {{ template "memcached.fullname" . }}
image: {{ .Values.image }}:{{ .Values.imageTag }}
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
command:
- memcached
- -m {{ .Values.memcached.maxItemMemory }}
{{- if .Values.memcached.extendedOptions }}
- -o
- {{ .Values.memcached.extendedOptions }}
{{- end }}
{{- if .Values.memcached.verbosity }}
- -{{ .Values.memcached.verbosity }}
{{- end }}
ports:
- name: memcache
containerPort: 11211
livenessProbe:
tcpSocket:
port: memcache
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
tcpSocket:
port: memcache
initialDelaySeconds: 5
timeoutSeconds: 1
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.metrics.enabled }}
- name: metrics
image: {{ .Values.metrics.image }}:{{ .Values.metrics.imageTag }}
imagePullPolicy: {{ default "" .Values.metrics.imagePullPolicy | quote }}
ports:
- name: metrics
containerPort: 9150
resources:
{{ toYaml .Values.metrics.resources | indent 10 }}
{{- end }}
{{- with .Values.extraContainers }}
{{ tpl . $ | indent 6 }}
{{- end }}
{{- with .Values.extraVolumes }}
volumes:
{{ tpl . $ | indent 6 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | trim | indent 8}}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "memcached.fullname" . }}
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{- if .Values.serviceAnnotations }}
{{ toYaml .Values.serviceAnnotations | indent 4 }}
{{- end }}
{{- if .Values.metrics.enabled }}
{{ toYaml .Values.metrics.annotations | indent 4 }}
{{- end }}
spec:
clusterIP: None
ports:
- name: memcache
port: 11211
targetPort: memcache
{{- if .Values.metrics.enabled }}
- name: metrics
port: 9150
targetPort: metrics
{{- end }}
selector:
app: {{ template "memcached.fullname" . }}
## Memcached image and tag
## ref: https://hub.docker.com/r/library/memcached/tags/
##
image: memcached
imageTag: 1.5.6-alpine
## Specify a imagePullPolicy
## 'Always' if imageTag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
# imagePullPolicy:
#
## Replica count
replicaCount: 3
## Pod disruption budget minAvailable count
## Ensure this value is lower than replicaCount in order to allow a worker
## node to drain successfully
pdbMinAvailable: 2
## Select AntiAffinity as either hard or soft, default is hard
AntiAffinity: "hard"
memcached:
## Various values that get set as command-line flags.
## ref: https://github.com/memcached/memcached/wiki/ConfiguringServer#commandline-arguments
##
maxItemMemory: 64
verbosity: v
extendedOptions: modern
## Define various attributes of the service
serviceAnnotations: {}
# prometheus.io/scrape: "true"
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 64Mi
cpu: 50m
nodeSelector: {}
metrics:
## Expose memcached metrics in Prometheus format
enabled: false
## Memcached exporter image and tag
image: quay.io/prometheus/memcached-exporter
imageTag: v0.4.1
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9150"
## Specify a imagePullPolicy
## 'Always' if imageTag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
# imagePullPolicy: IfNotPresent
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
extraContainers: |
extraVolumes: |
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment