AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[k3s](server)

Martin Hope
CodeFox
Asked: 2024-02-15 18:02:15 +0800 CST

“FailedMount:没有卷的挂起工作负载 Pod”是什么意思?

  • 6

在k3s集群(具有多个控制平面节点)和安装了Rancher Longhorn 的情况下,对于具有默认longhorn存储类的 pvc 的 pod,我观察到以下警告(输出为kubectl get events,wrapped 以提高可读性):

LAST SEEN   TYPE      REASON        OBJECT                      
113s        Warning   FailedMount   pod/grafana-6756f6587b-rv2xj

   MESSAGE
   MountVolume.SetUp failed for volume "pvc-7b6d12e3-132d-4af1-99c0-920ac5af0687" :
     rpc error:
       code = Aborted
       desc = no Pending workload pods for volume pvc-7b6d12e3-132d-4af1-99c0-920ac5af0687
              to be mounted: map[Running:[grafana-6756f6587b-rv2xj]]

这个反复出现的警告意味着什么以及需要采取什么措施来解决它?

至少从我在 Pod 容器中看到的情况来看,该卷已安装。我已经尝试重新启动 Pod 并重新创建 Pod,但警告仍然存在。longhorn 仪表板也没有显示任何问题。

请参阅下面的 pvc 和部署资源定义:

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-pvc
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  storageClassName: longhorn
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
  labels:
    app: grafana
spec:
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      securityContext:
        fsGroup: 472
        supplementalGroups:
          - 0
      containers:
        - name: grafana
          image: grafana/grafana:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000
              name: http-grafana
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /robots.txt
              port: 3000
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 30
            successThreshold: 1
            timeoutSeconds: 2
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 30
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 3000
            timeoutSeconds: 1
          resources:
            requests:
              cpu: 250m
              memory: 750Mi
          volumeMounts:
            - mountPath: /var/lib/grafana
              name: grafana-pv
      volumes:
        - name: grafana-pv
          persistentVolumeClaim:
            claimName: grafana-pvc
k3s
  • 1 个回答
  • 96 Views
Martin Hope
MikeBaz - MSFT
Asked: 2022-02-23 12:34:42 +0800 CST

使用共享令牌在所有节点上通过单个映像部署 k3os

  • 0

我正在尝试使用https://github.com/sgielen/picl-k3os-image-generator在一组 Raspberry Pi 节点上运行 k3os 集群。我成功地生成了图像,并且能够从它们启动。但是,即使我的每个配置文件中都有一个令牌条目(替换了令牌和密码):

k3os:
  token: K10e8c37ea0000000000000000000000000000002cbdaef2f8d7bd2f5b6931b4f52b::server:secret

当第一个节点启动时,似乎无论如何都会为集群生成一个新的秘密,这意味着其他节点无法加入。我知道我可以从集群中取出新令牌并重建图像,但我宁愿弄清楚如何拥有一个我创建一次并使用的图像。我确定我错过了一些愚蠢的东西......

k3s
  • 1 个回答
  • 212 Views
Martin Hope
tymur999
Asked: 2021-10-31 14:21:25 +0800 CST

Kubernetes pod 可以 ping 外部 IP,但不能 ping 任何域

  • 1

我有一个使用 Antrea CNI 的 Kubernetes 集群。

问题是我不能使用curl任何域名。

我可以nslookup在 pod 内进行操作并获取任何域的 IP,但我不能直接 curl 域。

例如,我不能卷曲https://google.com,但我可以卷曲https://1.1.1.1

我错过了什么,还是正常的?为了解决这个问题,我需要做什么?

这是 pod 的容器ip route show table all

default via 10.42.4.1 dev eth0 
10.42.4.0/24 dev eth0 scope link  src 10.42.4.26 
broadcast 10.42.4.0 dev eth0 table local scope link  src 10.42.4.26 
local 10.42.4.26 dev eth0 table local scope host  src 10.42.4.26 
broadcast 10.42.4.255 dev eth0 table local scope link  src 10.42.4.26 
broadcast 127.0.0.0 dev lo table local scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1 
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1 
fe80::/64 dev eth0  metric 256 
local ::1 dev lo table local  metric 0 
local fe80::e08c:e8ff:fef3:4877 dev eth0 table local  metric 0 
multicast ff00::/8 dev eth0 table local  metric 256

我的集群的 cidr 是 10.42.0.0/16

kubernetes k3s
  • 1 个回答
  • 1241 Views
