Calico node status
A Calico node status resource (CalicoNodeStatus) represents status information for a node, for use during troubleshooting.
You create a CalicoNodeStatus resource for the node you want to inspect, and Calico periodically writes the collected information to the resource's status field.
CalicoNodeStatus is a cluster-scoped resource.
Status of Border Gateway Protocol (BGP) agents, BGP sessions, and routes exposed to BGP agents is collected from Linux nodes only. Windows nodes are not supported at this time. The resource is valid only when Calico BGP networking is in use.
For kubectl commands, you can use the aliases caliconodestatus.projectcalico.org, caliconodestatuses.projectcalico.org, caliconodestatus.p, and caliconodestatuses.p.
Sample YAML
This sample collects agent, BGP, and route status for node my-kadm-node-0 every 10 seconds.
kubectl apply -f -<<EOF
apiVersion: projectcalico.org/v3
kind: CalicoNodeStatus
metadata:
name: my-caliconodestatus-1
spec:
classes:
- Agent
- BGP
- Routes
node: my-kadm-node-0
updatePeriodSeconds: 10
EOF
To see the results, read back the resource with kubectl get caliconodestatus my-caliconodestatus-1 -o yaml.
The collected information is in the status field.
For example:
apiVersion: projectcalico.org/v3
kind: CalicoNodeStatus
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"projectcalico.org/v3","kind":"CalicoNodeStatus","metadata":{"annotations":{},"name":"my-caliconodestatus-1"},"spec":{"classes":["Agent","BGP","Routes"],"node":"my-kadm-node-0","updatePeriodSeconds":10}}
creationTimestamp: '2021-10-18T10:30:43Z'
generation: 139
name: my-caliconodestatus-1
resourceVersion: '203255'
uid: 6e3b676b-546a-41db-aeda-ad44f25ff73f
spec:
classes:
- Agent
- BGP
- Routes
node: my-kadm-node-0
updatePeriodSeconds: 10
status:
agent:
birdV4:
lastBootTime: '2021-10-18 09:23:19'
lastReconfigurationTime: '2021-10-18 09:23:19'
routerID: 10.128.0.240
state: Ready
version: v0.3.3+birdv1.6.8
birdV6:
lastBootTime: '2021-10-18 09:23:19'
lastReconfigurationTime: '2021-10-18 09:23:19'
routerID: 10.128.0.240
state: Ready
version: v0.3.3+birdv1.6.8
bgp:
numberEstablishedV4: 2
numberEstablishedV6: 0
numberNotEstablishedV4: 1
numberNotEstablishedV6: 0
peersV4:
- peerIP: 10.128.0.242
since: '09:23:22'
state: Established
type: NodeMesh
- peerIP: 10.128.0.200
since: '09:23:21'
state: Established
type: NodeMesh
- peerIP: 10.128.0.241
since: '09:23:22'
state: OpenSent
type: NodeMesh
lastUpdated: '2021-10-18T13:22:03Z'
routes:
routesV4:
- destination: 0.0.0.0/0
gateway: 172.18.0.1
interface: eth0
learnedFrom:
sourceType: Kernel
type: FIB
- destination: 192.168.82.0/26
gateway: 10.128.0.200
interface: eth0
learnedFrom:
peerIP: 10.128.0.200
sourceType: NodeMesh
type: FIB
- destination: 192.168.36.0/26
gateway: 10.128.0.242
interface: eth0
learnedFrom:
peerIP: 10.128.0.242
sourceType: NodeMesh
type: FIB
- destination: 10.128.0.5/16
gateway: N/A
interface: eth0
learnedFrom:
sourceType: Direct
type: FIB
Definition
Metadata
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
name | The name of this Calico node status. Required. | Lowercase alphanumeric characters, -, or .. Must start and end with an alphanumeric character. Up to 253 characters. | string |
Spec
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
classes | List of classes that declare the types of information to monitor for this node and allows for selective status reporting about certain subsets of information. Required. | List of Classes | list of strings | |
node | The node name identifies the Calico node instance to collect node status for. Required. | valid Kubernetes node name | string | |
updatePeriodSeconds | Period in seconds at which CalicoNodeStatus should be updated. Set to 0 to disable CalicoNodeStatus refresh. Maximum update period is one day. Required. | 0 to 86400 | integer |
Classes
| Accepted Values | Description |
|---|---|
Agent | Status of BGP daemon agent |
BGP | Status of BGP sessions |
Routes | Status of routes exposed to BGP daemon |
CalicoNodeAgentStatus
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
birdV4 | Status of the IPv4 BIRD daemon. | BGPDaemonStatus | ||
birdV6 | Status of the IPv6 BIRD daemon. | BGPDaemonStatus |
BGPDaemonStatus
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
state | State of BGP daemon. | Ready, NotReady | string | |
version | Version of BGP daemon | string | ||
routerID | Router ID used by BGP daemon | string | ||
lastBootTime | Last boot time of BGP daemon | string | ||
lastReconfigurationTime | Last reconfiguration time of BGP daemon | string |
CalicoNodeBGPStatus
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
numberEstablishedV4 | The total number of IPv4 established BGP sessions. | integer | ||
numberNotEstablishedV4 | The total number of IPv4 non-established BGP sessions. | integer | ||
numberEstablishedV6 | The total number of IPv6 established BGP sessions. | integer | ||
numberNotEstablishedV6 | The total number of IPv6 non-established BGP sessions. | integer | ||
peersV4 | IPv4 BGP peers status on the node. | list of CalicoNodePeer | ||
peersV6 | IPv6 BGP peers status on the node. | list of CalicoNodePeer |
CalicoNodeBGPRouteStatus
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
routesV4 | IPv4 routes learned by BGP daemon on the node. | list of CalicoNodeRoute | ||
routesV6 | IPv6 routes learned by BGP daemon on the node. | list of CalicoNodeRoute |
CalicoNodePeer
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
peerIP | IP address of the peer whose condition we are reporting. | An IP address | string | |
type | Type indicates whether this peer is configured via the node-to-node mesh, or via en explicit global or per-node BGPPeer object. | NodeMesh, NodePeer, GlobalPeer | string | |
state | BGP session state. Value of an empty string means BGP session state is unknown. | Idle, Connect, Active, OpenSent, OpenConfirm, Established, Close | string | |
since | Timestamp of last BGP session state change. | string |
CalicoNodeRoute
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
type | Type indicates if the route is being used for forwarding or not. | FIB, RIB | string | |
destination | Destination CIDR of the route. | A CIDR | string | |
gateway | Gateway IP of the route. If the route does not involve a gateway, for example a direct route, the value is N/A. | An IP address, or N/A | string | |
interface | Network interface for the destination. For a blackhole route, the value is blackhole. For a unreachable route, the value is unreachable. | string | ||
learnedFrom | Information regarding where this route originated. | CalicoNodeRouteLearnedFrom |
CalicoNodeRouteLearnedFrom
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
sourceType | Type of the source where a route is learned from. | Kernel, Static, Direct, NodeMesh, BGPPeer | string | |
peerIP | If sourceType is NodeMesh or BGPPeer, IP address of the router that sent us this route. For a BGPPeer session with a port set, in peerIP or through a BGPConfiguration listenPort, the value also contains the port, for example 10.0.0.1.port.1790. | string |
Status
| Field | Description | Accepted Values | Schema | Default |
|---|---|---|---|---|
lastUpdated | Timestamp representing the server time when the CalicoNodeStatus object last updated. It is represented in RFC3339 form and is in UTC. | |||
agent | BGP daemon status on the node. | CalicoNodeAgentStatus | ||
bgp | BGP status on the node. peersV4 holds status of IPv4 BGP peers, peersV6 holds status of IPv6 BGP peers. | CalicoNodeBGPStatus | ||
routes | Route status learned by BGP daemon on the node. routesV4 holds status of IPv4 routes, routesV6 holds status of IPv6 routes. | CalicoNodeBGPRouteStatus |
Performance impact
Updating CalicoNodeStatus has a small performance impact on CPU and memory usage of the node, and adds load to the Kubernetes API server.
In our testing on a ten node, full mesh cluster, a CalicoNodeStatus resource was created for each node where the update interval was set to ten seconds. On each node, this resulted in an increase in CPU use of 5% of a vCPU and an increase of 4MB of memory. The control plane node recorded an increase in CPU usage of 5% of a vCPU for these 10 nodes.
The implementation of CalicoNodeStatus is designed to handle a small number of nodes (less than 10 is recommended) reporting back status in the same time. If CalicoNodeStatus are created for a large number of nodes, and with short update interval, the Kubernetes API server may become slower and less responsive. You should create CalicoNodeStatus for the node you are interested in and for debugging purpose only. CalicoNodeStatus resource should be deleted upon the completion of the debugging process.