-
-
Notifications
You must be signed in to change notification settings - Fork 4
Router Configuration
When you install Routernetes, a default Router is installed, you can see it by doing:
sudo kubectl describe -n routernetes router default-router
If you want to modify the Router configuration, you can either edit the default-router
object, or you can delete it and create your own Router (as shown below). You can only have 1 Router installed at a time.
To edit the default router:
sudo kubectl edit -n routernetes router default-router
WARNING (deleting the default router):
- If you delete the Router object, this will disable the firewall. Therefore the SSH port on your machine will be exposed to the Internet until your create a new Router object.
- Deleting the Router object will also disable the DHCP server, therefore, you might need to set a static IP to regain access to the system if your DHCP address is released.
sudo kubectl apply -f router.yaml
https://github.com/routernetes/routernetes-operator/blob/main/config/samples/_v1alpha1_router.yaml
The above example denies all incoming traffic to the outside (Internet) interface. You can allow certain services through the firewall, for example:
firewall:
outside:
services:
- ssh
You can see a list of possible services here: https://github.com/firewalld/firewalld/tree/master/config/services
You can also configure interface bridges (like a built-in network switch). An example is shown below
interfaces:
- name: br0
type: bridge
members:
- enp0s20u1
- enp0s20u2
ipv4:
method: manual
address: 192.168.64.1/24
Not every item in spec
needs to be specified, you can see the docs for the Router specification here. That document shows the default values, as well as whether a field is required or not.
sudo kubectl describe -n routernetes router my-router
You'll see a Status section that looks something like this:
Status:
Conditions:
Last Transition Time: 2022-06-15T02:39:10Z
Message:
Reason:
Status: False
Type: Failure
Ansible Result:
Changed: 0
Completion: 2022-06-15T12:39:21.755493
Failures: 0
Ok: 6
Skipped: 0
Last Transition Time: 2022-06-15T02:38:55Z
Message: Awaiting next reconciliation
Reason: Successful
Status: True
Type: Running
Last Transition Time: 2022-06-15T12:39:22Z
Message: Last reconciliation succeeded
Reason: Successful
Status: True
Type: Successful
If you just want to see whether the deployment was successful, you can run:
sudo kubectl get -n routernetes router my-router -o jsonpath='{.status.conditions[?(@.type=="Successful")].status}{"\n"}'
Which should output True
if the Router deployment succeeded.