From fe27745023e5eb06531bb0c34bfde6663fd4d81b Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Mon, 4 Sep 2017 17:43:30 -0400 Subject: [PATCH 1/2] [stable/consul] #1785 namespace defined templates with chart name --- stable/consul/Chart.yaml | 12 +++++++----- stable/consul/templates/_helpers.tpl | 4 ++-- stable/consul/templates/consul-test.yaml | 2 +- stable/consul/templates/consul.yaml | 18 +++++++++--------- stable/consul/templates/test-config.yaml | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/stable/consul/Chart.yaml b/stable/consul/Chart.yaml index 57215187179f..31fe81ac2c9a 100755 --- a/stable/consul/Chart.yaml +++ b/stable/consul/Chart.yaml @@ -1,11 +1,13 @@ name: consul home: https://github.com/hashicorp/consul -version: 0.3.1 +version: 0.4.0 appVersion: 0.8.3 -description: Highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy. +description: Highly available and distributed service discovery and key-value store + designed with support for the modern data center to make distributed systems and + configuration easy. icon: https://raw.githubusercontent.com/hashicorp/consul/bce3809dfca37b883828c3715b84143dd71c0f85/website/source/assets/images/favicons/android-chrome-512x512.png sources: - - https://github.com/kelseyhightower/consul-on-kubernetes +- https://github.com/kelseyhightower/consul-on-kubernetes maintainers: - - name: lachie83 - email: lachlan.evenson@microsoft.com +- name: lachie83 + email: lachlan.evenson@microsoft.com diff --git a/stable/consul/templates/_helpers.tpl b/stable/consul/templates/_helpers.tpl index c199f18f0d12..3090bc27f060 100644 --- a/stable/consul/templates/_helpers.tpl +++ b/stable/consul/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "consul.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 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "fullname" -}} +{{- define "consul.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/stable/consul/templates/consul-test.yaml b/stable/consul/templates/consul-test.yaml index 293aa73b9249..f9376100f7d5 100644 --- a/stable/consul/templates/consul-test.yaml +++ b/stable/consul/templates/consul-test.yaml @@ -32,7 +32,7 @@ spec: volumes: - name: tests configMap: - name: {{ template "fullname" . }}-tests + name: {{ template "consul.fullname" . }}-tests - name: tools emptyDir: {} restartPolicy: Never diff --git a/stable/consul/templates/consul.yaml b/stable/consul/templates/consul.yaml index 2a51ecaf2e28..29e3cede22fe 100644 --- a/stable/consul/templates/consul.yaml +++ b/stable/consul/templates/consul.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "fullname" . }}-gossip-key + name: {{ template "consul.fullname" . }}-gossip-key type: Opaque data: gossip-key: {{ randAlphaNum 24 | b64enc }} @@ -10,7 +10,7 @@ data: apiVersion: v1 kind: Service metadata: - name: "{{ template "fullname" . }}-ui" + name: "{{ template "consul.fullname" . }}-ui" labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -28,7 +28,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "consul.fullname" . }}" labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -68,18 +68,18 @@ spec: apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "consul.fullname" . }}" labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" component: "{{ .Release.Name }}-{{ .Values.Component }}" spec: - serviceName: "{{ template "fullname" . }}" + serviceName: "{{ template "consul.fullname" . }}" replicas: {{ default 3 .Values.Replicas }} template: metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "consul.fullname" . }}" labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -91,7 +91,7 @@ spec: securityContext: fsGroup: 1000 containers: - - name: "{{ template "fullname" . }}" + - name: "{{ template "consul.fullname" . }}" image: "{{ .Values.Image }}:{{ .Values.ImageTag }}" imagePullPolicy: "{{ .Values.ImagePullPolicy }}" ports: @@ -126,7 +126,7 @@ spec: - name: INITIAL_CLUSTER_SIZE value: {{ default 3 .Values.Replicas | quote }} - name: STATEFULSET_NAME - value: "{{ template "fullname" . }}" + value: "{{ template "consul.fullname" . }}" - name: POD_IP valueFrom: fieldRef: @@ -200,7 +200,7 @@ spec: volumes: - name: gossip-key secret: - secretName: {{ template "fullname" . }}-gossip-key + secretName: {{ template "consul.fullname" . }}-gossip-key volumeClaimTemplates: - metadata: name: datadir diff --git a/stable/consul/templates/test-config.yaml b/stable/consul/templates/test-config.yaml index deb42e05524c..96071d78754c 100644 --- a/stable/consul/templates/test-config.yaml +++ b/stable/consul/templates/test-config.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "fullname" . }}-tests + name: {{ template "consul.fullname" . }}-tests data: run.sh: |- @test "Testing Consul cluster has quorum" { From 3aefeaea8b08bd513c14f498c17eec51a95891d0 Mon Sep 17 00:00:00 2001 From: Dhilip Date: Tue, 28 Nov 2017 22:26:12 +0530 Subject: [PATCH 2/2] Fix Circle CI failure Added the missed out namespace entry --- stable/consul/templates/consul.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/consul/templates/consul.yaml b/stable/consul/templates/consul.yaml index 7860966c819c..eebf083cbf3f 100644 --- a/stable/consul/templates/consul.yaml +++ b/stable/consul/templates/consul.yaml @@ -29,7 +29,7 @@ spec: apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: - name: "{{ template "fullname" . }}-pdb" + name: "{{ template "consul.fullname" . }}-pdb" spec: maxUnavailable: {{ .Values.maxUnavailable }} selector: