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