NetScaler CPX support for Kubernetes probes

Kubernetes manages container lifecycles through startup, liveness, and readiness probes to ensure that applications initialize correctly and remain healthy. NetScaler CPX now supports the readiness probe in addition to the existing startup and liveness probes. This support ensures that Kubernetes routes traffic to NetScaler CPX only when it is fully operational and, if configured, has successfully completed its license checkout.

By using these probes, you can improve application availability and ensure that failed or unresponsive instances are recreated promptly.

Some of the benefits are:

  • Enhanced traffic management: Ensures NetScaler CPX receives traffic only when it is ready to handle requests.
  • Operational reliability: Restarts unhealthy containers automatically to recover from failures.
  • Licensing validation: Delays the ready state until license checkouts are successful when using the LAS_CPX_BANDWIDTH parameter.
  • Precise initialization: Coordinates the transition from container startup to active health monitoring.

Note:

NetScaler CPX version 14.1-72.x or later is required to use the readiness probe. For detailed information on probe mechanics, see the official Kubernetes documentation.

Configure Kubernetes probes for NetScaler CPX

To configure probes for NetScaler CPX, define the probe parameters in your Kubernetes deployment YAML file.

To configure probes using the CLI

Edit your deployment YAML file to include the specific exec commands that Kubernetes uses to verify the state of the NetScaler CPX container.

Configure the startup probe: Add the following snippet to ensure that Kubernetes waits for the initialization process to finish. NetScaler CPX signals a successful start by creating the file. Configure the startup probe to monitor this path to ensure that initialization completes before liveness checks begin.

  
  startupProbe: 
    exec: 
      command: 
          - ls 
          - /tmp/cpx_started 
    initialDelaySeconds: 30 
    periodSeconds: 5 
    failureThreshold: 20 
    successThreshold: 1 
    timeoutSeconds: 1
<!--NeedCopy-->

Configure the readiness probe: Add the following snippet to define when the pod is ready to accept traffic. CPX creates the /tmp/cpx_ready file when it is prepared to handle traffic. If you configure the LAS_CPX_BANDWIDTH parameter, CPX creates this file after a successful license checkout. Otherwise, it appears after the startup process finishes. Kubernetes uses this file for the readiness probe to determine when to route traffic to the pod.

readinessProbe:
  exec:
    command:
      - /bin/ls
      - /tmp/cpx_ready
  failureThreshold: 15
  initialDelaySeconds: 60
  periodSeconds: 30
  successThreshold: 1
  timeoutSeconds: 1
<!--NeedCopy-->

Configure the liveness probe: Add the following snippet to continuously monitor the health of the container during runtime. Define a liveness probe in the deployment YAML to monitor CPX health during runtime. If the probe fails, Kubernetes restarts the container to recover from unhealthy states. This mechanism ensures application availability by automatically recreating unresponsive CPX instances.

livenessProbe: 
  exec: 
    command: 
      - /bin/ping 
      - -c 1 
      - 192.0.0.1 
  initialDelaySeconds: 10 
  periodSeconds: 5 
  failureThreshold: 3 
  successThreshold: 1 
  timeoutSeconds: 1 
<!--NeedCopy-->
NetScaler CPX support for Kubernetes probes