Skip to content
Snippets Groups Projects

k8s Calico network setup

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Adphi
    Edited
    k8s-network-setup 607 B
    #!/usr/bin/env bash
    
    OUT=/tmp/calico.yaml
    
    wget https://docs.projectcalico.org/manifests/calico.yaml -O "${OUT}"
    
    # Delete the env var and value
    line=$(grep -n 'CALICO_IPV4POOL_VXLAN' ${OUT}|cut -d':' -f1)
    # The first one delete the name
    sed -i "${line}d" "${OUT}"
    # The second one delete the value
    sed -i "${line}d" "${OUT}"
    # Set vars to vxlan
    sed -i 's|CALICO_IPV4POOL_IPIP|CALICO_IPV4POOL_VXLAN|g' "${OUT}"
    sed -i 's|calico_backend: "bird"|calico_backend: "vxlan"|g' "${OUT}"
    sed -i 's|- -bird-ready|# - -bird-ready|g' "${OUT}"
    sed -i 's|- -bird-live|# - -bird-live|g' "${OUT}"
    
    kubectl apply -f ${OUT}
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment