tuto3: define machine hostnames
This commit is contained in:
parent
dc0b0b354d
commit
c880529034
1 changed files with 50 additions and 0 deletions
50
tuto3.yml
50
tuto3.yml
|
@ -42,26 +42,39 @@ onboot:
|
||||||
services:
|
services:
|
||||||
- name: dhcpcd-wks1
|
- name: dhcpcd-wks1
|
||||||
image: linuxkit/dhcpcd:v0.7
|
image: linuxkit/dhcpcd:v0.7
|
||||||
|
hostname: wks1
|
||||||
net: new
|
net: new
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
runtime:
|
runtime:
|
||||||
interfaces:
|
interfaces:
|
||||||
- name: eth1
|
- name: eth1
|
||||||
- name: ethwks1
|
- name: ethwks1
|
||||||
bindNS:
|
bindNS:
|
||||||
net: /run/netns/wks1
|
net: /run/netns/wks1
|
||||||
|
uts: /run/utsns/wks1
|
||||||
|
|
||||||
- name: dhcpcd-wks2
|
- name: dhcpcd-wks2
|
||||||
image: linuxkit/dhcpcd:v0.7
|
image: linuxkit/dhcpcd:v0.7
|
||||||
|
hostname: wks2
|
||||||
net: new
|
net: new
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
runtime:
|
runtime:
|
||||||
interfaces:
|
interfaces:
|
||||||
- name: ethwks2
|
- name: ethwks2
|
||||||
bindNS:
|
bindNS:
|
||||||
net: /run/netns/wks2
|
net: /run/netns/wks2
|
||||||
|
uts: /run/utsns/wks2
|
||||||
|
|
||||||
- name: sshd-wks1
|
- name: sshd-wks1
|
||||||
image: linuxkit/sshd:v0.7
|
image: linuxkit/sshd:v0.7
|
||||||
net: /run/netns/wks1
|
net: /run/netns/wks1
|
||||||
|
uts: /run/utsns/wks1
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
binds:
|
binds:
|
||||||
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
|
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
|
||||||
- /etc/wpasswd:/etc/passwd
|
- /etc/wpasswd:/etc/passwd
|
||||||
|
@ -70,6 +83,9 @@ services:
|
||||||
- name: sshd-wks2
|
- name: sshd-wks2
|
||||||
image: linuxkit/sshd:v0.7
|
image: linuxkit/sshd:v0.7
|
||||||
net: /run/netns/wks2
|
net: /run/netns/wks2
|
||||||
|
uts: /run/utsns/wks2
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
binds:
|
binds:
|
||||||
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
|
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
|
||||||
- /etc/wpasswd:/etc/passwd
|
- /etc/wpasswd:/etc/passwd
|
||||||
|
@ -78,6 +94,10 @@ services:
|
||||||
- name: mainrouter
|
- name: mainrouter
|
||||||
image: nemunaire/adlin-tuto3:a8593e91cb830dede2ad25a205ef47141a5a3c22
|
image: nemunaire/adlin-tuto3:a8593e91cb830dede2ad25a205ef47141a5a3c22
|
||||||
net: /run/netns/router
|
net: /run/netns/router
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
|
hostname: router
|
||||||
command: ["/sbin/init"]
|
command: ["/sbin/init"]
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
|
@ -85,10 +105,15 @@ services:
|
||||||
- type: cgroup
|
- type: cgroup
|
||||||
options: ["rw","nosuid","noexec","nodev","relatime"]
|
options: ["rw","nosuid","noexec","nodev","relatime"]
|
||||||
binds:
|
binds:
|
||||||
|
- /etc/hosts:/etc/hosts:ro
|
||||||
- /etc/dresolv.conf:/etc/resolv.conf
|
- /etc/dresolv.conf:/etc/resolv.conf
|
||||||
- name: matrix
|
- name: matrix
|
||||||
image: nemunaire/tinydeb:eaa617bf726fb4cadfa22b3947709579e6001212
|
image: nemunaire/tinydeb:eaa617bf726fb4cadfa22b3947709579e6001212
|
||||||
net: /run/netns/chat
|
net: /run/netns/chat
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
|
hostname: matrixsrv
|
||||||
command: ["/sbin/init"]
|
command: ["/sbin/init"]
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
|
@ -96,10 +121,15 @@ services:
|
||||||
- type: cgroup
|
- type: cgroup
|
||||||
options: ["rw","nosuid","noexec","nodev","relatime"]
|
options: ["rw","nosuid","noexec","nodev","relatime"]
|
||||||
binds:
|
binds:
|
||||||
|
- /etc/hosts:/etc/hosts:ro
|
||||||
- /etc/dresolv.conf:/etc/resolv.conf
|
- /etc/dresolv.conf:/etc/resolv.conf
|
||||||
- name: ns-resolv
|
- name: ns-resolv
|
||||||
image: nemunaire/unbound:ed3ccbb5340aefd48c53a97743fdc6edc7011103
|
image: nemunaire/unbound:ed3ccbb5340aefd48c53a97743fdc6edc7011103
|
||||||
net: /run/netns/ns
|
net: /run/netns/ns
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
|
hostname: resolvsrv
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
binds:
|
binds:
|
||||||
|
@ -108,6 +138,10 @@ services:
|
||||||
- name: ns-auth
|
- name: ns-auth
|
||||||
image: nemunaire/nsd:8d1277be1eb28748ed7441ac82ac04edbacc3b5d
|
image: nemunaire/nsd:8d1277be1eb28748ed7441ac82ac04edbacc3b5d
|
||||||
net: /run/netns/ns-auth
|
net: /run/netns/ns-auth
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
|
hostname: nsauthsrv
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
mounts:
|
mounts:
|
||||||
|
@ -119,6 +153,7 @@ services:
|
||||||
- /etc/nsd:/etc/nsd.sample:ro
|
- /etc/nsd:/etc/nsd.sample:ro
|
||||||
- /etc/network:/etc/network:ro
|
- /etc/network:/etc/network:ro
|
||||||
- /etc/services:/etc/services:ro
|
- /etc/services:/etc/services:ro
|
||||||
|
- /etc/dresolv.conf:/etc/resolv.conf
|
||||||
runtime:
|
runtime:
|
||||||
mkdir:
|
mkdir:
|
||||||
- /var/lib/adlin/nsd
|
- /var/lib/adlin/nsd
|
||||||
|
@ -126,6 +161,10 @@ services:
|
||||||
- name: db
|
- name: db
|
||||||
image: postgres:alpine
|
image: postgres:alpine
|
||||||
net: /run/netns/db
|
net: /run/netns/db
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
uts: new
|
||||||
|
hostname: db
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
env:
|
env:
|
||||||
|
@ -156,6 +195,10 @@ services:
|
||||||
- name: miniflux
|
- name: miniflux
|
||||||
image: miniflux/miniflux:latest
|
image: miniflux/miniflux:latest
|
||||||
net: /run/netns/ttrss
|
net: /run/netns/ttrss
|
||||||
|
uts: new
|
||||||
|
pid: new
|
||||||
|
ipc: new
|
||||||
|
hostname: miniflux
|
||||||
capabilities:
|
capabilities:
|
||||||
- all
|
- all
|
||||||
command: ["/bin/sh", "-c", "sleep 5; /usr/bin/miniflux"]
|
command: ["/bin/sh", "-c", "sleep 5; /usr/bin/miniflux"]
|
||||||
|
@ -168,6 +211,7 @@ services:
|
||||||
- LISTEN_ADDR=0.0.0.0:8080
|
- LISTEN_ADDR=0.0.0.0:8080
|
||||||
binds:
|
binds:
|
||||||
- /etc/hosts:/etc/hosts:ro
|
- /etc/hosts:/etc/hosts:ro
|
||||||
|
- /etc/dresolv.conf:/etc/resolv.conf
|
||||||
- /etc/services:/etc/services:ro
|
- /etc/services:/etc/services:ro
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
@ -175,7 +219,12 @@ files:
|
||||||
contents: |
|
contents: |
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
::1 localhost
|
::1 localhost
|
||||||
|
172.23.42.2 ns
|
||||||
|
172.23.42.3 ns-auth
|
||||||
172.23.42.4 db
|
172.23.42.4 db
|
||||||
|
172.23.42.5 matrix
|
||||||
|
172.23.42.6 news
|
||||||
|
172.23.42.7 web
|
||||||
mode: "0444"
|
mode: "0444"
|
||||||
|
|
||||||
- path: usr/bin/ask.sh
|
- path: usr/bin/ask.sh
|
||||||
|
@ -259,6 +308,7 @@ files:
|
||||||
ip netns add ns-auth
|
ip netns add ns-auth
|
||||||
ip link add vethin-nsauth type veth peer name veth-nsauth
|
ip link add vethin-nsauth type veth peer name veth-nsauth
|
||||||
ip link set vethin-nsauth netns ns-auth
|
ip link set vethin-nsauth netns ns-auth
|
||||||
|
ip netns exec ns-auth ip link set lo up
|
||||||
ip netns exec ns-auth ip link set vethin-nsauth up
|
ip netns exec ns-auth ip link set vethin-nsauth up
|
||||||
ip netns exec ns-auth ip a add 172.23.42.3/24 dev vethin-nsauth
|
ip netns exec ns-auth ip a add 172.23.42.3/24 dev vethin-nsauth
|
||||||
ip netns exec ns-auth ip route add default via 172.23.42.1
|
ip netns exec ns-auth ip route add default via 172.23.42.1
|
||||||
|
|
Reference in a new issue