Laymen explanation
Technical explanation
In case, you want to create additional interface in a container multiple interface, this document can help.
Sample YAML where CPX starts with user controlled init
root@ubuntu-232:~/deepak# cat cpx_ns_cic.yaml | more
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: cpx-ns
spec:
template:
metadata:
name: cpx-ns
labels:
app: cpx-ns
annotations:
NETSCALER_AS_APP: "True"
spec:
serviceAccountName: cpx
containers:
- name: cpx
image: "in-docker-reg.eng.citrite.net/cpx-dev/cpx:12.1-51.12"
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
securityContext:
privileged: true
env:
- name: "EULA"
value: "yes"
- name: "KUBERNETES_TASK_ID"
value: ""
imagePullPolicy: Always
# Add cic as a sidecar
- name: cic
image: "in-docker-reg.eng.citrite.net/cic-dev/cic:latest"
env:
- name: "EULA"
value: "yes"
- name: "NS_IP"
value: "127.0.0.1"
- name: "NS_PROTOCOL"
value: "HTTP"
- name: "NS_PORT"
value: "80"
- name: "NS_DEPLOYMENT_MODE"
value: "SIDECAR"
- name: "NS_ENABLE_MONITORING"
value: "YES"
imagePullPolicy: Always
Apply above YAML
Enter to CPX shell
Configure a test interface as below
Commands used to create additional interface
root@cpx-ns-6x6pb:/# history
1 ps ax
2 ip addr show
3 ip link add test type veth peer name testp
4 ip link show
5 ip addr add 1.1.1.1/24 dev test
6 ip link show
7 ip addr show
8 history
Manually start CPX init
Check that CPX learned new interface
Example output
Text Box
root@ubuntu-232:~/deepak# kubectl get pods | grep cpx
cpx-ns-6x6pb 2/2 Running 1 17m
root@ubuntu-232:~/deepak# kubectl exec -it cpx-ns-6x6pb -c cpx bash
root@cpx-ns-6x6pb:/# cli_script.sh 'sh ns ip'
exec: sh ns ip
Ipaddress Traffic Domain Type Mode Arp Icmp Vserver State
--------- -------------- ---- ---- --- ---- ------- ------
1) 10.244.1.231 0 NetScaler IP Active Enabled Enabled NA Enabled
2) 192.0.0.1 0 SNIP Active Enabled Enabled NA Enabled
3) 1.1.1.1 0 SNIP Active Enabled Enabled NA Enabled
Done
root@cpx-ns-6x6pb:/#