Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

cSRX Deployment in Kubernetes

cSRX Installation on Kubernetes Linux Server

Prerequisites

Following are the prerequisites required for installing cSRX on one primary node and ’n’ number of worker nodes. Before you begin the installation:

Deploying cSRX Pod

You can create cSRX as a Pod in routing mode and secure-wire mode to send traffic from one virtual machine to another virtual machine. You can define multiple virtual networks and connect cSRX interfaces to those virtual networks.

The network attachment definition is created with plugin ipam type as host-local which allocates IPv4 and IPv6 addresses out of a specified address range to ensure the uniqueness of IP addresses on a single host. The ipam type as static assigns IPv4 and IPv6 addresses statically to container.

To deploy cSRX with Kubernetes:

Figure 1: Deploying cSRX Deploying cSRX
  1. Create network attachment definition for cSRX-eth1, cSRX-eth2 with type: bridge . For details on type: bridge and type: macvlan networks, see cSRX Pod With External Network.

    To create network interfaces with type: macvlan.

  2. Create the csrx-deployment.yaml file on Kubernetes-master using kind: Deployment. cSRX as kind: Deployment is used to create ReplicaSet, Scaling, Rollout, Rollback in Kubernetes in this topic.
  3. View the cSRX deployment:

    root@kubernetes-master:~#kubectl get deployment csrx-deployment

cSRX Image Upgrade Using Deployment Rollout

You can upgrade the cSRX software image using Kubernetes Deployment rollout.

  1. Run the following command to upgrade cSRX image using Kubernetes Deployment name in the cSRX Pod:

    root@kubernetes-master:~#kubectl set image deployment csrx-deployment csrx=<new-csrx-image>

  2. Run the following command to monitor rollout status:

    root@kubernetes-master:~#kubectl rollout history deployment csrx-deployment

    root@kubernetes-master:~#kubectl rollout status -w deployment csrx-deployment

    You can verify the upgraded image version by logging into the newly created cSRX Pods.

cSRX Image Rollback

The cSRX image can be rolled back to previous version using Kubernetes Deployment rollout components.

  1. Rollack cSRX image using Kubernetes Deployment rollout undo:

    root@kubernetes-master:~#kubectl rollout history deployment csrx-deploy

  2. Rollback to previous Deployment.

    root@kubernetes-master:~#kubectl rollout undo deployment csrx-deploy

  3. Rollback to a specified version.

    root@kubernetes-master:~#kubectl rollout undo deployment csrx-deploy --to-version=2

  4. Monitor the old cSRX Pods are terminated and new cSRX Pods are created.

    root@kubernetes-master:~#kubectl rollout history deployment csrx-deploy

    root@kubernetes-master:~#kubectl rollout status -w deployment csrx-deploy

    You can verify the image version that has been rolled back by logging into the newly created cSRX Pod.

Scaling cSRX Deployment

To scale the cSRX deployment:

  1. Ensure to have cSRX Pods created in kind: deployment running in Kubernetes cluster.

    root@kubernetes-master:~#kubectl describe deployment csrx-deployment

  2. Scale up or down by changing the replicas number:

    root@kubernetes-master:~#kubectl scale deployment csrx-deployment --replicas=2

  3. View the pods:

    root@kubernetes-master:~#kubectl get pod