liveBook · Manning

Network interface

As explained in Google Anthos in Action

A network interface is a software or hardware connection through which a computing workload sends and receives network traffic.

A network interface is a software or hardware connection through which a workload sends and receives network traffic. In Anthos on bare metal, Pods can use multiple interfaces when containerized network functions need to separate data-plane traffic from management or control-plane traffic, improve performance, or isolate network flows. section 8.3.2

The default Kubernetes interface appears as eth0. Additional Multus CNI interfaces appear as net1, net2, and later interfaces, and can use IPvlan, MacVLAN, Bridge, or SR-IOV. section 8.3.2

Configure additional Pod interfaces in three steps:

  • Enable multi-NIC by setting multipleNetworkInterfaces to true in the clusterNetwork section of the Anthos bare metal cluster custom resource. section 8.3.2
  • Define available networks with NetworkAttachmentDefinition custom resources, either during cluster creation or on an existing target cluster. section 8.3.2
  • Assign networks to Pods or Deployments with the k8s.v1.cni.cncf.io/networks annotation. section 8.3.2
...
clusterNetwork:
 multipleNetworkInterfaces: true
 pods:
  cidrBlocks:
  - 192.168.0.0/16
 services:
  cidrBlocks:
  - 10.96.0.0/12
...

Shows the cluster configuration field that enables multiple network interfaces for Pods. section 8.3.2

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: gke-network-1
spec:
config: ‘{
"type": "ipvlan",
"master": “ens224”,
“mode”: “l2”,
"ipam": {
 "type": "whereabouts",
 "range": "172.120.0.0/24"
}
}’

Shows a NetworkAttachmentDefinition using IPvlan, an L2 mode, a host interface, and Whereabouts IP address management. section 8.3.2

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-deployment
spec:
...
template:
 metadata:
  annotations:
   k8s.v1.cni.cncf.io/networks: default/gke-network-1, default/gke-network-2
  labels:
   app: sample-deployment
...

Shows a Deployment assigning two additional networks through the Multus annotation. section 8.3.2

How Google Anthos in Action covers it

How deep it goes
Explains interface naming, supported CNI choices, and the three configuration steps, but stops short of detailed runtime networking internals.
Examples
Uses cluster YAML, an IPvlan NetworkAttachmentDefinition, and a Deployment annotation assigning multiple networks.
What it assumes
Assumes familiarity with Kubernetes Pods, Deployments, custom resources, and Anthos on bare metal.
What you can do after
Configure multiple Pod interfaces through Anthos cluster settings, NetworkAttachmentDefinition resources, and workload annotations.
How it connects
Connects Kubernetes Pods with Multus CNI, NetworkAttachmentDefinition, data plane, control plane, and Anthos on bare metal.

Also explained in

Compare how 3 books explain network interface →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.