Martin Hope
GoldElysium
Asked: 2021-10-22 02:52:30 +0800 CST

Kubernetes 无法启动:无法构建初始容器的映射

  • 1

从今天开始,k3s 无法启动并出现以下错误:"Failed to start ContainerManager" err="failed to build map of initial containers from runtime: no PodsandBox found with Id '9f141a500138e081ae1a641d7d4c00c3029ecce87da6e2fc80f4a14bd0a965fd'. 在此日志行之后,它崩溃了。

我在互联网上找不到任何东西,所以这里有人知道如何解决这个问题吗?

我正在运行 k3s 版本:k3s version v1.21.5+k3s2 (724ef700)

如果我需要提供更多详细信息,请告诉我。

日志:

...
I1021 12:04:55.508161   78816 kuberuntime_manager.go:222] "Container runtime initialized" containerRuntime="containerd" version="v1.4.11-k3s1" apiVersion="v1alpha2"
I1021 12:04:55.508361   78816 server.go:1191] "Started kubelet"
E1021 12:04:55.509247   78816 cri_stats_provider.go:369] "Failed to get the info of the filesystem with mountpoint" err="unable to find data in memory cache" mountpoint="/var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs"
E1021 12:04:55.509273   78816 kubelet.go:1306] "Image garbage collection failed once. Stats initialization may not have completed yet" err="invalid capacity 0 on image filesystem"
I1021 12:04:55.509255   78816 server.go:149] "Starting to listen" address="0.0.0.0" port=10250
I1021 12:04:55.509887   78816 server.go:409] "Adding debug handlers to kubelet server"
I1021 12:04:55.510952   78816 fs_resource_analyzer.go:67] "Starting FS ResourceAnalyzer"
I1021 12:04:55.512769   78816 scope.go:111] "RemoveContainer" containerID="e5ce1c151a24558e69f544794a15bb6d1238139439a0c6174acf720a4f531a7c"
I1021 12:04:55.512865   78816 volume_manager.go:271] "Starting Kubelet Volume Manager"
I1021 12:04:55.512923   78816 desired_state_of_world_populator.go:141] "Desired state populator starts to run"
INFO[2021-10-21T12:04:55.516702675+02:00] RemoveContainer for "e5ce1c151a24558e69f544794a15bb6d1238139439a0c6174acf720a4f531a7c" 
DEBU[2021-10-21T12:04:55.527595023+02:00] openat2 not available, falling back to securejoin 
I1021 12:04:55.538886   78816 controller.go:611] quota admission added evaluator for: leases.coordination.k8s.io
I1021 12:04:55.545188   78816 kubelet_network_linux.go:56] "Initialized protocol iptables rules." protocol=IPv4
I1021 12:04:55.561242   78816 kubelet_network_linux.go:56] "Initialized protocol iptables rules." protocol=IPv6
I1021 12:04:55.561266   78816 status_manager.go:157] "Starting to sync pod status with apiserver"
I1021 12:04:55.561282   78816 kubelet.go:1846] "Starting kubelet main sync loop"
E1021 12:04:55.561318   78816 kubelet.go:1870] "Skipping pod synchronization" err="[container runtime status check may not have completed yet, PLEG is not healthy: pleg has yet to be successful]"
I1021 12:04:55.571567   78816 shared_informer.go:247] Caches are synced for endpoint slice config 
I1021 12:04:55.571570   78816 shared_informer.go:247] Caches are synced for service config 
INFO[2021-10-21T12:04:55.604476442+02:00] RemoveContainer for "e5ce1c151a24558e69f544794a15bb6d1238139439a0c6174acf720a4f531a7c" returns successfully 
I1021 12:04:55.604584   78816 scope.go:111] "RemoveContainer" containerID="4d7578dd7f7574fd5deeae1ed53cf67d0a2fe64aa1d1214b1ba865622c05b4cd"
INFO[2021-10-21T12:04:55.604877204+02:00] labels have been set successfully on node: <node name>
INFO[2021-10-21T12:04:55.604936435+02:00] RemoveContainer for "4d7578dd7f7574fd5deeae1ed53cf67d0a2fe64aa1d1214b1ba865622c05b4cd" 
I1021 12:04:55.612875   78816 kuberuntime_manager.go:1044] "Updating runtime config through cri with podcidr" CIDR="10.42.0.0/24"
INFO[2021-10-21T12:04:55.612967745+02:00] No cni config template is specified, wait for other system components to drop the config. 
I1021 12:04:55.613044   78816 kubelet_network.go:76] "Updating Pod CIDR" originalPodCIDR="" newPodCIDR="10.42.0.0/24"
I1021 12:04:55.623215   78816 kubelet_node_status.go:71] "Attempting to register node" node="<node name>"
E1021 12:04:55.645403   78816 kubelet.go:1384] "Failed to start ContainerManager" err="failed to build map of initial containers from runtime: no PodsandBox found with Id '9f141a500138e081ae1a641d7d4c00c3029ecce87da6e2fc80f4a14bd0a965fd'"
kubernetes k3s
  • 1 个回答
  • 1556 Views
