V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
token10086
V2EX  ›  Kubernetes

腾讯轻量云是不能用 k8s,还是我手法的问题?

  •  
  •   token10086 · 356 天前 · 1923 次点击
    这是一个创建于 356 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这是报错

    Dec 07 22:03:15 tx kubelet[91712]: E1207 22:03:15.489984   91712 reflector.go:147] vendor/k8s.io/client-go/informers/factory.go:150: Failed to watch *v1.Node: failed to list *v1.Node: Get "https://x.x.x.x:6443/api/v1>
    Dec 07 22:03:16 tx kubelet[91712]: E1207 22:03:16.157267   91712 certificate_manager.go:562] kubernetes.io/kube-apiserver-client-kubelet: Failed while requesting a signed certificate from the control plane: cannot create ce>
    Dec 07 22:03:20 tx kubelet[91712]: E1207 22:03:20.391271   91712 controller.go:146] "Failed to ensure lease exists, will retry" err="Get \"https://X.X.X.X:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/l>
    Dec 07 22:03:22 tx kubelet[91712]: E1207 22:03:22.026037   91712 event.go:289] Unable to write event: '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"tx.179e918ab7ebab82", GenerateNam>
    Dec 07 22:03:24 tx kubelet[91712]: E1207 22:03:24.367220   91712 eviction_manager.go:258] "Eviction manager: failed to get summary stats" err="failed to get node info: node \"tx\" not found"
    Dec 07 22:03:26 tx kubelet[91712]: E1207 22:03:26.660965   91712 remote_runtime.go:193] "RunPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3>
    Dec 07 22:03:26 tx kubelet[91712]: E1207 22:03:26.661037   91712 kuberuntime_sandbox.go:72] "Failed to create sandbox for pod" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\":>
    Dec 07 22:03:26 tx kubelet[91712]: E1207 22:03:26.661076   91712 kuberuntime_manager.go:1171] "CreatePodSandbox for pod failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\">
    Dec 07 22:03:26 tx kubelet[91712]: E1207 22:03:26.661154   91712 pod_workers.go:1300] "Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"kube-scheduler-tx_kube-system(1c6a1bad98651d2a7376c9a70bb8fb34)\">
    Dec 07 22:03:27 tx kubelet[91712]: E1207 22:03:27.706740   91712 remote_runtime.go:193] "RunPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3>
    Dec 07 22:03:27 tx kubelet[91712]: E1207 22:03:27.706815   91712 kuberuntime_sandbox.go:72] "Failed to create sandbox for pod" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\":>
    Dec 07 22:03:27 tx kubelet[91712]: E1207 22:03:27.706847   91712 kuberuntime_manager.go:1171] "CreatePodSandbox for pod failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\">
    Dec 07 22:03:27 tx kubelet[91712]: E1207 22:03:27.706933   91712 pod_workers.go:1300] "Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"kube-apiserver-tx_kube-system(5617f506fd07414d9cb76ea4a78f5e81)\">
    Dec 07 22:03:29 tx kubelet[91712]: E1207 22:03:29.727216   91712 remote_runtime.go:193] "RunPodSandbox from runtime service failed" err="rpc error: code = DeadlineExceeded desc = failed to get sandbox image \"registry.k8s.i>
    Dec 07 22:03:29 tx kubelet[91712]: E1207 22:03:29.727289   91712 kuberuntime_sandbox.go:72] "Failed to create sandbox for pod" err="rpc error: code = DeadlineExceeded desc = failed to get sandbox image \"registry.k8s.io/pau>
    Dec 07 22:03:29 tx kubelet[91712]: E1207 22:03:29.727323   91712 kuberuntime_manager.go:1171] "CreatePodSandbox for pod failed" err="rpc error: code = DeadlineExceeded desc = failed to get sandbox image \"registry.k8s.io/pa>
    Dec 07 22:03:29 tx kubelet[91712]: E1207 22:03:29.727406   91712 pod_workers.go:1300] "Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"etcd-tx_kube-system(993f4dfd1d075a9c1dff31f40c2bc975)\" with Crea>
    Dec 07 22:03:30 tx kubelet[91712]: E1207 22:03:30.704584   91712 remote_runtime.go:193] "RunPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3>
    Dec 07 22:03:30 tx kubelet[91712]: E1207 22:03:30.704661   91712 kuberuntime_sandbox.go:72] "Failed to create sandbox for pod" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\":>
    Dec 07 22:03:30 tx kubelet[91712]: E1207 22:03:30.704711   91712 kuberuntime_manager.go:1171] "CreatePodSandbox for pod failed" err="rpc error: code = Unknown desc = failed to get sandbox image \"registry.k8s.io/pause:3.6\">
    Dec 07 22:03:30 tx kubelet[91712]: E1207 22:03:30.704796   91712 pod_workers.go:1300] "Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"kube-controller-manager-tx_kube-system(d651709561beb403538650cfbc>
    Dec 07 22:03:34 tx kubelet[91712]: E1207 22:03:34.368096   91712 eviction_manager.go:258] "Eviction manager: failed to get summary stats" err="failed to get node info: node \"tx\" not found"
    

    我发现 ipconfig 轻量云出的是内外 IP

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.0.16.14  netmask 255.255.252.0  broadcast 10.0.19.255
            inet6 fe80::5054:ff:fe42:8f11  prefixlen 64  scopeid 0x20<link>
            ether 52:54:00:42:8f:11  txqueuelen 1000  (Ethernet)
            RX packets 485541  bytes 128534575 (122.5 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 421857  bytes 99047230 (94.4 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    然后发了工单得到回复

    截图_选择区域_20231207221204.jpg

    1

    各位彦祖救救我!!

    这是不是说轻量云不能玩 k8s 了??

    那 k3s 能玩吗?????

    第 1 条附言  ·  355 天前
    我过关了兄弟们,写下我的通关步骤

    第一关
    修改 containerd 镜像
    ~# containerd config default > /etc/containerd/config.toml
    ~# sed -i "s#k8s.gcr.io/pause#registry.aliyuncs.com/google_containers/pause#g" /etc/containerd/config.toml

    修改 pause 镜像
    sandbox_image = "k8simage/pause:3.6"

    第二关

    [root@tx ~]# kubeadm init --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.28.4 --control-plane-endpoint= 外网 IP



    一定要去掉 --apiserver-advertise-address=外网 ip, 这会让 etcd 起不来
    一定要加上 --control-plane-endpoint= 外网 IP, 要不 join 不进去 node
    6 条回复    2023-12-08 10:38:54 +08:00
    Judoon
        1
    Judoon  
       356 天前
    没看明白,这个 eip 直通什么关系,报错不是 registry.k8s.io 镜像仓库连不上吗?
    zzjcool
        2
    zzjcool  
       356 天前
    failed to get sandbox image \"registry.k8s.io/pause:3.6\">
    你的是不是没有配置镜像加速,及其在国内
    beyondstars
        3
    beyondstars  
       356 天前
    您好,经分析日志,初步判断:

    1. kubelet 拉镜像时需要访问 registry.k8s.io
    2. 无法访问 registry.k8s.io
    3. 镜像拉取识别,Pod 起不来
    4. 导致 kubernetes cluster 起不来

    建议:解决如何访问镜像源的问题。
    jakes
        4
    jakes  
       356 天前 via iPhone
    K3s 可以起,我搭的就是 k3s
    johnzr
        5
    johnzr  
       355 天前
    1. 你这是源访问不了,换个国内的镜像源。

    2. K3S 可以玩,而且它提供了国内的安装方式,可以省个换源的事了。
    token10086
        6
    token10086  
    OP
       355 天前
    @Judoon
    @zzjcool
    @beyondstars

    感谢确实是访问问题更换源度过了第一关


    @jakes
    @johnzr

    我试了 k3s 一句命令就搞定了真方便,不过还是学习阶段用 k8s 走天龙八部试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1126 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 19:04 · PVG 03:04 · LAX 11:04 · JFK 14:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.