Deploy Nova Nodes to Kubernetes using AutoJoin

Nova ADC fully supports replicas and scaling in Kubernetes (and any other container orchestration platform) using a core piece of Nova functionality: Auto Joining. This allows your containers to automatically sync to an ADC configuration on your Nova Portal, and be up and running in seconds. You maintain your centralized control and reporting of them, and allow Kubernetes to scale them as required.

Installation Instructions

Pre-requisites

  • A Kubernetes cluster with external access
  • A Nova ADC created through https://www.nova.snapt.net/adcs
  • A Nova ADC AutoJoin key (refer to diagrams below for guidance on fetching this key)

ADC AutoJoin
ADC AutoJoin Key


Setup

Below find a sample deployment yaml file

The key environment variables for the container spec are:

  • NOVA_AUTO_CONF_HOST
    Do not adjust
        - name: NOVA_AUTO_CONF_HOST
          value: 'nova.snapt.net'
  • NOVA_AUTO_CONF
    This is the specific Auto-join Key as described in the pre-requisites above. All nodes deployed using this key will automatically have the relating ADC configuration.
        - name: NOVA_AUTO_CONF
          value: '<Insert your Auto-join Key here>'
  • NODE_HOST
    Do not adjust
        - name: NODE_HOST
          value: poll.nova-adc.com

    Other considerations in the spec file:

  • image
    Ensure you are using the novaadc/nova-client:aj container and have the imagePullPolicy set to Always to ensure you remain up to date with the latest Nova software.
        image: novaadc/nova-client:aj
        imagePullPolicy: Always
  • securityContext
    The Nova node requires a priveleged context and runs making use of the NET_ADMIN capabilities and permissions
        securityContext:
          privileged: true
          procMount: Default
          capabilities:
            add:
            - NET_ADMIN
  • resources
    Resources can be adjusted according to the volume of traffic. The below is a lightweight container with no caching enabled.
        resources:
          requests:
            memory: "128Mi"
          limits:
            memory: "512Mi"

    A bigger ADC with caching enabled should have a higher memory limit.

        resources:
          requests:
            memory: "512Mi"
          limits:
            memory: "1536Mi"
  • ports
    The Nova technology uses port 1080 to communicate and as a result each pod requires that port bound on the container.
        ports:
        - containerPort: 1080

Sample deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: dc01-dpl
  labels:
    app: dc01-nvc
    deployment: dc01-dpl
spec:
  replicas: 1
  selector:
    matchLabels: 
      app: dc01-nvc
      deployment: dc01-dpl
  template:
    metadata:
      labels:
        app: dc01-nvc
        deployment: dc01-dpl
    spec:
      containers:
      - name: dc01-nvc
        env:
        - name: NOVA_AUTO_CONF_HOST
          value: 'nova.snapt.net'
        - name: NOVA_AUTO_CONF
          value: 'ADC_AUTOJOIN_Key_Here'
        - name: NODE_HOST
          value: poll.nova-adc.com
        image: novaadc/nova-client:aj
        imagePullPolicy: Always
        securityContext:
          privileged: true
          procMount: Default
          capabilities:
            add:
            - NET_ADMIN
        resources:
          requests:
            memory: "128Mi"
          limits:
            memory: "512Mi"
        ports:
        - containerPort: 1080
      restartPolicy: Always
status: {}

Deploying Nova Kubernetes Nodes

Once the deployment yaml configuration is complete, apply the deployment to the kubernetes cluster using whichever mechanism is available. Below is an example using kubectl

kubectl apply -f sample_deployment.yaml

Below are examples of what to expect after a successful deployment

$ kubectl get pods

NAME                             READY   STATUS    RESTARTS   AGE
dc01-prod-dpl-57ffcd8799-4bd4b   1/1     Running   0          31d
dc01-prod-dpl-57ffcd8799-8fqkb   1/1     Running   0          3d22h
dc01-prod-dpl-57ffcd8799-drvxs   1/1     Running   0          3d22h
dc01-prod-dpl-57ffcd8799-pfbmb   1/1     Running   0          21h
dc01-prod-dpl-57ffcd8799-xh77h   1/1     Running   0          21h

$ kubectl get deploy

NAME            READY   UP-TO-DATE   AVAILABLE   AGE
dc01-prod-dpl   5/5     5            5           31d

Nova Nodes ADC Nodes


Nova ADCs ADCs


Scaling Nova Kubernetes Nodes using kubectl

Once the deployment is configured and running as expected, using kubectl it is possible to scale the deployment as required.


Scaling up

Scale deployment for the specific ADC to 10 nodes

$ kubectl scale deployments/dc01-prod-dpl --replicas=10

Scaling down

Scale deployment for the specific ADC to 2 nodes

$ kubectl scale deployments/dc01-prod-dpl --replicas=2

Removal of Nova nodes

To clean up all remnants of the Nova deployment

$ kubectl delete deploy/dc01-prod-dpl