Unverified Commit b9ee2633 by Denise Committed by GitHub

Merge pull request #214 from guangbochen/mem2.3

Bump memcached to 2.9.0
parents 6e5e87da 7048187f
apiVersion: v1
name: memcached
version: 2.9.0
appVersion: 1.5.12
description: Free & open source, high-performance, distributed memory object caching
system.
keywords:
- memcached
- cache
home: http://memcached.org/
icon: file://../memcached.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` |
| `memcached.extraArgs` | Additional memcached arguments | `[]` |
| `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 |
| `kind` | Install as StatefulSet or Deployment | StatefulSet |
| `podAnnotations` | Map of annotations to add to the pod(s) | `{}` |
| `podLabels` | Custom Labels to be applied to statefulset | Un-set |
| `nodeSelector` | Simple pod scheduling control | `{}` |
| `tolerations` | Allow or deny specific node taints | `{}` |
| `affinity` | Advanced pod scheduling control | `{}` |
| `securityContext.enabled` | Enable security context | `true` |
| `securityContext.fsGroup` | Group ID for the container | `1001` |
| `securityContext.runAsUser`| User ID for the container | `1001` |
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.
### Upgrade Notes:
Upgrading from version < 2.9.0 requires to select the `delete and recreate` option.
categories:
- Cache
labels:
io.cattle.role: project # options are cluster/project
rancher_min_version: 2.3
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:1.5.12-alpine"
description: "Memcached Docker image"
type: string
label: Memcached Docker Image
- 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: "ranchercharts/prometheus-memcached-exporter:v0.4.1"
description: "Docker repository of memcached metrics exporter"
type: string
label: Metrics Image Repository
required: true
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" . }}
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
minAvailable: {{ .Values.pdbMinAvailable }}
apiVersion: apps/v1
kind: {{ .Values.kind }}
metadata:
name: {{ template "memcached.fullname" . }}
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
{{- if eq .Values.kind "StatefulSet" }}
serviceName: {{ template "memcached.fullname" . }}
{{- end }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "memcached.fullname" . }}
release: "{{ .Release.Name }}"
template:
metadata:
labels:
app: {{ template "memcached.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- with .Values.podLabels }}
{{ toYaml . | indent 8 }}
{{- end}}
{{- with .Values.podAnnotations }}
annotations:
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
{{- end }}
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 }}
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
command:
- memcached
- -m {{ .Values.memcached.maxItemMemory }}
{{- if .Values.memcached.extendedOptions }}
- -o
- {{ .Values.memcached.extendedOptions }}
{{- end }}
{{- if .Values.memcached.verbosity }}
- -{{ .Values.memcached.verbosity }}
{{- end }}
{{- with .Values.memcached.extraArgs }}
{{ toYaml . | indent 8 }}
{{- 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 }}
imagePullPolicy: {{ default "" .Values.metrics.imagePullPolicy | quote }}
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
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 }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | trim | indent 8}}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ 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: ranchercharts/memcached:1.5.12-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
## Additional command line arguments to pass to memcached
## E.g. to specify a maximum value size
## extraArgs:
## - -I 2m
extraArgs: []
## Define various attributes of the service
serviceAnnotations: {}
# prometheus.io/scrape: "true"
## StatefulSet or Deployment
kind: StatefulSet
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 64Mi
cpu: 50m
## Key:value pair for assigning pod to specific sets of nodes
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
nodeSelector: {}
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: {}
## Advanced scheduling controls
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
affinity: {}
## Memcached pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
metrics:
## Expose memcached metrics in Prometheus format
enabled: false
## Memcached exporter image and tag
image: ranchercharts/prometheus-memcached-exporter: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: |
## Custom metadata labels to be applied to statefulset and pods
# podLabels:
# foo: "bar"
# bar: "foo"
# To be added to the server pod(s)
podAnnotations: {}
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