Skip to content

Commit e41002b

Browse files
authored
Calico sample — require BGP and correct indenting (#574)
1 parent f765189 commit e41002b

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

source/plugins/cloudstack-kubernetes-service.rst

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -653,41 +653,43 @@ Use diverse CNI plugins (Calico, Cilium, etc)
653653
A CNI framework has also been added which provides end users the flexibility to use the CNI plugin of their choice. The CNI framework internally leverages the managed User data feature provided by CloudStack.
654654

655655
Sample Calico CNI configuration data used which is appended to the existing Kubernetes control node user data is:
656+
.. note::
657+
This Calico sample requires prior external BGP peering — without BGP the CKS deployment will not work as expected
656658

657659
.. code-block:: bash
658660
659661
#cloud-config
660-
- for i in {1..3}; do curl https://raw.githubusercontent.com/projectcalico/calico/v3.28.0/manifests/calico.yaml -o /home/cloud/calico.yaml && break || sleep 5; done
661-
- until [ -f /home/cloud/success ]; do sleep 5; done
662-
- echo "Kubectl apply file"
663-
- for i in {1..3}; do sudo /opt/bin/kubectl create -f /home/cloud/calico.yaml && break || sleep 5; done
664-
- export PATH=$PATH:/home/cloud
665-
- |
666-
cat << 'EOF' > /home/cloud/create-configs.sh
667-
#!/bin/bash
668-
cat << 'EOL' > /home/cloud/bgp-config.yaml
669-
apiVersion: crd.projectcalico.org/v1
670-
kind: BGPConfiguration
671-
metadata:
672-
name: default
673-
spec:
674-
logSeverityScreen: Debug
675-
asNumber: {{ AS_NUMBER }}
676-
EOL
677-
cat << 'EOL' > /home/cloud/bgp-peer.yaml
678-
apiVersion: crd.projectcalico.org/v1
679-
kind: BGPPeer
680-
metadata:
681-
name: bgp-peer-example
682-
spec:
683-
peerIP: {{ ds.meta_data.peer_ip_address }}
684-
asNumber: {{ ds.meta_data.peer_as_number }}
685-
EOL
686-
EOF
687-
- chmod +x /home/cloud/create-configs.sh
688-
- /home/cloud/create-configs.sh
689-
- for i in {1..3}; do sudo /opt/bin/kubectl apply -f /home/cloud/bgp-config.yaml && break || sleep 5; done
690-
- for i in {1..3}; do sudo /opt/bin/kubectl apply -f /home/cloud/bgp-peer.yaml && break || sleep 5; done
662+
- for i in {1..3}; do curl https://raw.githubusercontent.com/projectcalico/calico/v3.28.0/manifests/calico.yaml -o /home/cloud/calico.yaml && break || sleep 5; done
663+
- until [ -f /home/cloud/success ]; do sleep 5; done
664+
- echo "Kubectl apply file"
665+
- for i in {1..3}; do sudo /opt/bin/kubectl create -f /home/cloud/calico.yaml && break || sleep 5; done
666+
- export PATH=$PATH:/home/cloud
667+
- |
668+
cat << 'EOF' > /home/cloud/create-configs.sh
669+
#!/bin/bash
670+
cat << 'EOL' > /home/cloud/bgp-config.yaml
671+
apiVersion: crd.projectcalico.org/v1
672+
kind: BGPConfiguration
673+
metadata:
674+
name: default
675+
spec:
676+
logSeverityScreen: Debug
677+
asNumber: {{ AS_NUMBER }}
678+
EOL
679+
cat << 'EOL' > /home/cloud/bgp-peer.yaml
680+
apiVersion: crd.projectcalico.org/v1
681+
kind: BGPPeer
682+
metadata:
683+
name: bgp-peer-1
684+
spec:
685+
peerIP: {{ ds.meta_data.peer_ip_address }}
686+
asNumber: {{ ds.meta_data.peer_as_number }}
687+
EOL
688+
EOF
689+
- chmod +x /home/cloud/create-configs.sh
690+
- /home/cloud/create-configs.sh
691+
- for i in {1..3}; do sudo /opt/bin/kubectl apply -f /home/cloud/bgp-config.yaml && break || sleep 5; done
692+
- for i in {1..3}; do sudo /opt/bin/kubectl apply -f /home/cloud/bgp-peer.yaml && break || sleep 5; done
691693
692694
693695
The CNI Configuration creation allows specifying the parameters to be set as a comma separated list:

0 commit comments

Comments
 (0)