Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: Service |
| 3 | metadata: |
| 4 | name: consul |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 5 | namespace: voltha |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 6 | labels: |
| 7 | name: consul |
| 8 | spec: |
Richard Jankowski | c3c291c | 2018-02-02 13:57:33 -0500 | [diff] [blame] | 9 | type: ClusterIP |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 10 | clusterIP: None |
| 11 | ports: |
| 12 | - name: http |
| 13 | port: 8500 |
| 14 | targetPort: 8500 |
| 15 | - name: https |
| 16 | port: 8443 |
| 17 | targetPort: 8443 |
| 18 | - name: rpc |
| 19 | port: 8400 |
| 20 | targetPort: 8400 |
| 21 | - name: serflan-tcp |
| 22 | protocol: "TCP" |
| 23 | port: 8301 |
| 24 | targetPort: 8301 |
| 25 | - name: serflan-udp |
| 26 | protocol: "UDP" |
| 27 | port: 8301 |
| 28 | targetPort: 8301 |
| 29 | - name: serfwan-tcp |
| 30 | protocol: "TCP" |
| 31 | port: 8302 |
| 32 | targetPort: 8302 |
| 33 | - name: serfwan-udp |
| 34 | protocol: "UDP" |
| 35 | port: 8302 |
| 36 | targetPort: 8302 |
| 37 | - name: server |
| 38 | port: 8300 |
| 39 | targetPort: 8300 |
| 40 | - name: consuldns |
| 41 | port: 8600 |
| 42 | targetPort: 8600 |
| 43 | selector: |
| 44 | app: consul |
| 45 | --- |
| 46 | apiVersion: apps/v1beta1 |
| 47 | kind: StatefulSet |
| 48 | metadata: |
| 49 | name: consul |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 50 | namespace: voltha |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 51 | spec: |
| 52 | serviceName: consul |
| 53 | replicas: 3 |
| 54 | template: |
| 55 | metadata: |
| 56 | labels: |
| 57 | app: consul |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 58 | annotations: |
| 59 | cni: "weave" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 60 | spec: |
| 61 | affinity: |
| 62 | podAntiAffinity: |
| 63 | requiredDuringSchedulingIgnoredDuringExecution: |
| 64 | - labelSelector: |
| 65 | matchExpressions: |
| 66 | - key: app |
| 67 | operator: In |
| 68 | values: |
| 69 | - consul |
| 70 | topologyKey: kubernetes.io/hostname |
| 71 | terminationGracePeriodSeconds: 10 |
| 72 | containers: |
| 73 | - name: consul |
| 74 | image: "consul:0.9.2" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 75 | volumeMounts: |
| 76 | - name: consul-config |
| 77 | mountPath: /consul/config |
| 78 | - name: consul-data |
| 79 | mountPath: /consul/data |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 80 | env: |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 81 | - name: NAMESPACE |
| 82 | valueFrom: |
| 83 | fieldRef: |
| 84 | fieldPath: metadata.namespace |
| 85 | args: |
| 86 | - "agent" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 87 | - "-server" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 88 | - "-bootstrap-expect=3" |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 89 | - "-config-dir=/consul/config" |
| 90 | - "-data-dir=/consul/data" |
| 91 | - "-bind=0.0.0.0" |
| 92 | - "-client=0.0.0.0" |
| 93 | - "-ui" |
| 94 | - "-raft-protocol=3" |
| 95 | - "-rejoin" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 96 | - "-retry-join=consul-0.consul.$(NAMESPACE).svc.cluster.local" |
| 97 | - "-retry-join=consul-1.consul.$(NAMESPACE).svc.cluster.local" |
| 98 | - "-retry-join=consul-2.consul.$(NAMESPACE).svc.cluster.local" |
Richard Jankowski | 54f7a86 | 2017-12-20 13:31:10 -0500 | [diff] [blame] | 99 | lifecycle: |
| 100 | preStop: |
| 101 | exec: |
| 102 | command: |
| 103 | - /bin/sh |
| 104 | - -c |
| 105 | - consul leave |
| 106 | ports: |
| 107 | - containerPort: 8500 |
| 108 | name: ui-port |
| 109 | - containerPort: 8400 |
| 110 | name: alt-port |
| 111 | - containerPort: 53 |
| 112 | name: udp-port |
| 113 | - containerPort: 8443 |
| 114 | name: https-port |
| 115 | - containerPort: 8080 |
| 116 | name: http-port |
| 117 | - containerPort: 8301 |
| 118 | name: serflan |
| 119 | - containerPort: 8302 |
| 120 | name: serfwan |
| 121 | - containerPort: 8600 |
| 122 | name: consuldns |
| 123 | - containerPort: 8300 |
| 124 | name: server |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 125 | volumes: |
| 126 | - name: consul-config |
| 127 | hostPath: |
| 128 | path: /cord/incubator/voltha/consul/config |
| 129 | type: Directory |
| 130 | - name: consul-data |
| 131 | hostPath: |
| 132 | path: /cord/incubator/voltha/consul/data |
| 133 | type: Directory |