From 62c3e9111f595f6e103b982dcd1442997816ebdf Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Wed, 11 Oct 2017 07:39:09 -0400 Subject: [PATCH] [stable/memcached] #1785 namespace defined templates with chart name (#2180) --- stable/memcached/Chart.yaml | 5 +++-- stable/memcached/templates/NOTES.txt | 4 ++-- stable/memcached/templates/_helpers.tpl | 4 ++-- stable/memcached/templates/pdb.yaml | 4 ++-- stable/memcached/templates/statefulset.yaml | 14 +++++++------- stable/memcached/templates/svc.yaml | 6 +++--- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/stable/memcached/Chart.yaml b/stable/memcached/Chart.yaml index dd3bcda72b..16e9b6a5e8 100644 --- a/stable/memcached/Chart.yaml +++ b/stable/memcached/Chart.yaml @@ -1,6 +1,7 @@ name: memcached -version: 1.2.1 -description: Free & open source, high-performance, distributed memory object caching system. +version: 2.0.0 +description: Free & open source, high-performance, distributed memory object caching + system. keywords: - memcached - cache diff --git a/stable/memcached/templates/NOTES.txt b/stable/memcached/templates/NOTES.txt index 6daaad879e..919ef38892 100644 --- a/stable/memcached/templates/NOTES.txt +++ b/stable/memcached/templates/NOTES.txt @@ -1,9 +1,9 @@ Memcached can be accessed via port 11211 on the following DNS name from within your cluster: -{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local +{{ 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 "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") + 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: diff --git a/stable/memcached/templates/_helpers.tpl b/stable/memcached/templates/_helpers.tpl index f0d83d2edb..56c9c4e5e7 100644 --- a/stable/memcached/templates/_helpers.tpl +++ b/stable/memcached/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "memcached.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -10,7 +10,7 @@ Expand the name of the chart. 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 "fullname" -}} +{{- define "memcached.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/stable/memcached/templates/pdb.yaml b/stable/memcached/templates/pdb.yaml index bbcb5176bd..cbd64de109 100644 --- a/stable/memcached/templates/pdb.yaml +++ b/stable/memcached/templates/pdb.yaml @@ -1,11 +1,11 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: - name: {{ template "fullname" . }} + name: {{ template "memcached.fullname" . }} spec: selector: matchLabels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/stable/memcached/templates/statefulset.yaml b/stable/memcached/templates/statefulset.yaml index 966b788044..27adc95a9c 100644 --- a/stable/memcached/templates/statefulset.yaml +++ b/stable/memcached/templates/statefulset.yaml @@ -1,19 +1,19 @@ apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: {{ template "fullname" . }} + name: {{ template "memcached.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: {{ template "fullname" . }} + serviceName: {{ template "memcached.fullname" . }} replicas: {{ .Values.replicaCount }} template: metadata: labels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -25,7 +25,7 @@ spec: - topologyKey: "kubernetes.io/hostname" labelSelector: matchLabels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} release: {{ .Release.Name | quote }} {{- else if eq .Values.AntiAffinity "soft" }} preferredDuringSchedulingIgnoredDuringExecution: @@ -34,11 +34,11 @@ spec: - topologyKey: "kubernetes.io/hostname" labelSelector: matchLabels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} release: {{ .Release.Name | quote }} {{- end }} containers: - - name: {{ template "fullname" . }} + - name: {{ template "memcached.fullname" . }} image: {{ .Values.image }} imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} command: diff --git a/stable/memcached/templates/svc.yaml b/stable/memcached/templates/svc.yaml index 23eacbc239..959b80f663 100644 --- a/stable/memcached/templates/svc.yaml +++ b/stable/memcached/templates/svc.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "memcached.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -14,4 +14,4 @@ spec: port: 11211 targetPort: memcache selector: - app: {{ template "fullname" . }} + app: {{ template "memcached.fullname" . }}