Rate This Document
Findability
Accuracy
Completeness
Readability

Customized Subnet

In Kube-OVN, IP addresses are managed by subnet network segment. One or more namespaces can be bound to a subnet. Pods under these namespaces automatically obtain IP addresses from the subnet and share the network configuration (such as CIDR, gateway type, access control, and NAT control) of the subnet.

Run the following command to create a subnet:

1
cat <<EOF | kubectl create -f -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
apiVersion: kubeovn.io/v1
kind: Subnet
metadata:
  name: product
spec:
  protocol: IPv4
  cidrBlock: 10.66.0.0/16
  excludeIps:
  - 10.66.0.1..10.66.0.10
  gateway: 10.66.0.1
  namespaces:
  - product
EOF