Martin Hope
P H Kaznowski
Asked: 2021-10-08 13:41:00 +0800 CST

Calicoctl 在新的 k3s 安装上拒绝证书

  • 0

我有全新安装的 Ubuntu、全新安装的 k3s 和全新下载的 calicoctl。我已经按照以下方式安装了它。

curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644"\
        INSTALL_K3S_EXEC="--flannel-backend=none --cluster-cidr=192.168.0.0/16\
        --disable-network-policy --disable=traefik" sh -

kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
kubectl create -f https://docs.projectcalico.org/manifests/custom-resources.yaml

curl -o calicoctl -O -L  "https://github.com/projectcalico/calicoctl/releases/download/v3.20.2/calicoctl"

当我运行 kubectl 时,一切正常。当我运行 calicoctl 时,出现证书错误。

# calicoctl apply -f V000_000-host-policy.yaml 
Unable to get Cluster Information to verify version mismatch: Get "https://127.0.0.1:6443/apis/crd.projectcalico.org/v1/clusterinformations/default": x509: certificate signed by unknown authority
Use --allow-version-mismatch to override.

我已经从to复制request-header-ca.crt和证书client-ca.crt并将它们应用于。我可以确认证书列在.server-ca.crt/var/lib/rancher/k3s/server/tls/usr/local/share/ca-certificatesupdate-ca-certificates/etc/ssl/certs/ca-certificates.crt

此外,我的~/.kube/config文件具有以下内容(我会定期重新安装,我希望这些都不是机密的 - 如果我错了,请纠正我)

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0t...LS0K
    server: https://127.0.0.1:6443
  name: default
contexts:
- context:
    cluster: default
    user: default
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
  user:
    client-certificate-data: LS0t...LS0K
    client-key-data: LS0t...LQo=

我有以下配置/etc/cni/net.d/calico-kubeconfig

# Kubeconfig file for Calico CNI plugin. Installed by calico/node.
apiVersion: v1
kind: Config
clusters:
- name: local
  cluster:
    server: https://10.43.0.1:443
    certificate-authority-data: "LS0t...tLS0K"
users:
- name: calico
  user:
    token: eyJhb...tk4Q
contexts:
- name: calico-context
  context:
    cluster: local
    user: calico
current-context: calico-context

我已将 calico-kubeconfig 中的地址从 更改为10.43.0.1:443,127.0.0.1:6443但这没有任何区别。

有谁知道如何解决这个问题?我看到的证书错误是 CA 或令牌的结果吗?卷曲到同一个地址也抱怨 CA,所以这让我认为这与令牌无关。

ssl kubernetes k3s calico
  • 2 个回答
  • 711 Views
Martin Hope
solveit
Asked: 2021-09-03 06:01:53 +0800 CST

如何删除 K3s 集群中除 kube-system 之外的所有命名空间

  • 2

我有一个带有系统 pod(即kube-system命名空间)和我的应用程序 pod 的 K3s 集群:

kube-system   pod/calico-node-xxxx                          
kube-system   pod/calico-kube-controllers-xxxxxx   
kube-system   pod/metrics-server-xxxxx
kube-system   pod/local-path-provisioner-xxxxx
kube-system   pod/coredns-xxxxx
app-system    pod/my-app-xxxx
db-system     pod/my-db-xxxxx

我正在寻找一个 shell/kubectl 命令(用于自动化脚本),它可以删除我的应用程序命名空间(想要修改kubectl delete namespace app-system db-system)而不在命令中提及应用程序命名空间名称(因为将来如果集群中有更多应用程序命名空间,我必须每次编辑此脚本)。

这意味着我想删除集群中的所有命名空间,除了 kube-system

类似的东西 - kubectl delete namespace -v kube-system(我知道-v这里不是一个有效的参数,只是展示了 grep-v是如何使用除了以下单词的。寻找类似的东西kubectl delete ns...)

