Display Microservice Status in Cloud-Native Contrail Networking
Juniper Cloud-Native Contrail® Networking™ supports microservices in environments using Contrail Networking Release 22.1 or later in a Kubernetes-orchestrated environment.
To display service status for the Contrail cluster, you need:
- CLI tool, such as
kubectl
to provide the overall system status of all the services running. - The
contrailstatus
plugin must be installed along withkubectl
. - Use of command
kubectl contrailstatus
to request the status of various services.
Overview: Microservice Status in Cloud-Native Contrail Networking
Microservices exist as small, independent applications deployed without updating the entire Contrail Networking deployment and provides better ways to manage to the life cycle of containers. The containers and their processes are grouped as services and microservices.
ContrailStatus is a kubectl
plugin used to display the status information
of Contrail Networking services in the three different planes (configuration, control, and
data). In addition to the usual containers in a specific service, init
(initialization) container status within the service and the relative software status, such
as BGP and XMPP in control_controller
are also visible.
The contrailstatus
plug-in is categorized into two sections:
- Deployment status
- Resource status
Display Microservice Status
The following outputs are examples showing deployment status updates and resource status updates to the pods for all planes.
Display Deployment Status
Display deployment status in either short or default form.
All Planes Deployment Status
To display the deployment status for all of the planes and request the short form:
root@helper ~] # kubectl contrailstatus -short PLANE STATUS config nok control ok data ok
The option -short
for short form only displays output for the pod name
and status. The following example outputs are using the default form.
Configuration Plane Deployment Status
To display the deployment status to the configuration plane:
root@helper ~] # kubectl contrailstatus deployment -p config PODNAME STATUS NODE IP MESSAGE apiserver-86885bf7d8-q27qk nok node 10.1.1.1 process not up, init cont….. apiserver-86885bf7d8-sdsdd ok node2 10.1.1.2 apiserver-86885bf7d8-sdsss ok node3 10.1.1.3 controller-6998bd846f-5cgf7 ok node1 10.1.1.1 controller-6998bd846f-5cgf8 ok node2 10.1.1.2 controller-6998bd846f-5cg10 nok node3 10.1.1.3 o/1 node is not allocated. cluster1-kubemanager-7cff895-sdfsd ok node2 10.1.1.2 cluster1-kubemanager-7cff895-sdfsa ok node3 10.1.1.3
Data Plane Deployment Status
To display the deployment status to the data plane:
root@helper ~] # kubectl contrailstatus deployment -p data PODNAME STATUS NODE IP MESSAGE vrouter-86885bf7d8-q27qk nok node 10.1.1.1 process not up, init cont.….. vrouter-86885bf7d8-sdsdd ok node2 10.1.1.2
Control Plane Deployment Status
To display the deployment status to the control plane:
root@helper ~] # kubectl contrailstatus deployment -p control PODNAME STATUS NODE IP MESSAGE contrail-control-0 nok node 10.1.1.1 process not up, init cont.….. contrail-control-1 ok node2 10.1.1.2
Display Resource Status
The contrailstatus
plugin also displays status updates for deployment
resources, such as XMPP and BGP.
Data Plane Resource Status
To display the resource status of bgprouter
to the data plane:
root@helper ~] kubectl contrailstatus resource bgprouter PODNAME STATUS SERVICE bgprouter1 nok xmpp, bgp not working/has error.. bgprouter2 nok bgprouter2 ok
Control Node Resource Status
To display the resource status in the control node, run the following command. The command gives the output for the XMPP session.
root@helper ~] kubectl contrailstatus resource bgprouter -s xmpp LOCAL NEIGHBOR STATE POD bgprouter1 vr1 established (ok) contrail-control-0 bgprouter1 vr2 active (nok) contrail-control-0 bgprouter2 vr1 contrail-control-1 bgprouter2 vr3 contrail-control-1
To display the resource status in the control node, run the following command. The command gives the output for the BGP session.
root@helper ~] kubectl contrailstatus resource bgprouter -s bgp LOCAL NEIGHBOR STATE POD bgprouter1 bgprouter2 established (ok) contrail-control-0 bgprouter1 bgprouter3 active (nok) contrail-control-0 bgprouter2 bgprouter1 established (ok) contrail-control-1 bgprouter2 bgprouter3 established (ok) contrail-control-1
All Planes Resource Status
To display the resource status on all of the planes:
[root@helper ~] # kubectl contrailstatus -all NAME STATUS PLANE ERRORNOTES apiserver-86789f7d8-q37qf Active Config NAME STATUS PLANE ERRORNOTES control-1 Active control BGP-1 Active control XMPP-1 Active control NAME STATUS PLANE ERRORNOTES vrouter-86789f7d8-q37qk Active data [root@helper ~] #
Services Status for Multiple Nodes
The following (same) command displays the status of various services running on multiple
nodes in a cluster. If the running controller is active without any errors, the status
column next to the service displays as Active
. If the controller has any
error, the status column of the controller displays as Not-Active
. The
output includes the status of various controllers and containers in the controllers.
To display the status of various services running on multiple nodes in a cluster:
[root@helper ~] # kubectl contrailstatus -all NAME STATUS ERRORNOTES apiserver-86885bf7d8-q27qk Active apiserver-86885bf7d8-sdsdd Active apiserver-86885bf7d8-sdsss Active controller-6998bd846f-5cgf7 Active controller-6998bd846f-5cgf8 Active controller-6998bd846f-5cg10 Active cluster1-kubemanager-7cff895-sdfsd Active cluster1-kubemanager-7cff895-sdfsa Active NAME STATUS ERRORNOTES control-1 Active control-2 Active control-3 Active BGP-1 Active BGP-2 Active XMPP-1 Active Xmpp-2 Active NAME STATUS ERRORNOTES vrouter-86789f7d8-q37qk Active vrouter-8905bf7d8-q47qk Active vrouter-8688bf7d8-q57qk Active [root@helper ~] #