summaryrefslogtreecommitdiffstats
path: root/kubernetes/consul/templates
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/consul/templates')
-rw-r--r--kubernetes/consul/templates/configmap.yaml (renamed from kubernetes/consul/templates/consul-agent-configmap.yaml)18
-rw-r--r--kubernetes/consul/templates/consul-server-deployment.yaml39
-rw-r--r--kubernetes/consul/templates/consul-server-service.yaml38
-rw-r--r--kubernetes/consul/templates/deployment.yaml (renamed from kubernetes/consul/templates/consul-agent-deployment.yaml)33
-rw-r--r--kubernetes/consul/templates/secrets.yaml7
5 files changed, 29 insertions, 106 deletions
diff --git a/kubernetes/consul/templates/consul-agent-configmap.yaml b/kubernetes/consul/templates/configmap.yaml
index 57d52c4de1..a4270d3c87 100644
--- a/kubernetes/consul/templates/consul-agent-configmap.yaml
+++ b/kubernetes/consul/templates/configmap.yaml
@@ -12,28 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#{{ if not .Values.disableConsulConsulAgent }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: consul-agent-configmap
- namespace: {{ .Values.nsPrefix }}
+ name: {{ include "common.fullname" . }}-configmap
+ namespace: {{ include "common.namespace" . }}
data:
{{ tpl (.Files.Glob "resources/config/consul-agent-config/*").AsConfig . | indent 2 }}
---
apiVersion: v1
kind: ConfigMap
metadata:
- name: consul-agent-scripts-configmap
- namespace: {{ .Values.nsPrefix }}
+ name: {{ include "common.fullname" . }}-scripts-configmap
+ namespace: {{ include "common.namespace" . }}
data:
{{ tpl (.Files.Glob "resources/config/consul-agent-config/scripts/*").AsConfig . | indent 2 }}
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: consul-agent-certs-secret
- namespace: {{ .Values.nsPrefix }}
-data:
-{{ tpl (.Files.Glob "resources/config/consul-agent-config/certs/*").AsSecrets . | indent 2 }}
-#{{ end }}
diff --git a/kubernetes/consul/templates/consul-server-deployment.yaml b/kubernetes/consul/templates/consul-server-deployment.yaml
deleted file mode 100644
index 50dfb77d5e..0000000000
--- a/kubernetes/consul/templates/consul-server-deployment.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright © 2017 Amdocs, Bell Canada
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#{{ if not .Values.disableConsulConsulServer }}
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
- labels:
- app: consul-server
- name: consul-server
- namespace: "{{ .Values.nsPrefix }}"
-spec:
- replicas: {{ .Values.consulServerReplicas }}
- selector:
- matchLabels:
- app: consul-server
- template:
- metadata:
- labels:
- app: consul-server
- name: consul-server
- spec:
- containers:
- - image: "{{ .Values.consulserverRegistry }}"
- command: ["/usr/local/bin/docker-entrypoint.sh"]
- args: ["agent","-server","-client","0.0.0.0","-enable-script-checks","-bootstrap-expect=3","-ui","-join","consul-server.{{ .Values.nsPrefix }}"]
- name: consul-server
-#{{ end }}
diff --git a/kubernetes/consul/templates/consul-server-service.yaml b/kubernetes/consul/templates/consul-server-service.yaml
deleted file mode 100644
index 1a646b4aba..0000000000
--- a/kubernetes/consul/templates/consul-server-service.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright © 2017 Amdocs, Bell Canada
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#{{ if not .Values.disableConsulConsulServer }}
-apiVersion: v1
-kind: Service
-metadata:
- labels:
- app: consul-server
- name: consul-server
- namespace: "{{ .Values.nsPrefix }}"
-spec:
- ports:
- - name: consul-ui
- nodePort: {{ .Values.nodePortPrefix }}70
- port: 8500
- protocol: TCP
- targetPort: 8500
- - name: consul-join
- nodePort: {{ .Values.nodePortPrefix }}71
- port: 8301
- protocol: TCP
- targetPort: 8301
- selector:
- app: consul-server
- type: {{ .Values.service.type | quote }}
-#{{ end }} \ No newline at end of file
diff --git a/kubernetes/consul/templates/consul-agent-deployment.yaml b/kubernetes/consul/templates/deployment.yaml
index 2c4a14a9b6..68b23917b6 100644
--- a/kubernetes/consul/templates/consul-agent-deployment.yaml
+++ b/kubernetes/consul/templates/deployment.yaml
@@ -12,30 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#{{ if not .Values.disableConsulConsulAgent }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
+ name: {{ include "common.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
labels:
- app: consul-agent
- name: consul-agent
- namespace: "{{ .Values.nsPrefix }}"
+ app: {{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
spec:
- replicas: {{ .Values.consulAgentReplicas }}
+ replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
- app: consul-agent
+ app: {{ include "common.name" . }}
template:
metadata:
labels:
- app: consul-agent
- name: consul-agent
+ app: {{ include "common.name" . }}
+ release: {{ .Release.Name }}
+ name: {{ include "common.name" . }}
spec:
containers:
- - image: "{{ .Values.consulagentRegistry }}"
+ - image: "{{ .Values.repository | default .Values.global.repository }}/{{ .Values.image }}"
command: ["/usr/local/bin/docker-entrypoint.sh"]
- args: ["agent","-client","0.0.0.0","-enable-script-checks","-join","consul-server.{{ .Values.nsPrefix }}"]
- name: consul-server
+ args: ["agent","-client","0.0.0.0","-enable-script-checks","-join","{{ .Release.Name }}-{{ index .Values "consul-server" "nameOverride" }}.{{ include "common.namespace" .}}"]
+ name: {{ include "common.name" . }}
volumeMounts:
- mountPath: /consul/config
name: consul-agent-config
@@ -45,13 +48,13 @@ spec:
name: consul-agent-certs-config
volumes:
- configMap:
- name: consul-agent-configmap
+ name: {{ include "common.fullname" . }}-configmap
name: consul-agent-config
- configMap:
- name: consul-agent-scripts-configmap
+ name: {{ include "common.fullname" . }}-scripts-configmap
defaultMode: 0755
name: consul-agent-scripts-config
- secret:
- secretName: consul-agent-certs-secret
+ secretName: {{ include "common.fullname" . }}-certs-secret
name: consul-agent-certs-config
-#{{ end }}
+
diff --git a/kubernetes/consul/templates/secrets.yaml b/kubernetes/consul/templates/secrets.yaml
new file mode 100644
index 0000000000..2535437329
--- /dev/null
+++ b/kubernetes/consul/templates/secrets.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ include "common.fullname" . }}-certs-secret
+ namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/consul-agent-config/certs/*").AsSecrets . | indent 2 }}