Deploying Cisco Prime Network Registrar regional and local Instance on Kubernetes
You can deploy the Cisco Prime Network Registrar instances on Kubernetes using the YAML files. YAML is the standard format used in a Kubernetes configuration file. Cisco Prime Network Registrar kit cpnr-11.2-1.el8.x86_64_kubernetes.tar.gz contains examples of YAML files (cpnr-local-statefulset.yaml and cpnr-regional-statefulset.yaml), which depict one of the ways of deploying Cisco Prime Network Registrar on Kubernetes.
Note |
No special license is required to deploy Cisco Prime Network Registrar in the Kubernetes environment. It uses the existing container licenses. |
For example, you can use the cpnr-local-statefulset.yaml in the Cisco Prime Network Registrar kit to create the Cisco Prime Network Registrar local instance on Kubernetes. This configuration uses StatefulSet and hostNetwork deployment. Instance created using this YAML will bind the Cisco Prime Network Registrar local instance to the configured worker node. This instance will run only on the configured worker node and it will not run on the other node.
When a pod is configured with hostNetwork: true, the applications running in the pod can directly see the network interfaces of the host machine where the pod was started. An application that is configured to listen on all network interfaces will in turn be accessible on all the network interfaces of the host machine.
YAML file consists of the following Kubernetes resources:
-
Service
In cpnr-local-statefulset.yaml, cpnr-local is the service name and since Headless service is used, the clusterIp is set to None.
-
StatefulSet
In cpnr-local-statefulset.yaml, cpnr-local is the StatefulSet name and is used to run the Cisco Prime Network Registrar 11.2 docker image with replica of one.
StatefulSet is used in Cisco Prime Network Registrar for two reasons:
-
Constant pod names
-
When pods created using deployment are deleted, it creates a new pod before the old pod is completely terminated. Since hostNetwork is used before the old Cisco Prime Network Registrar process on the host node is termianted completely, the new Cisco Prime Network Registrar pod is created and the Cisco Prime Network Registrar services on the new pod is down since the Cisco Prime Network Registrar process on the old pod is not termianted completely.
This is overcome by StatefulSet where the old pod is terminated completely and only then the new pod is created.
-
Note |
Cisco Prime Network Registrar has been tested using the hostNetwork, as other networking modes had issues with HA and failover pair. In the hostNetwork mode, when a pod starts, it uses the host network namespace and host IP address. This basically means that the pod can see all the network interfaces of the host. With hostNetwork mode, only one Cisco Prime Network Registrar instance can be deployed in a node and hence the replica in the YAML is set to 1. If multiple Cisco Prime Network Registrar pods are to be deployed in the same node using hostNetwork mode, then for each pod, you need to change all Cisco Prime Network Registrar related ports and adjust the replicas accordingly. However, this may not be useful. |
Procedure
Step 1 |
Configure the following parameters in the YAML file:
|
Step 2 |
Create the Cisco Prime Network Registrar instance on Kubernetes using the following command:
|
Step 3 |
Check the Cisco Prime Network Registrar instance details on Kubernetes using the following command:
|
Step 4 |
Log into the Cisco Prime Network Registrar instance pod using the following command:
|
Step 5 |
Set the user name and password, and register the local pods to regional pods. |
If you want to delete the Cisco Prime Network Registrar instance on Kubernetes, use the following command:
-
For Cisco Prime Network Registrar local instance:
# kubectl delete -f cpnr-local-statefulset.yaml
-
For Cisco Prime Network Registrar regional instance:
# kubectl delete -f cpnr-regional-statefulset.yaml
To debug any pod failures, use the kubectl logs podname or kubectl describe pod podname command.
Note |
If you want to deploy Cisco Prime Network Registrar pod in another worker node, you need to make changes in the YAML file (for example, you need to change service.metadata.name and statefulset.metadata.name.). |
Note |
Cisco Prime Network Registrar 11.2 Docker images have been tested with Kubernetes version 1.27. CNI used is Calico 3.22.0. The entire testing is carried out using the YAML files provided as examples. If you want to change the YAML file, it is your responsibility to test it before moving it to production. |