Skip to content

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.

Bridge
pkbr0
Subnet
10.77.0.0/24
Workstation
10.77.0.1
Cluster VIP
10.77.0.10. The second cluster uses 10.77.0.9.
Machines
10.77.0.11 and 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.
The kind node, the virtual machines and the uplink connect through the routing of the workstation. The virtual machines are on the bridge pkbr0 through taps.Workstationkind nodeDocker networkUplinkNAT to the outsidepkbr010.77.0.1/24node-110.77.0.11 · pktap1node-210.77.0.12 · pktap2node-310.77.0.13 · pktap3routingmasqueradetaps
The three parties of the lab network. The workstation routes between them.
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.

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=1 if it was off. down sets it back.
  • With firewalld, it puts pkbr0 into the zone trusted. This is a runtime setting only.
  • With an nftables ruleset that drops traffic by policy, it prints the nft commands that accept the lab traffic.
Terminal window
lab/net.sh status pktap1 pktap2 pktap3
Terminal window
bridge pkbr0 10.77.0.1/24
tap pktap1
tap pktap2
tap pktap3
forward net.ipv4.ip_forward=1
rule 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.

  1. Set HTTPS_PROXY.

  2. 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"
  3. 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 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.1
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