Skip to content

Instantly share code, notes, and snippets.

@akscram
Last active November 21, 2016 20:21
Show Gist options
  • Save akscram/60a01da59e9d519c74dc45618c672393 to your computer and use it in GitHub Desktop.
Save akscram/60a01da59e9d519c74dc45618c672393 to your computer and use it in GitHub Desktop.
The simple definition of a service and a deployment with one instance of etcd.
---
apiVersion: v1
kind: Service
metadata:
name: etcd
labels:
app: etcd
spec:
ports:
- name: client
port: 2379
- name: server
port: 2380
selector:
app: etcd
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: etcd
name: etcd
spec:
replicas: 1
template:
metadata:
labels:
app: etcd
spec:
containers:
- name: etcd
command:
- /usr/local/bin/etcd
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://$(POD_IP):2379
image: quay.io/coreos/etcd:v3.0.6
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment