agent-compose.yaml
1.53 KB
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
62
63
64
65
66
67
version: '3.4'
x-extra-hosts: &_x_extra_hosts
extra_hosts:
- "${APP_REGISTRY_NAME}:${APP_REGISTRY_ADDRESS}"
x-root-cert-volume: &_x-root-cert-volume
type: bind
source: ${CONTEXT_DIR}/certs/root.crt
target: /etc/ssl/certs/root.crt
read_only: true
bind:
create_host_path: false
x-kubelet-volume: &_x-kubelet-volume
type: volume
target: /var/lib/kubelet
# volume:
# propagation: shared
x-k3s-agent-env: &_x-k3s-agent-env
K3S_URL: https://k3s-master:6443
K3S_TOKEN_FILE: /var/lib/rancher/k3s/server/node-token
K3S_NODE_NAME: k3s-agent
VIRTUAL_HOST: ${VHOST_STUB},*${VHOST_SUFFIX}${APP_EXTRA_VHOSTS}
VIRTUAL_PROTO: https
VIRTUAL_PORT: "443"
SELF_SIGNED_HOST: ${VHOST_STUB},*${VHOST_SUFFIX}${APP_EXTRA_VHOSTS}
HTTPS_METHOD: noredirect
x-k3s-agent-base: &_x-k3s-agent-base
<<: *_x_extra_hosts
image: "docker.io/rancher/k3s:${K3S_VERSION:-latest}"
tmpfs:
- /run
- /var/run
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${APP_ROOT_DIR?Please set APP_ROOT_DIR}:${APP_ROOT_MOUNT?Please specify where to mount $PWD}
- *_x-root-cert-volume
- *_x-kubelet-volume
- server:/var/lib/rancher/k3s/server:ro
- local-path-provisioner:/opt/local-path-provisioner
privileged: true
restart: always
networks:
default:
nginx:
ports:
- 443
environment:
<<: *_x-k3s-agent-env
services:
k3s-agent-1:
<<: *_x-k3s-agent-base
command: [
"agent",
]
environment:
<<: *_x-k3s-agent-env
K3S_NODE_NAME: agent-1