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.
Below find a sample deployment yaml file
The key environment variables for the container spec are:
- name: NOVA_AUTO_CONF_HOST
value: 'nova.snapt.net'
- name: NOVA_AUTO_CONF
value: '<Insert your Auto-join Key here>'
- name: NODE_HOST
value: poll.nova-adc.com
Other considerations in the spec file:
image: novaadc/nova-client:aj
imagePullPolicy: Always
securityContext:
privileged: true
procMount: Default
capabilities:
add:
- NET_ADMIN
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:
- containerPort: 1080
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: {}
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
Once the deployment is configured and running as expected, using kubectl it is possible to scale the deployment as required.
Scale deployment for the specific ADC to 10 nodes
$ kubectl scale deployments/dc01-prod-dpl --replicas=10
Scale deployment for the specific ADC to 2 nodes
$ kubectl scale deployments/dc01-prod-dpl --replicas=2
To clean up all remnants of the Nova deployment
$ kubectl delete deploy/dc01-prod-dpl