Commit 9da44f32 by Yuxing

Init Rancher Charts Commit

Initial Charts - Memcached
parents
description: Free & open source, high-performance, distributed memory object caching
system.
engine: gotpl
home: http://memcached.org/
icon: https://upload.wikimedia.org/wikipedia/en/thumb/2/27/Memcached.svg/1024px-Memcached.svg.png
keywords:
- memcached
- cache
maintainers:
- email: gtaylor@gc-taylor.com
name: Greg Taylor
name: memcached
sources:
- https://github.com/docker-library/memcached
version: 2.0.2
# 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/incubator/memcached) chart from the [Bitnami Charts](https://github.com/bitnami/charts) repository.
## TL;DR;
```bash
$ helm install stable/memcached
```
## 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.
## Installing the Chart
To install the chart with the release name `my-release`:
```bash
$ helm install --name my-release stable/memcached
```
The command deploys Memcached on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```bash
$ helm delete my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## 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` |
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)
questions:
- variable: replicaCount
default: "3"
description: "Replica count"
type: string
- variable: AntiAffinity
default: "soft"
description: "Select AnitAffinity as either hard or soft, default is soft"
type: string
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" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- 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 }}
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 }}
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 }}"
spec:
clusterIP: None
ports:
- name: memcache
port: 11211
targetPort: memcache
selector:
app: {{ template "memcached.fullname" . }}
## Memcached image and tag
## ref: https://hub.docker.com/r/library/memcached/tags/
##
image: memcached:1.4.36-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
pdbMinAvailable: 3
## Select AnitAffinity 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
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 64Mi
cpu: 50m
name: memcached
version: 2.0.3
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: Greg Taylor
email: gtaylor@gc-taylor.com
engine: gotpl
# 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/incubator/memcached) chart from the [Bitnami Charts](https://github.com/bitnami/charts) repository.
## TL;DR;
```bash
$ helm install stable/memcached
```
## 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.
## Installing the Chart
To install the chart with the release name `my-release`:
```bash
$ helm install --name my-release stable/memcached
```
The command deploys Memcached on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```bash
$ helm delete my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## 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` |
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)
questions:
- variable: replicaCount
default: "3"
description: "Replica count"
type: string
- variable: AntiAffinity
default: "soft"
description: "Select AnitAffinity as either hard or soft, default is soft"
type: string
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" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- 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 }}
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 }}
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 }}"
spec:
clusterIP: None
ports:
- name: memcache
port: 11211
targetPort: memcache
selector:
app: {{ template "memcached.fullname" . }}
## Memcached image and tag
## ref: https://hub.docker.com/r/library/memcached/tags/
##
image: memcached: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
pdbMinAvailable: 3
## Select AnitAffinity 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
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 64Mi
cpu: 50m
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