Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: Service |
| 3 | metadata: |
| 4 | name: zoo1 |
| 5 | spec: |
| 6 | clusterIP: None |
| 7 | selector: |
| 8 | app: zookeeper-1 |
| 9 | ports: |
| 10 | - name: client |
| 11 | port: 2181 |
| 12 | targetPort: 2181 |
| 13 | - name: follower |
| 14 | port: 2888 |
| 15 | targetPort: 2888 |
| 16 | - name: leader |
| 17 | port: 3888 |
| 18 | targetPort: 3888 |
| 19 | --- |
| 20 | apiVersion: v1 |
| 21 | kind: Service |
| 22 | metadata: |
| 23 | name: zoo2 |
| 24 | spec: |
| 25 | clusterIP: None |
| 26 | selector: |
| 27 | app: zookeeper-2 |
| 28 | ports: |
| 29 | - name: client |
| 30 | port: 2181 |
| 31 | targetPort: 2181 |
| 32 | - name: follower |
| 33 | port: 2888 |
| 34 | targetPort: 2888 |
| 35 | - name: leader |
| 36 | port: 3888 |
| 37 | targetPort: 3888 |
| 38 | --- |
| 39 | apiVersion: v1 |
| 40 | kind: Service |
| 41 | metadata: |
| 42 | name: zoo3 |
| 43 | spec: |
| 44 | clusterIP: None |
| 45 | selector: |
| 46 | app: zookeeper-3 |
| 47 | ports: |
| 48 | - name: client |
| 49 | port: 2181 |
| 50 | targetPort: 2181 |
| 51 | - name: follower |
| 52 | port: 2888 |
| 53 | targetPort: 2888 |
| 54 | - name: leader |
| 55 | port: 3888 |
| 56 | targetPort: 3888 |
| 57 | --- |
| 58 | apiVersion: apps/v1beta1 |
| 59 | kind: StatefulSet |
| 60 | metadata: |
| 61 | name: zookeeper1 |
| 62 | spec: |
| 63 | serviceName: zoo1 |
| 64 | replicas: 1 |
| 65 | selector: |
| 66 | matchLabels: |
| 67 | app: zookeeper-1 |
| 68 | template: |
| 69 | metadata: |
| 70 | labels: |
| 71 | app: zookeeper-1 |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 72 | annotations: |
| 73 | cni: "weave" |
Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 74 | spec: |
| 75 | containers: |
| 76 | - name: zoo1 |
| 77 | image: zookeeper:3.4.11 |
| 78 | ports: |
| 79 | - containerPort: 2181 |
| 80 | - containerPort: 2888 |
| 81 | - containerPort: 3888 |
| 82 | env: |
| 83 | - name: NAMESPACE |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: metadata.namespace |
| 87 | - name: ZOO_MY_ID |
| 88 | value: "1" |
| 89 | - name: ZOO_SERVERS |
| 90 | value: > |
| 91 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 92 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 93 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 94 | --- |
| 95 | apiVersion: apps/v1beta1 |
| 96 | kind: StatefulSet |
| 97 | metadata: |
| 98 | name: zookeeper2 |
| 99 | spec: |
| 100 | serviceName: zoo2 |
| 101 | replicas: 1 |
| 102 | selector: |
| 103 | matchLabels: |
| 104 | app: zookeeper-2 |
| 105 | template: |
| 106 | metadata: |
| 107 | labels: |
| 108 | app: zookeeper-2 |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 109 | annotations: |
| 110 | cni: "weave" |
Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 111 | spec: |
| 112 | containers: |
| 113 | - name: zoo2 |
| 114 | image: zookeeper:3.4.11 |
| 115 | ports: |
| 116 | - containerPort: 2181 |
| 117 | - containerPort: 2888 |
| 118 | - containerPort: 3888 |
| 119 | env: |
| 120 | - name: NAMESPACE |
| 121 | valueFrom: |
| 122 | fieldRef: |
| 123 | fieldPath: metadata.namespace |
| 124 | - name: ZOO_MY_ID |
| 125 | value: "2" |
| 126 | - name: ZOO_SERVERS |
| 127 | value: > |
| 128 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 129 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 130 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 131 | --- |
| 132 | apiVersion: apps/v1beta1 |
| 133 | kind: StatefulSet |
| 134 | metadata: |
| 135 | name: zookeeper3 |
| 136 | spec: |
| 137 | serviceName: zoo3 |
| 138 | replicas: 1 |
| 139 | selector: |
| 140 | matchLabels: |
| 141 | app: zookeeper-3 |
| 142 | template: |
| 143 | metadata: |
| 144 | labels: |
| 145 | app: zookeeper-3 |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 146 | annotations: |
| 147 | cni: "weave" |
Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 148 | spec: |
| 149 | containers: |
| 150 | - name: zoo3 |
| 151 | image: zookeeper:3.4.11 |
| 152 | ports: |
| 153 | - containerPort: 2181 |
| 154 | - containerPort: 2888 |
| 155 | - containerPort: 3888 |
| 156 | env: |
| 157 | - name: NAMESPACE |
| 158 | valueFrom: |
| 159 | fieldRef: |
| 160 | fieldPath: metadata.namespace |
| 161 | - name: ZOO_MY_ID |
| 162 | value: "3" |
| 163 | - name: ZOO_SERVERS |
| 164 | value: > |
| 165 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 166 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 167 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |