Created
December 9, 2015 19:56
-
-
Save tmc/0ebde9167dcd16a78296 to your computer and use it in GitHub Desktop.
etcd discovery based controller (would need services/name-resolution for each pod)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: "ReplicationController" | |
apiVersion: "v1" | |
metadata: | |
name: "etcd" | |
spec: | |
replicas: 3 | |
selector: | |
name: etcd | |
template: | |
metadata: | |
labels: | |
name: etcd | |
spec: | |
containers: | |
- name: etcd | |
image: base/k8s-etcd | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 2379 | |
- containerPort: 2380 | |
env: | |
- name: ETCD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: ETCD_DISCOVERY | |
value: https://discovery.etcd.io/${YOUR_DISCOVERY_TOKEN} | |
- name: ETCD_DATA_DIR | |
value: "/var/lib/etcd" | |
- name: POD_IP | |
valueFrom: | |
fieldRef: | |
fieldPath: status.podIP | |
volumeMounts: | |
- name: etcd | |
mountPath: "/var/lib/etcd" | |
- name: etcssl | |
mountPath: "/etc/ssl" | |
readOnly: true | |
volumes: | |
- name: etcd | |
emptyDir: | |
- name: etcssl | |
hostPath: | |
path: "/etc/ssl" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: "Service" | |
apiVersion: "v1" | |
metadata: | |
name: "etcd" | |
spec: | |
ports: | |
- name: client | |
port: 2379 | |
- name: server | |
port: 2380 | |
- name: client80 | |
port: 80 | |
targetPort: 2379 | |
selector: | |
name: "etcd" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment