kubernetes k3s问题与lxe是抛出磁盘大小和imagepulling错误

btxsgosb  于 12个月前  发布在  Kubernetes
关注(0)|答案(1)|浏览(185)

我已经创建了一个小集群,并遵循this,它抛出了一些错误,在此issue中提到。除了这个问题,我已经从容器中复制了我的本地lxc镜像。我已经将其推送到我的vm,其中pod将被调度。lxc image list验证镜像在那里,但当它试图部署我的pod时,我仍然得到这些错误。

2m15s                   Normal    Scheduled                 Pod/lxc-deployment-54c4fc4d68-c52zh    Successfully assigned default/lxc-deployment-54c4fc4d68-c52zh to nodek2
113s (x11 over 51m)     Warning   InvalidDiskCapacity       Node/nodek2                            invalid capacity 0 on image filesystem
113s (x10 over 46m)     Warning   ImageGCFailed             Node/nodek2                            invalid capacity 0 on image filesystem
108s (x4 over 2m15s)    Warning   ErrImageNeverPull         Pod/lxc-deployment-54c4fc4d68-c52zh    Container image "nginx-image" is not present with pull policy of Never
108s (x4 over 2m15s)    Warning   Failed                    Pod/lxc-deployment-54c4fc4d68-c52zh    Error: ErrImageNeverPull

字符串
我的部署很简单。

metadata:
  name: lxc-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: lxc-container
  template:
    metadata:
      labels:
        app: lxc-container
    spec:
      containers:
      - name: lxc-container
        image: nginx-image
        imagePullPolicy: Never
        ports:
        - containerPort: 80
        command: ["/bin/sh"]
        args: ["-c", "echo 'Hello from Container $HOSTNAME'"]
      nodeSelector:
       containerruntime: lxd
      tolerations:
        - key: containerruntime
          operator: Exists

kninwzqo

kninwzqo1#

问题解决了。kubernetes不能直接通过docker或containerd读取lxc镜像,你必须将其转换为docker,或者你必须使用lxe容器运行时来使用k8的lxc镜像。

相关问题