summaryrefslogtreecommitdiffstats
path: root/kubernetes/consul
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/consul')
-rw-r--r--kubernetes/consul/Chart.yaml4
-rw-r--r--kubernetes/consul/templates/consul-agent-deployment.yaml29
-rw-r--r--kubernetes/consul/templates/consul-server-deployment.yaml30
-rw-r--r--kubernetes/consul/templates/consul-server-service.yaml22
-rw-r--r--kubernetes/consul/values.yaml7
5 files changed, 92 insertions, 0 deletions
diff --git a/kubernetes/consul/Chart.yaml b/kubernetes/consul/Chart.yaml
new file mode 100644
index 0000000000..318234db06
--- /dev/null
+++ b/kubernetes/consul/Chart.yaml
@@ -0,0 +1,4 @@
+apiVersion: v1
+description: A Helm chart for Consul
+name: consul
+version: 1.1.0
diff --git a/kubernetes/consul/templates/consul-agent-deployment.yaml b/kubernetes/consul/templates/consul-agent-deployment.yaml
new file mode 100644
index 0000000000..15318660b5
--- /dev/null
+++ b/kubernetes/consul/templates/consul-agent-deployment.yaml
@@ -0,0 +1,29 @@
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: consul-agent
+ name: consul-agent
+ namespace: "{{ .Values.nsPrefix }}-consul"
+spec:
+ selector:
+ matchLabels:
+ app: consul-agent
+ template:
+ metadata:
+ labels:
+ app: consul-agent
+ name: consul-agent
+ spec:
+ containers:
+ - image: "{{ .Values.consulimageRegistry }}:{{ .Values.consuldockerTag }}"
+ command: ["/usr/local/bin/docker-entrypoint.sh"]
+ args: ["agent","-client","0.0.0.0","-enable-script-checks","-join","consul-server.{{ .Values.nsPrefix }}-consul"]
+ name: consul-server
+ volumeMounts:
+ - mountPath: /consul/config
+ name: consul-agent-config
+ volumes:
+ - hostPath:
+ path: {{ .Values.rootHostPath }}/{{ .Values.nsPrefix }}/consul/consul-agent-config
+ name: consul-agent-config
diff --git a/kubernetes/consul/templates/consul-server-deployment.yaml b/kubernetes/consul/templates/consul-server-deployment.yaml
new file mode 100644
index 0000000000..3e6dcba865
--- /dev/null
+++ b/kubernetes/consul/templates/consul-server-deployment.yaml
@@ -0,0 +1,30 @@
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ labels:
+ app: consul-server
+ name: consul-server
+ namespace: "{{ .Values.nsPrefix }}-consul"
+spec:
+ replicas: 3
+ selector:
+ matchLabels:
+ app: consul-server
+ template:
+ metadata:
+ labels:
+ app: consul-server
+ name: consul-server
+ spec:
+ containers:
+ - image: "{{ .Values.consulimageRegistry }}:{{ .Values.consuldockerTag }}"
+ 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 }}-consul"]
+ name: consul-server
+ volumeMounts:
+ - mountPath: /consul/config
+ name: consul-server-config
+ volumes:
+ - hostPath:
+ path: {{ .Values.rootHostPath }}/{{ .Values.rootHostPath }}/{{ .Values.nsPrefix }}/consul/consul-server-config
+ name: consul-server-config
diff --git a/kubernetes/consul/templates/consul-server-service.yaml b/kubernetes/consul/templates/consul-server-service.yaml
new file mode 100644
index 0000000000..465456425e
--- /dev/null
+++ b/kubernetes/consul/templates/consul-server-service.yaml
@@ -0,0 +1,22 @@
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: consul-server
+ name: consul-server
+ namespace: "{{ .Values.nsPrefix }}-consul"
+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 }}
diff --git a/kubernetes/consul/values.yaml b/kubernetes/consul/values.yaml
new file mode 100644
index 0000000000..2b713dc278
--- /dev/null
+++ b/kubernetes/consul/values.yaml
@@ -0,0 +1,7 @@
+nsPrefix: "inf"
+nodePortPrefix: 302
+consuldockerTag: "latest"
+rootHostPath: "/dockerdata-nfs"
+consulimageRegistry: "docker.io/consul"
+service:
+ type: NodePort