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