| 
 | 1 | +# Swiftv2 Cilium Setup Guide  | 
 | 2 | + | 
 | 3 | +## Steps  | 
 | 4 | +### Clone repo + checkout branch for *.yamls  | 
 | 5 | +git clone https://github.com/Azure/azure-container-networking.git  | 
 | 6 | +git checkout jpayne3506/conflist-generation < TODO Change before merge >  | 
 | 7 | + | 
 | 8 | +### Apply cilium config  | 
 | 9 | +export DIR=1.17  | 
 | 10 | +export CILIUM_VERSION_TAG=v1.17.7-250927  | 
 | 11 | +export CILIUM_IMAGE_REGISTRY=mcr.microsoft.com/containernetworking  | 
 | 12 | +kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-chained-config.yaml  | 
 | 13 | + | 
 | 14 | +- Remove `kube-proxy-replacement-healthz-bind-address: "0.0.0.0:10256"` from configmap if kube-proxy is current on nodes  | 
 | 15 | + | 
 | 16 | +### Apply cilium Agent + Operator  | 
 | 17 | +kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files  | 
 | 18 | +kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files  | 
 | 19 | + | 
 | 20 | +### Apply/Edit CNS configmap  | 
 | 21 | +kubectl apply -f test/integration/manifests/cnsconfig/azcnichainedciliumconfigmap.yaml  | 
 | 22 | +#### Must have configmap values  | 
 | 23 | +```  | 
 | 24 | +"ProgramSNATIPTables": false  | 
 | 25 | +"CNIConflistScenario": "azurecni-chained-cilium"  | 
 | 26 | +"CNIConflistFilepath": "/etc/cni/net.d/05-azure-chained-cilium.conflist"  | 
 | 27 | +```  | 
 | 28 | + | 
 | 29 | +### Update CNS image  | 
 | 30 | +Leverage a cns build from branch or use `acnpublic.azurecr.io/azure-cns:v1.7.5-2-g94c36c070` < TODO Change before merge >  | 
 | 31 | +- This will install our chained conflist through the use of `"CNIConflistScenario": "azurecni-chained-cilium"` and it will be installed on the node here `"CNIConflistFilepath": "/etc/cni/net.d/05-azure-chained-cilium.conflist"`  | 
 | 32 | + | 
 | 33 | +> NOTE: if your current conflist file name starts with `05` then change our previous filename to one with higher priority to ensure that it is consumed on restart. I.e. `03-azure-chained-cilium.conflist`  | 
 | 34 | +
  | 
 | 35 | +### If kube-proxy was present  | 
 | 36 | +#### Remove kube-proxy  | 
 | 37 | +> NOTE: Reapply `kube-proxy-replacement-healthz-bind-address: "0.0.0.0:10256"` to cilium configmap if previously removed  | 
 | 38 | +
  | 
 | 39 | +This can be done either by editing the node-selectors or deleting the ds. Both work...  | 
 | 40 | + | 
 | 41 | +#### Restart Cilium  | 
 | 42 | +kubectl rollout restart ds -n kube-system cilium  | 
 | 43 | + | 
 | 44 | + | 
 | 45 | +### Quick Summary  | 
 | 46 | +- Apply/Edit Cilium Config with  | 
 | 47 | +  - `cni-chaining-mode: generic-veth`  | 
 | 48 | +  - remove `kube-proxy-replacement-healthz-bind-address`  | 
 | 49 | +    - You do not need to remove if node does not have kube-proxy enabled  | 
 | 50 | +  - If applied before agent is in ready state then no need to restart agent  | 
 | 51 | +- Apply Agent + Operator  | 
 | 52 | +- Apply/Edit CNS config with  | 
 | 53 | +  - "ProgramSNATIPTables": false  | 
 | 54 | +  - "CNIConflistScenario": "azurecni-chained-cilium"  | 
 | 55 | +  - "CNIConflistFilepath": "/etc/cni/net.d/05-azure-chained-cilium.conflist"  | 
 | 56 | +- Update CNS image with build from branch or < TODO IMAGE NAME >  | 
 | 57 | +  - This will install chained conflist  | 
 | 58 | + | 
 | 59 | +#### If kube-proxy was present  | 
 | 60 | +- Reapply `kube-proxy-replacement-healthz-bind-address: "0.0.0.0:10256"` to cilium configmap  | 
 | 61 | +- Remove Kube-proxy  | 
 | 62 | +- Restart Cilium  | 
 | 63 | + | 
 | 64 | + | 
 | 65 | +## Quick Vaildation testing  | 
 | 66 | +- Create pods from deploy  | 
 | 67 | +  - test/integration/manifests/swiftv2/mt-deploy.yaml  | 
 | 68 | +  - Creates `container-*` pods on default namespace  | 
 | 69 | +- Create Cilium Network Policies  | 
 | 70 | +  - test/integration/manifests/cilium/netpol/default-allow.yaml  | 
 | 71 | +  - Will only allow cilium managed endpoints to transmit traffic through default namespace  | 
 | 72 | +- Check Cilium Management with  | 
 | 73 | +  - `kubectl get cep -A`  | 
 | 74 | +  - `kubectl get cnp -A`  | 
 | 75 | +- Check connectivity  | 
 | 76 | +  - exec -it <container-*> -- sh  | 
 | 77 | +  - ip a  | 
 | 78 | +    - look for delegatedNIC IP  | 
 | 79 | +  - ping <IP>  | 
 | 80 | +  - confirm CNP working by attempting to ping coredns pods  | 
 | 81 | +    - should fail if both are being maintained by cilium  | 
 | 82 | +    - confirm with `kubectl get cep -A`  | 
0 commit comments