Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Service to expose the etcd endpoint for Percona XtraDB Cluster
- apiVersion: v1
- kind: Service
- metadata:
- name: etcd
- spec:
- ports:
- - name: etcd-2379
- port: 2379
- protocol: TCP
- targetPort: 2379
- - name: etcd-4001
- port: 4001
- protocol: TCP
- targetPort: 4001
- - name: etcd-7001
- port: 7001
- protocol: TCP
- targetPort: 7001
- selector:
- app: etcd
- ---
- # Endpoint for connecting external etcd clients. Delete this if not required
- apiVersion: v1
- kind: Service
- metadata:
- name: etcd-client
- labels:
- name: etcd-client
- spec:
- type: NodePort
- ports:
- - port: 2379
- name: client
- targetPort: 2379
- protocol: TCP
- selector:
- app: etcd
- ---
- apiVersion: v1
- kind: Pod
- metadata:
- labels:
- app: etcd
- etcd_node: etcd-0
- name: etcd-0
- spec:
- containers:
- - command:
- - /usr/local/bin/etcd
- - --name
- - etcd-0
- - --initial-advertise-peer-urls
- - http://etcd-0:2380
- - --listen-peer-urls
- - http://0.0.0.0:2380
- - --listen-client-urls
- - http://0.0.0.0:2379
- - --advertise-client-urls
- - http://etcd-0:2379
- - --initial-cluster
- - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
- - --initial-cluster-state
- - new
- image: quay.io/coreos/etcd:latest
- name: etcd-0
- ports:
- - containerPort: 2379
- name: client
- protocol: TCP
- - containerPort: 2380
- name: server
- protocol: TCP
- - containerPort: 4001
- protocol: TCP
- - containerPort: 7001
- protocol: TCP
- restartPolicy: Never
- nodeSelector:
- name: node-1
- ---
- apiVersion: v1
- kind: Service
- metadata:
- labels:
- etcd_node: etcd-0
- name: etcd-0
- spec:
- ports:
- - name: client
- port: 2379
- protocol: TCP
- targetPort: 2379
- - name: server
- port: 2380
- protocol: TCP
- targetPort: 2380
- - name: etcd-4001
- port: 4001
- protocol: TCP
- targetPort: 4001
- - name: etcd-7001
- port: 7001
- protocol: TCP
- targetPort: 7001
- selector:
- etcd_node: etcd-0
- ---
- apiVersion: v1
- kind: Pod
- metadata:
- labels:
- app: etcd
- etcd_node: etcd-1
- name: etcd-1
- spec:
- containers:
- - command:
- - /usr/local/bin/etcd
- - --name
- - etcd-1
- - --initial-advertise-peer-urls
- - http://etcd-1:2380
- - --listen-peer-urls
- - http://0.0.0.0:2380
- - --listen-client-urls
- - http://0.0.0.0:2379
- - --advertise-client-urls
- - http://etcd-1:2379
- - --initial-cluster
- - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
- - --initial-cluster-state
- - new
- image: quay.io/coreos/etcd:latest
- name: etcd-1
- ports:
- - containerPort: 2379
- name: client
- protocol: TCP
- - containerPort: 2380
- name: server
- protocol: TCP
- - containerPort: 4001
- protocol: TCP
- - containerPort: 7001
- protocol: TCP
- restartPolicy: Never
- nodeSelector:
- name: node-2
- ---
- apiVersion: v1
- kind: Service
- metadata:
- labels:
- etcd_node: etcd-1
- name: etcd-1
- spec:
- ports:
- - name: client
- port: 2379
- protocol: TCP
- targetPort: 2379
- - name: server
- port: 2380
- protocol: TCP
- targetPort: 2380
- - name: etcd-4001
- port: 4001
- protocol: TCP
- targetPort: 4001
- - name: etcd-7001
- port: 7001
- protocol: TCP
- targetPort: 7001
- selector:
- etcd_node: etcd-1
- ---
- apiVersion: v1
- kind: Pod
- metadata:
- labels:
- app: etcd
- etcd_node: etcd-2
- name: etcd-2
- spec:
- containers:
- - command:
- - /usr/local/bin/etcd
- - --name
- - etcd-2
- - --initial-advertise-peer-urls
- - http://etcd-2:2380
- - --listen-peer-urls
- - http://0.0.0.0:2380
- - --listen-client-urls
- - http://0.0.0.0:2379
- - --advertise-client-urls
- - http://etcd-2:2379
- - --initial-cluster
- - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
- - --initial-cluster-state
- - new
- image: quay.io/coreos/etcd:latest
- name: etcd-2
- ports:
- - containerPort: 2379
- name: client
- protocol: TCP
- - containerPort: 2380
- name: server
- protocol: TCP
- - containerPort: 4001
- protocol: TCP
- - containerPort: 7001
- protocol: TCP
- restartPolicy: Never
- nodeSelector:
- name: node-3
- ---
- apiVersion: v1
- kind: Service
- metadata:
- labels:
- etcd_node: etcd-2
- name: etcd-2
- spec:
- ports:
- - name: client
- port: 2379
- protocol: TCP
- targetPort: 2379
- - name: server
- port: 2380
- protocol: TCP
- targetPort: 2380
- - name: etcd-4001
- port: 4001
- protocol: TCP
- targetPort: 4001
- - name: etcd-7001
- port: 7001
- protocol: TCP
- targetPort: 7001
- selector:
- etcd_node: etcd-2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement