Skip to main content

flannel

ben.wangzLess than 1 minute

flannel

prepare

  1. k8s is ready
  2. helm binary
    • MIRROR="files."
      VERSION=v3.13.3
      ARCH=$(uname -m)
      if [ "${ARCH}" = "x86_64" ]; then
          ARCH_IN_FILE_NAME=linux-amd64
      elif [ "${ARCH}" = "aarch64" ]; then
          ARCH_IN_FILE_NAME=linux-arm64
      else
          echo "NOT SUPPORT: ${ARCH}"
      fi
      FILE_NAME=helm-${VERSION}-${ARCH_IN_FILE_NAME}.tar.gz
      curl -sSLo ${FILE_NAME} "https://${MIRROR}get.helm.sh/${FILE_NAME}"
      tar zxf ${FILE_NAME}
      mkdir -p ${HOME}/bin
      mv -f ${ARCH_IN_FILE_NAME}/helm ${HOME}/bin
      rm -rf ./${FILE_NAME}
      rm -rf ./${ARCH_IN_FILE_NAME}
      chmod u+x ${HOME}/bin/helm
      
      

install

  1. create namespace and configure
    • kubectl create namespace kube-flannel
      kubectl label --overwrite namespace kube-flannel pod-security.kubernetes.io/enforce=privileged
      
  2. install with helm
    • MIRROR=
      helm install flannel flannel \
          --namespace kube-flannel \
          --repo https://flannel-io.github.io/flannel/ \
          --set podCidr="10.244.0.0/16" \
          --set flannel.image.repository=${MIRROR}docker.io/flannel/flannel \
          --set flannel.image_cni.repository=${MIRROR}docker.io/flannel/flannel-cni-plugin \
          --atomic