-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
executable file
·61 lines (57 loc) · 2.08 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: '2'
# docker-machine create -d vmwarefusion --vmwarefusion-cpu-count=2 --vmwarefusion-disk-size=40000 --vmwarefusion-memory-size=2048 k8
# eval $(docker-machine env k8)
# KUBECONFIG=$(pwd)/data/kubeconfig kubectl get nodes
services:
# each additional type of node type can simply extend this (see master node)
node:
build:
context: ./k8s-node
working_dir: /data
tty: true
privileged: true
security_opt:
- seccomp=unconfined
environment:
- HYPERKUBE_IMAGE_TAG=v1.9.1
volumes:
# for setting up bootkube's auto host kubeconfig and getting container info
- /var/run/docker.sock:/mnt/HOST_DOCKER.sock
# systemd needs read-only access to the kernel's cgroup hierarchies
- /sys/fs/cgroup:/sys/fs/cgroup:ro
# for sharing data between containers
- mnt-share-data:/mnt/share/data:rw
# outside data dir access
- ./data:/data
master:
extends:
service: node
environment:
- K8S_MASTER_NODE=1
- BOOTKUBE_IMAGE_TAG=v0.9.1
ports:
- 6443:6443
# kubernetes NodePort service range is 30000-32767
# https://kubernetes.io/docs/concepts/services-networking/service/
# however, allocating that many ports will cause issues when starting & stopping the master node, so to
# avoid that we allocate 32 ports in the range of 30000-30032, please explicitly define `nodePort` in services
# to expose those services
- "30000-30032:30000-30032"
- "30000-30032:30000-30032/udp"
# running instance of etcd because etcd operator has issues with durability
# @see https://github.com/coreos/etcd-operator/issues/1323
etcd1:
image: quay.io/coreos/etcd:v3.2.8
environment:
ETCD_NAME: infra1
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd1:2380
ETCD_INITIAL_CLUSTER: infra1=http://etcd1:2380
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
ETCD_DATA_DIR: /data
volumes:
- etcd-data:/data
volumes:
mnt-share-data:
etcd-data: