blob: 7f1629bbd5f3694a3abf038373188eb98ff97d5c [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Richard Jankowskid7921b72018-02-20 16:55:12 -050014apiVersion: v1
15kind: Service
16metadata:
17 name: consul
18 namespace: voltha
19 labels:
20 name: consul
21spec:
22 type: ClusterIP
23 clusterIP: None
24 ports:
25 - name: http
26 port: 8500
27 targetPort: 8500
28 - name: https
29 port: 8443
30 targetPort: 8443
31 - name: rpc
32 port: 8400
33 targetPort: 8400
34 - name: serflan-tcp
35 protocol: "TCP"
36 port: 8301
37 targetPort: 8301
38 - name: serflan-udp
39 protocol: "UDP"
40 port: 8301
41 targetPort: 8301
42 - name: serfwan-tcp
43 protocol: "TCP"
44 port: 8302
45 targetPort: 8302
46 - name: serfwan-udp
47 protocol: "UDP"
48 port: 8302
49 targetPort: 8302
50 - name: server
51 port: 8300
52 targetPort: 8300
53 - name: consuldns
54 port: 8600
55 targetPort: 8600
56 selector:
57 app: consul
58---
59apiVersion: apps/v1beta1
60kind: StatefulSet
61metadata:
62 name: consul
63 namespace: voltha
64spec:
65 serviceName: consul
66 replicas: 1
67 template:
68 metadata:
69 labels:
70 app: consul
71 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -040072 cni: "calico"
Richard Jankowskid7921b72018-02-20 16:55:12 -050073 spec:
74 terminationGracePeriodSeconds: 10
75 containers:
76 - name: consul
77 image: "consul:0.9.2"
78 env:
79 - name: NAMESPACE
80 valueFrom:
81 fieldRef:
82 fieldPath: metadata.namespace
83 args:
84 - "agent"
85 - "-server"
86 - "-bootstrap"
87 - "-config-dir=/consul/config"
88 - "-data-dir=/consul/data"
89 - "-bind=0.0.0.0"
90 - "-client=0.0.0.0"
91 - "-ui"
92 - "-raft-protocol=3"
93 lifecycle:
94 preStop:
95 exec:
96 command:
97 - /bin/sh
98 - -c
99 - consul leave
100 ports:
101 - containerPort: 8500
102 name: ui-port
103 - containerPort: 8400
104 name: alt-port
105 - containerPort: 53
106 name: udp-port
107 - containerPort: 8443
108 name: https-port
109 - containerPort: 8080
110 name: http-port
111 - containerPort: 8301
112 name: serflan
113 - containerPort: 8302
114 name: serfwan
115 - containerPort: 8600
116 name: consuldns
117 - containerPort: 8300
118 name: server
119