Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | # 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 Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 14 | apiVersion: v1 |
| 15 | kind: Service |
| 16 | metadata: |
| 17 | name: consul |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 18 | namespace: voltha |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 19 | labels: |
| 20 | name: consul |
| 21 | spec: |
Richard Jankowski | c3c291c | 2018-02-02 13:57:33 -0500 | [diff] [blame] | 22 | type: ClusterIP |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 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 | --- |
| 59 | apiVersion: apps/v1beta1 |
| 60 | kind: StatefulSet |
| 61 | metadata: |
| 62 | name: consul |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 63 | namespace: voltha |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 64 | spec: |
| 65 | serviceName: consul |
| 66 | replicas: 3 |
Stephane Barbarie | bcea2f4 | 2018-03-02 18:46:32 -0500 | [diff] [blame] | 67 | updateStrategy: |
| 68 | type: RollingUpdate |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 69 | template: |
| 70 | metadata: |
| 71 | labels: |
| 72 | app: consul |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 73 | annotations: |
Stephane Barbarie | 2d4e07f | 2018-03-26 16:46:45 -0400 | [diff] [blame] | 74 | cni: "calico" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 75 | spec: |
| 76 | affinity: |
| 77 | podAntiAffinity: |
| 78 | requiredDuringSchedulingIgnoredDuringExecution: |
| 79 | - labelSelector: |
| 80 | matchExpressions: |
| 81 | - key: app |
| 82 | operator: In |
| 83 | values: |
| 84 | - consul |
| 85 | topologyKey: kubernetes.io/hostname |
| 86 | terminationGracePeriodSeconds: 10 |
| 87 | containers: |
| 88 | - name: consul |
| 89 | image: "consul:0.9.2" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 90 | volumeMounts: |
| 91 | - name: consul-config |
| 92 | mountPath: /consul/config |
| 93 | - name: consul-data |
| 94 | mountPath: /consul/data |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 95 | env: |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 96 | - name: NAMESPACE |
| 97 | valueFrom: |
| 98 | fieldRef: |
| 99 | fieldPath: metadata.namespace |
| 100 | args: |
| 101 | - "agent" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 102 | - "-server" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 103 | - "-bootstrap-expect=3" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 104 | - "-config-dir=/consul/config" |
| 105 | - "-data-dir=/consul/data" |
| 106 | - "-bind=0.0.0.0" |
| 107 | - "-client=0.0.0.0" |
| 108 | - "-ui" |
| 109 | - "-raft-protocol=3" |
| 110 | - "-rejoin" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 111 | - "-retry-join=consul-0.consul.$(NAMESPACE).svc.cluster.local" |
| 112 | - "-retry-join=consul-1.consul.$(NAMESPACE).svc.cluster.local" |
| 113 | - "-retry-join=consul-2.consul.$(NAMESPACE).svc.cluster.local" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 114 | lifecycle: |
| 115 | preStop: |
| 116 | exec: |
| 117 | command: |
| 118 | - /bin/sh |
| 119 | - -c |
| 120 | - consul leave |
| 121 | ports: |
| 122 | - containerPort: 8500 |
| 123 | name: ui-port |
| 124 | - containerPort: 8400 |
| 125 | name: alt-port |
| 126 | - containerPort: 53 |
| 127 | name: udp-port |
| 128 | - containerPort: 8443 |
| 129 | name: https-port |
| 130 | - containerPort: 8080 |
| 131 | name: http-port |
| 132 | - containerPort: 8301 |
| 133 | name: serflan |
| 134 | - containerPort: 8302 |
| 135 | name: serfwan |
| 136 | - containerPort: 8600 |
| 137 | name: consuldns |
| 138 | - containerPort: 8300 |
| 139 | name: server |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 140 | volumes: |
| 141 | - name: consul-config |
| 142 | hostPath: |
| 143 | path: /cord/incubator/voltha/consul/config |
| 144 | type: Directory |
| 145 | - name: consul-data |
| 146 | hostPath: |
| 147 | path: /cord/incubator/voltha/consul/data |
| 148 | type: Directory |