Skip to content

Commit

Permalink
Allow ssh over link local addresses into the machines
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Jun 7, 2024
1 parent a0f743c commit de5854d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ _privatenet: env

.PHONY: machine
machine: _privatenet
docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000000 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --networks $(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')
docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000000 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata "@/tmp/ignition.json" --networks $(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')

.PHONY: firewall
firewall: _ips _privatenet
docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000000 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')
docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000000 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata "@/tmp/ignition.json" --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}')

.PHONY: ls
ls: env
Expand Down
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
- METALCTL_API_URL=http://api.172.17.0.1.nip.io:8080/metal
volumes:
- ./files/ssh:/root/.ssh:ro
- ./files/ignition.json:/tmp/ignition.json
network_mode: host
dns:
- 172.17.0.1
Expand Down
25 changes: 25 additions & 0 deletions files/ignition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"ignition": {
"config": {},
"security": {},
"timeouts": {},
"version": "2.3.0"
},
"networkd": {},
"passwd": {},
"storage": {
"files": [
{
"filesystem": "root",
"path": "/etc/hosts.allow",
"append": true,
"contents": {
"source": "data:,ALL%3A%20%5Bfe80%3A%3A%5D%2F10%0D%0A",
"verification": {}
},
"mode": 644
}
]
},
"systemd": {}
}

0 comments on commit de5854d

Please sign in to comment.