In k8s we have two probes that are used to monitor the health and availability of a container, readiness and liveness probes. This post shows some examples on how to use them. The post will hopefully interest you in trying to take advantage of those probes when running NSO in k8s.
The more you can check in your liveness probe, the more certain you can be that NSO is actually up and running and does what it should.
NOTE, the actions in the example are toy examples, but hopefully they'll set you off with some ideas on how you can create readiness and most importantly a good liveness probe for your system. The liveness probe could in theory do a number of things, including touching devices.
The readiness probe determines when a container is ready for service. NSO can sometimes take some time before it's ready for service.
See the k8s-liveness-readiness/is-ready.sh script. It first checks if NSO is started at all, if that succeeds, the script calls a simple action (/k8s/ready).
Please see k8s-liveness-readiness/lr-test/python/lr_test/main.py
After the container has been running for a while, we need to make sure it's still alive. This is also done using an action (/k8s/alive). The example action simply creates a config transaction and writes a leaf (/k8s/last-live-check), this is to test that we can successfully commit a configuration transaction.
To run the examples, please see instructions below.
You'll need to build the NSO system install base image. This is a somewhat minimized image that installs NSO.
Please note that you need to supply your own NSO installer binary and modify the Makefile for a correct container name. See the CONTAINER and VER variables in nso-system-install-base/Makefile.
make image push
Once you have managed to build the base image, you can move on to the example.
Hi all,NSO is using yanger to validate the yang models internally. Is it possible to generate a HTML document based on defined yang model, like pyang does it? If not: It is recommend to generate a HTML doc by pyang, although NSO is using only ya...
Dear Experts, I have read the examples in the community, but couldn't manage this. May some one help please..I have the following YANG file.Desired output : Whenever, operator selects a dest-router, would see in dest-router-port the available interfa...
Good day, proffesionals!I can not understand what the problem is! I am trying to connect to equipment through netconf via ssh. I recive capability list from device. Netconf Sessions: 1 open, maximum is 5 Remote connection vi...
Hi all, is it possible to mockup the arguments (tctx, root, service, proplist) for the service callback without using of NCS daemon?The approch should be to validate the output based on the input for simple unit testing with pyTest and speed up the d...