Rate This Document
Findability
Accuracy
Completeness
Readability

Default Subnet

Kube-OVN organizes IP addresses by subnet. Each namespace can belong to different subnets. Pods under a namespace automatically obtain IP addresses from the corresponding subnet and share the network configuration (such as the CIDR, gateway type, access control, and NAT control) of the subnet.

Kube-OVN has a built-in default subnet. IP addresses are automatically allocated from the default subnet to all the namespaces without explicit declaration of subnet belonging, and the namespaces use the network configuration of the default subnet. The default subnet uses a distributed gateway and performs network address translation (NAT) on the outbound traffic. The behavior is the same as the default behavior of Flannel. Users can use most network functions without additional configurations.

You can change the configuration of the default subnet during the installation. For details, see Configuring the Built-in Subnets.

Run the following command to view the default subnet:

1
kubectl get subnet ovn-default -o yaml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
apiVersion: kubeovn.io/v1
kind: Subnet
metadata:
  creationTimestamp: "2020-06-28T06:42:32Z"
  finalizers:
  - kube-ovn-controller
  generation: 1
  name: ovn-default
  resourceVersion: "750199"
  selfLink: /apis/kubeovn.io/v1/subnets/ovn-default
  uid: e3a9162e-ad11-4bd0-9962-db6d6d26b01e
spec:
  cidrBlock: 10.16.0.0/16
  default: true
  excludeIps:
  - 10.16.0.1
  gateway: 10.16.0.1
  gatewayNode: ""
  gatewayType: distributed
  natOutgoing: true
  private: false
  protocol: IPv4
  provider: ovn
  underlayGateway: false
status:
  activateGateway: ""
  availableIPs: 65517
  conditions:
  - lastTransitionTime: "2020-06-28T06:42:32Z"
    lastUpdateTime: "2020-06-28T06:42:33Z"
    reason: ResetLogicalSwitchAclSuccess
    status: "True"
    type: Validated
  - lastTransitionTime: "2020-06-28T06:42:33Z"
    lastUpdateTime: "2020-06-28T06:42:33Z"
    reason: ResetLogicalSwitchAclSuccess
    status: "True"
    type: Ready
  - lastTransitionTime: "2020-06-28T06:42:32Z"
    lastUpdateTime: "2020-06-28T06:42:32Z"
    message: Not Observed
    reason: Init
    status: Unknown
    type: Error
  usingIPs: 16