gpt4 book ai didi

docker - Kubernetes + Gitlab CI人工制品:应该使用哪种体积?

转载 作者:行者123 更新时间:2023-12-02 12:17:54 25 4
gpt4 key购买 nike

我的Kubernetes集群中有一个正在运行的Gitlab CI管道。

当测试失败时,我需要从运行它的 Pane 中获取应用程序的屏幕截图和日志,以便在Gitlab Runner期望它们的位置可用。

我尝试使用kubectl cp <namespace>/<podname>:/in-pod-path /local/path从停止的pod中复制文件(在Docker镜像中安装了tar命令),但是使用it isn't yet supported

在此可用之前,我想我需要在保存人造物的路径上的 pods 中安装一个卷,以便在测试执行完成后从该卷中抓取它们。

我想知道我应该使用哪种类型的卷,因为我有3个kube worker,我不需要该卷随着时间的推移而持久,也不需要在节点之间共享更多的卷?

我希望在部署运行我的测试的Pod之前先部署该卷。当检测到测试失败时,我会将伪像提取到正确的位置,并删除容器和卷。

最佳答案

您可以尝试使用访问模式ReadWriteMany定义PVC,以便在多个Pod之间共享卷。
参见“How to share storage between Kubernetes pods?

它仍将是一个持久卷(以支持该卷),并且所有Pod都将调度到具有该卷的节点。

There are several volume types that are suitable for that and not tied to any cloud provider:

  • NFS
  • RBD (Ceph Block Device)
  • CephFS
  • Glusterfs
  • Portworx Volumes


但:

I don't really need to share the volume between many pods, I'm fine to create a volume per pods.
I'd like to avoid installing/configuring a node shared volume service from the list you gave.
I'm looking for an ephemeral volume if that is possible?



然后可以使用 ephemeral storage :

Kubernetes version 1.8 introduces a new resource, ephemeral-storage for managing local ephemeral storage. In each Kubernetes node, kubelet’s root directory (/var/lib/kubelet by default) and log directory (/var/log) are stored on the root partition of the node.
This partition is also shared and consumed by Pods via emptyDir volumes, container logs, image layers and container writable layers.



在您的情况下,您需要一个 runtime ephemeral storage

关于docker - Kubernetes + Gitlab CI人工制品:应该使用哪种体积?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54320859/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com