Dell NativeEdge: NativeEdge 배포용 Calico를 배포하려고 할 때 풀 속도 제한을 해결하는 방법

摘要: 이 문서에서는 다운로드 속도 제한 문제를 방지하기 위해 Docker Hub를 사용하여 인증하는 방법을 간략하게 설명합니다.

本文适用于 本文不适用于 本文并非针对某种特定的产品。 本文并非包含所有产品版本。

症状

NativeEdge Orchestrator 2.1.0.0의 경우 Calico 를 CNI(Container Network Interface)로 권장합니다.
Calico 설치를 위한 수정 지침은 NativeEdge Orchestrator 배포 가이드에 포함되어 있습니다. 그러나 Calico를 설치하는 동안 Docker Hub에서 다운로드합니다. Docker Hub는 Calico를 설치하는 동안 발생할 수 있는 다운로드 속도 제한을 구현합니다. (속도 제한에 대한 자세한 내용은 docker.com 에서 확인할 수 있습니다.)

설치 후 사용자가 Pod를 나열하면 옥양목 Pod가 Init:ImagePullBackOff에 있음을 확인할 수 있으며, 이는 컨테이너를 다운로드하는 데 문제가 있음을 나타냅니다.
 
#kubectl get pods -A

NAMESPACE         NAME                                       READY   STATUS                  RESTARTS   AGE
kube-system       local-path-provisioner-957fdf8bc-cl2nl     0/1     Pending                 0          6m50s
kube-system       metrics-server-648b5df564-bncjh            0/1     Pending                 0          6m50s
kube-system       coredns-77ccd57875-cng6c                   0/1     Pending                 0          6m50s
kube-system       calico-kube-controllers-67c64d8b8f-p868c   0/1     Pending                 0          6m39s
kube-system       calico-node-6q82x                          0/1     Init:ImagePullBackOff   0          6m37s

이것은 calico-node 포드를 설명할 때 더 자세히 볼 수 있습니다
#kubectl describe pod calico-node-6q82x -n kube-system
Name:                 calico-node-xscmk
Namespace:            kube-system
..
Events:
  Type     Reason     Age                 From               Message
  ----     ------     ----                ----               -------
  Normal   Scheduled  2m4s                default-scheduler  Successfully assigned kube-system/calico-node-xscmk to sre08129
  Warning  Failed     81s (x2 over 2m2s)  kubelet            Failed to pull image "docker.io/calico/cni:v3.28.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/calico/cni:v3.28.0": failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/calico/cni/manifests/sha256:7a3a5cf6c79243ba2de9eef8cb20fac7c46ef75b858956b9884b0ce87b9a354d: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
  Normal   Pulling    41s (x4 over 2m3s)  kubelet            Pulling image "docker.io/calico/cni:v3.28.0"
  Warning  Failed     40s (x2 over 106s)  kubelet            Failed to pull image "docker.io/calico/cni:v3.28.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/calico/cni:v3.28.0": failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/calico/cni/manifests/sha256:cef0c907b8f4cadc63701d371e6f24d325795bcf0be84d6a517e33000ff35f70: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
  Warning  Failed     40s (x4 over 2m2s)  kubelet            Error: ErrImagePull
  Normal   BackOff    13s (x6 over 2m1s)  kubelet            Back-off pulling image "docker.io/calico/cni:v3.28.0"
  Warning  Failed     13s (x6 over 2m1s)  kubelet            Error: ImagePullBackOff

사용자가 위에서 볼 수 있듯이 "
너무 많은 요청 - 서버 메시지: toomanyrequests: 풀 속도 제한에 도달했습니다. 인증 및 업그레이드를 통해 한도를 늘릴 수 있습니다. https://www.docker.com/increase-rate-limit"

原因

이 문제는 dockerhub에서 설정한 풀 속도 제한으로 인해 발생합니다. 자세한 내용은 https://www.docker.com/increase-rate-limit 를 참조하십시오.

解决方案

사용자가 인증된 Docker 허브 계정을 사용하는 경우 이는 사용자의 개별 끌어오기 속도 제한이 더 높을 수 있음을 의미합니다.
  1. docker.io 에서 계정 만들기 
  2. kube-system 네임스페이스에 시크릿을 생성합니다. 이 예제에서는 docker.io 에 계정을 등록하는 데 사용되는 자격 증명을 사용하여 regcred라는 보안 암호를 만듭니다
    kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=dockeriousername --docker-password=dockeriopassword --docker-email=emailusertoregsisterondockerio --namespace="kube-system"
  3. 사용자는 방금 생성된 암호(regcred)를 사용하도록 calico.yaml을 편집해야 합니다.
  4. template.spec 내에서 사용자는 다음을 포함해야 합니다.
    imagePullSecrets: 
            - name: regcred
     
    1. 참고로 실제 사례는 다음과 같습니다.
      spec:
        selector:
          matchLabels:
            k8s-app: calico-node
          ...
        template:
          metadata:
            labels:
              k8s-app: calico-node
          spec:
            nodeSelector:
             ...
            hostNetwork: true
            tolerations:
            ...
            serviceAccountName: calico-node
            ...
            initContainers:
            ...  
            imagePullSecrets: 
              - name: regcred
    2. 중요: calico-node 템플릿에만 imagePullSecrets 기능을 추가해야 합니다.
  5. 변경 후 calico.yaml을 적용합니다.
    kubectl apply -f calico.yaml
    poddisruptionbudget.policy/calico-kube-controllers created
    serviceaccount/calico-kube-controllers created
    serviceaccount/calico-node created
    serviceaccount/calico-cni-plugin created
    configmap/calico-config created
    customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/bgpfilters.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/caliconodestatuses.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/ipreservations.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
    customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
    clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
    clusterrole.rbac.authorization.k8s.io/calico-node created
    clusterrole.rbac.authorization.k8s.io/calico-cni-plugin created
    clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
    clusterrolebinding.rbac.authorization.k8s.io/calico-node created
    clusterrolebinding.rbac.authorization.k8s.io/calico-cni-plugin created
    daemonset.apps/calico-node created
    deployment.apps/calico-kube-controllers created
  1. 사용자는 Kubernetes 클러스터가 성공적으로 가동되고 실행되는 것을 확인해야 합니다.
    kubectl get po -A
    NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
    kube-system   local-path-provisioner-957fdf8bc-x5bn6     1/1     Running   0          22h
    kube-system   coredns-77ccd57875-hf82q                   1/1     Running   0          22h
    kube-system   calico-kube-controllers-8498bff86b-tprzt   1/1     Running   0          9m18s
    kube-system   calico-node-pxwqm                          1/1     Running   0          9m18s
    kube-system   metrics-server-648b5df564-xdh4h            1/1     Running   0          22h

     

受影响的产品

NativeEdge Solutions, NativeEdge
文章属性
文章编号: 000225940
文章类型: Solution
上次修改时间: 01 10月 2024
版本:  4
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。