kubernetes kubectl k3s
  • 3 个回答
  • 694 Views
Martin Hope
solveit
Asked: 2021-08-17 03:57:39 +0800 CST

如何重新启动或重置自定义命名空间 pod

  • 0

我有一个带有kube-systempod 和我的应用程序(xyz-system命名空间)pod 的 k3s 集群:

kube-system   pod/calico-node-xxxx                          
kube-system   pod/calico-kube-controllers-xxxxxx   
kube-system   pod/metrics-server-xxxxx
kube-system   pod/local-path-provisioner-xxxxx
kube-system   pod/coredns-xxxxx
xyz-system    pod/my-app
xyz-system    pod/my-app-mqtt

我想在一个命令中重置/重新启动所有这些 pod(kube-system + xyz-system)(或者它可以是两个命名空间但没有部署名称的两个命令)而不提供部署名称,因为将来我可以创建更多部署,因此很难手动提供许多部署名称。

调试:使用链接中提到的
命令 ,我可以重新启动pod。但是,当我使用以下命令修改此命令时:当我监控它们时,各个 pod 没有重新启动,它们仍然处于运行状态。kubectl -n kube-system rollout restart daemonsets,deploymentskube-systemxyz-namespacekubectl -n xyz-system rollout restart deploymentswatch kubectl get all -A

有人可以让我知道如何实现这一目标吗?

kubernetes k3s
  • 1 个回答
  • 1056 Views
Martin Hope
solveit
Asked: 2021-08-10 04:24:47 +0800 CST

如何重启或重置 K3s 集群 Pod

  • 2

我有一个带有以下 pod 的 k3s ( v1.21.1+ k3s1) 集群:

kube-system   pod/calico-node-xxxx                          
kube-system   pod/calico-kube-controllers-xxxxxx   
kube-system   pod/metrics-server-xxxxx
kube-system   pod/local-path-provisioner-xxxxx
kube-system   pod/coredns-xxxxx

如何使用命令(kubectl可能)或任何脚本重新启动(停止并再次启动 pod)pod?

kubernetes k3s
  • 1 个回答
  • 5471 Views
Martin Hope
solveit
Asked: 2021-08-03 20:42:46 +0800 CST

如何从我的 k3s 设置中手动删除由 calico 创建的 calicoctl 和 iptables

  • 1

我有一个运行印花布豆荚 [ calico-node-& calico-kube-controllers-] 的 K3s 设置。在卸载 K3s 时,calico pod 被删除,但我看到它calicoctl并且iptables -S命令仍在运行并显示数据。

我想彻底删除calico(包括calico创建的calicoctl和Iptables)。哪些命令可以帮助我这样做?

K3s 卸载命令: /usr/local/bin/k3s-uninstall.sh删除所有 k3s pod,包括 calico,但calicoctl仍然iptables -S有效。

PS:我已经尝试了几件事-

  1. 命令kubectl delete -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/release-1.5/config/v1.5/calico.yaml删除calico-node-but calico-kube-controller,calicoctl并且iptables -S仍然存在
  2. Kubectl delete这个队列中的命令也对我不起作用,在执行这两个命令之后calicoctl仍然iptables -S存在
kubernetes k3s calico
  • 2 个回答
  • 2249 Views
Martin Hope
spi
Asked: 2021-01-15 08:13:24 +0800 CST

在一个节点上调度 pod 并在另一个节点上访问 pv

  • 1

我在 RPi4 上运行一个 k3s 集群,具有异构配置(一个节点容量大但硬盘速度慢,另一个节点有一个 ssd 驱动器,第三个节点只有一个 sd 卡)。

我有持久的卷和“本地路径”类型的声明,根据我的需要附加到节点和 Pod。

我面临这样一种情况,我需要在没有磁盘的节点上安排一个 pod 来处理使用 ssd 磁盘存储在节点中的数据(使用 ffmpeg 将一些视频文件重新编码为 mp4,因为这是一个昂贵的过程,我'想在空闲节点上执行此操作,而不是减慢运行 ssd 的节点)。

是否可以从不同的节点透明地挂载 PV?我需要使用一些 nfs 吗?是否有更进化的卷类型可用于裸机 RPi4 来做我想要的?

查看文档并没有太大帮助(有大量不同的持久卷类型,描述的用例不多)。

谢谢

kubernetes k3s
  • 1 个回答
  • 390 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve