-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathdocker-compose.yaml
58 lines (58 loc) · 1.65 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
# Use `make up`, not `docker compose up`,
# as this YAML requires ${...} variables to be set.
---
services:
node:
build: .
hostname: ${NODE_NAME}
privileged: true
restart: always
networks:
default:
ipv4_address: ${NODE_IP}
ports:
# <host>:<container>
# etcd (default: 2379)
- ${PORT_ETCD}:${PORT_ETCD}
# kube-apiserver (default: 6443)
- ${PORT_KUBE_APISERVER}:${PORT_KUBE_APISERVER}
# kubelet (default: 10250)
- ${PORT_KUBELET}:${PORT_KUBELET}
# flannel (default: 8472)
- ${PORT_FLANNEL}:${PORT_FLANNEL}/udp
volumes:
- .:/usernetes:ro
- /boot:/boot:ro
- /lib/modules:/lib/modules:ro
- node-var:/var
- node-opt:/opt
- node-etc:/etc
- type: tmpfs
target: /run
- type: tmpfs
target: /tmp
working_dir: /usernetes
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
HOST_IP: ${HOST_IP}
sysctls:
- net.ipv4.ip_forward=1
# In addition, `net.ipv4.conf.default.rp_filter`
# has to be set to 0 (disabled) or 2 (loose)
# in the daemon's network namespace.
annotations:
# Accelerate network for nerdctl >= 2.0.0-beta.4 with bypass4netns >= 0.4.1
"nerdctl/bypass4netns": "${BYPASS4NETNS:-false}"
"nerdctl/bypass4netns-ignore-bind": "true"
"nerdctl/bypass4netns-ignore-subnets": "${BYPASS4NETNS_IGNORE_SUBNETS:-}"
networks:
default:
ipam:
config:
# Each of the nodes has to have a different IP.
# The node IP here is not accessible from other nodes.
- subnet: ${NODE_SUBNET}
volumes:
node-var: {}
node-opt: {}
node-etc: {}