Lab · reference
Lab network
The lab network is one bridge on the workstation. The workstation routes between the bridge, the kind network and the outside. lab/net.sh makes the network and removes it.
At a glance
Section titled “At a glance”- Bridge
pkbr0- Subnet
10.77.0.0/24- Workstation
10.77.0.1- Cluster VIP
10.77.0.10. The second cluster uses10.77.0.9.- Machines
10.77.0.11and up, one tap for each:pktap1,pktap2, and so on.- Made by
lab/net.sh up, which mise run lab:up calls.- Removed by
lab/net.sh down, which mise run lab:down calls.
Addresses and ports
Section titled “Addresses and ports”| Address | Port | Service | Used by |
|---|---|---|---|
10.77.0.1 |
8441 and up |
Simulated BMCs, HTTPS | The operator |
10.77.0.1 |
30443 |
Media store of the operator, HTTPS | The simulated BMCs |
10.77.0.1 |
5000 |
Image registry, only for mise run lab:pivot | The first Talos cluster |
127.0.0.1 |
8440 |
State endpoint, HTTP | mise run lab:top |
10.77.0.10 |
6443 |
Kubernetes API of the cluster | You, the operator |
10.77.0.<10+n> |
50000 |
Talos API of machine n |
talosctl, the operator |
The BMCs and the media port listen on the bridge address only. They do not answer on the other interfaces of the workstation.
After a pivot, the BMCs get the boot media from the first control plane, at https://<node address>:30443.
Firewall rules
Section titled “Firewall rules”Each rule has the comment pk-metal-lab. lab/net.sh down removes only rules with this comment.
| Table and chain | Rule | Purpose |
|---|---|---|
filter DOCKER-USER |
-i pkbr0 -j ACCEPT |
From the machines to other machines, to kind and to the outside |
filter DOCKER-USER |
-o pkbr0 -j ACCEPT |
To the machines: answers, and the operator to the Talos API |
filter INPUT |
-i pkbr0 -d 10.77.0.1/32 -j ACCEPT |
From the machines to the workstation |
filter INPUT |
-i br-+ -d 10.77.0.1/32 -j ACCEPT |
From kind to the BMCs |
nat POSTROUTING |
-s 10.77.0.0/24 ! -o pkbr0 -j MASQUERADE |
From the machines to the outside |
Without Docker, the forward rules go into the chain FORWARD.
lab/net.sh also does these things:
- It sets
net.ipv4.ip_forward=1if it was off.downsets it back. - With
firewalld, it putspkbr0into the zonetrusted. This is a runtime setting only. - With an
nftablesruleset that drops traffic by policy, it prints thenftcommands that accept the lab traffic.
Check the network
Section titled “Check the network”lab/net.sh status pktap1 pktap2 pktap3bridge pkbr0 10.77.0.1/24tap pktap1tap pktap2tap pktap3forward net.ipv4.ip_forward=1rule filter DOCKER-USER -i pkbr0 -j ACCEPT...A part that is missing has the word MISSING at the end of its line. The exit status is then not zero.
Behind a proxy
Section titled “Behind a proxy”The workstation
Section titled “The workstation”-
Set
HTTPS_PROXY. -
Add the lab network to
NO_PROXY.Terminal window export NO_PROXY="${NO_PROXY:+$NO_PROXY,}10.77.0.0/24,localhost,127.0.0.1,.local"export no_proxy="$NO_PROXY" -
Add the kind network also. This command shows it:
Terminal window docker network inspect kind --format '{{range .IPAM.Config}}{{.Subnet}} {{end}}'
mise run lab:doctor checks NO_PROXY. mise run lab:up gives the proxy settings to the Deployment of the operator.
The Talos machines
Section titled “The Talos machines”The machines do not get the proxy settings of the workstation.
They use the DNS servers and the time settings in the patches list of lab.yaml.
The defaults are the DNS servers 1.1.1.1 and 8.8.8.8.
At a site that blocks these, replace the entries in the patches list:
patches: - inline: | apiVersion: v1alpha1 kind: ResolverConfig nameservers: - address: 192.0.2.53 - inline: | apiVersion: v1alpha1 kind: TimeSyncConfig bootTimeout: 2m0s ntp: servers: - ntp.example.org - inline: | apiVersion: v1alpha1 kind: EnvironmentConfig variables: https_proxy: http://proxy.example.org:3128 no_proxy: 10.77.0.0/24,10.96.0.0/12,10.244.0.0/16,.svc,.cluster.local,localhost,127.0.0.1Environment variables of lab/net.sh
Section titled “Environment variables of lab/net.sh”| Variable | Default | Meaning |
|---|---|---|
PK_LAB_BRIDGE |
pkbr0 |
The bridge name |
PK_LAB_ADDRESS |
10.77.0.1/24 |
The address of the workstation on the bridge. The script supports only /24 and /16. |
PK_LAB_TAP_USER |
The user that starts the lab | The owner of the taps |