From 005af9deca2cbd657bdad0be73d5a5952738a93f Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Wed, 23 Aug 2017 17:36:13 -0400 Subject: [PATCH] [incubator/redis-cache] #1785 namespace defined templates with chart name --- incubator/redis-cache/Chart.yaml | 10 +++++----- incubator/redis-cache/templates/NOTES.txt | 2 +- incubator/redis-cache/templates/_helpers.tpl | 4 ++-- incubator/redis-cache/templates/pdb.yaml | 4 ++-- incubator/redis-cache/templates/service.yaml | 6 +++--- incubator/redis-cache/templates/ss.yaml | 14 +++++++------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/incubator/redis-cache/Chart.yaml b/incubator/redis-cache/Chart.yaml index 156fad211d52..0cd016092ed7 100644 --- a/incubator/redis-cache/Chart.yaml +++ b/incubator/redis-cache/Chart.yaml @@ -1,11 +1,11 @@ apiVersion: v1 description: A pure in-memory redis cache, using statefulset and redis-sentinel-micro name: redis-cache -version: 0.2.0 +version: 0.3.0 icon: https://redis.io/images/redis-white.png sources: - - https://github.com/antirez/redis - - https://github.com/dhilipkumars/redis-sentinel-micro/tree/k8s +- https://github.com/antirez/redis +- https://github.com/dhilipkumars/redis-sentinel-micro/tree/k8s maintainers: - - name: dhilipkumars - email: dhilip.kumar.s@huawei.com +- name: dhilipkumars + email: dhilip.kumar.s@huawei.com diff --git a/incubator/redis-cache/templates/NOTES.txt b/incubator/redis-cache/templates/NOTES.txt index dc3302d30138..e517c344650c 100644 --- a/incubator/redis-cache/templates/NOTES.txt +++ b/incubator/redis-cache/templates/NOTES.txt @@ -1,2 +1,2 @@ 1. To Find which replica is the master - kubectl exec -i -t {{ template "fullname" . }}-0 -c redis -- redis-cli -h {{ template "fullname" . }}-0.{{ template "fullname" . }}.{{ .Release.Namespace }} -p 6379 info replication + kubectl exec -i -t {{ template "redis-cache.fullname" . }}-0 -c redis -- redis-cli -h {{ template "redis-cache.fullname" . }}-0.{{ template "redis-cache.fullname" . }}.{{ .Release.Namespace }} -p 6379 info replication diff --git a/incubator/redis-cache/templates/_helpers.tpl b/incubator/redis-cache/templates/_helpers.tpl index f0d83d2edba6..1ce2b95c7524 100644 --- a/incubator/redis-cache/templates/_helpers.tpl +++ b/incubator/redis-cache/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "redis-cache.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 "redis-cache.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/incubator/redis-cache/templates/pdb.yaml b/incubator/redis-cache/templates/pdb.yaml index adb0fc765863..9b70787c32bb 100644 --- a/incubator/redis-cache/templates/pdb.yaml +++ b/incubator/redis-cache/templates/pdb.yaml @@ -1,11 +1,11 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: - name: {{ template "fullname" . }} + name: {{ template "redis-cache.fullname" . }} spec: selector: matchLabels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/incubator/redis-cache/templates/service.yaml b/incubator/redis-cache/templates/service.yaml index e4cbe47ec442..0d4f8adcae99 100644 --- a/incubator/redis-cache/templates/service.yaml +++ b/incubator/redis-cache/templates/service.yaml @@ -3,9 +3,9 @@ kind: Service metadata: annotations: service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" - name: {{ template "fullname" . }} + name: {{ template "redis-cache.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -15,4 +15,4 @@ spec: name: {{ .Values.service.name }} clusterIP: None selector: - app: {{ template "name" . }} \ No newline at end of file + app: {{ template "redis-cache.name" . }} \ No newline at end of file diff --git a/incubator/redis-cache/templates/ss.yaml b/incubator/redis-cache/templates/ss.yaml index fa5d00503e25..e89b0f274cf9 100644 --- a/incubator/redis-cache/templates/ss.yaml +++ b/incubator/redis-cache/templates/ss.yaml @@ -1,19 +1,19 @@ apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "redis-cache.fullname" . }}" labels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: "{{ template "fullname" . }}" + serviceName: "{{ template "redis-cache.fullname" . }}" replicas: {{ .Values.replicaCount }} template: metadata: labels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -28,7 +28,7 @@ spec: - topologyKey: "kubernetes.io/hostname" labelSelector: matchLabels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} release: {{ .Release.Name | quote }} {{- else if eq .Values.antiAffinity "soft" }} preferredDuringSchedulingIgnoredDuringExecution: @@ -36,7 +36,7 @@ spec: podAffinityTerm: labelSelector: matchLabels: - app: {{ template "name" . }} + app: {{ template "redis-cache.name" . }} release: {{ .Release.Name | quote }} topologyKey: "kubernetes.io/hostname" {{- end }} @@ -44,7 +44,7 @@ spec: - name: sentinel-micro image: {{ .Values.microSentinel.image.repository }}:{{ .Values.microSentinel.image.tag }} imagePullPolicy: {{ .Values.microSentinel.image.pullPolicy }} - args: ["-service",{{ template "fullname" . }}] + args: ["-service",{{ template "redis-cache.fullname" . }}] resources: {{ toYaml .Values.microSentinel.resources | indent 12 }} env: