Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

cSRX Deployment in Kubernetes

Install cSRX in Kubernetes Linux Server

Prerequisites

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

  • Install kubeadm tool on both primary and worker nodes to create a cluster. See Install Kubeadm

  • Install and configure Docker on Linux host platform to implement the Linux container environment, see Install Docker for installation instructions on the supported Linux host operating systems.

  • Verify the system requirement specifications for the Linux server to deploy the cSRX Container Firewall, see Requirements for Deploying cSRX in Kubernetes.

  • Download cSRX Container Firewall software, see Download cSRX Software.

Deploy cSRX Pods in Kubernetes Linux Server

You can create cSRX Container Firewall 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 Container Firewall 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 Container Firewall with Kubernetes:

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

    To create network interfaces with type: macvlan.

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

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

Upgrade cSRX Image Using Deployment Rollout

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

  1. Run the following command to upgrade cSRX Container Firewall image using Kubernetes Deployment name in the cSRX Container Firewall 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 Container Firewall Pods.

cSRX Image Rollback

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

  1. Rollack cSRX Container Firewall 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 Container Firewall Pods are terminated and new cSRX Container Firewall 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 Container Firewall Pod.

Scale cSRX Deployment

To scale the cSRX Container Firewall deployment:

  1. Ensure to have cSRX Container Firewall 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