- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我在 2 个命名空间中有 2 个 PVC,绑定(bind)到 1 个 PV:
以下是PVC:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-git
namespace: mlo-dev
labels:
type: local
spec:
storageClassName: mlo-git
volumeMode: Filesystem
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-git
namespace: mlo-stage
labels:
type: local
spec:
storageClassName: mlo-git
volumeMode: Filesystem
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
和 PV:
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-git
labels:
type: local
spec:
storageClassName: mlo-git
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
hostPath:
path: /git
在命名空间“mlo-dev”中,绑定(bind)成功:
$ kubectl describe pvc pvc-git -n mlo-dev
Name: pvc-git
Namespace: mlo-dev
StorageClass: mlo-git
Status: Bound
Volume: pv-git
Labels: type=local
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 1Gi
Access Modes: RWX
VolumeMode: Filesystem
Mounted By:
...
various different pods here...
...
Events: <none>
而在命名空间“mlo-stage”中,绑定(bind)失败并显示错误消息: storageclass.storage.k8s.io "mlo-git"not found
$ kubectl describe pvc pvc-git -n mlo-stage
Name: pvc-git
Namespace: mlo-stage
StorageClass: mlo-git
Status: Pending
Volume:
Labels: type=local
Annotations: Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Mounted By:
...
various different pods here...
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 3m4s (x302 over 78m) persistentvolume-controller storageclass.storage.k8s.io "mlo-git" not found
据我所知,PV 不限于命名空间,因此不同命名空间中的 PVC 应该可以绑定(bind)到同一个 PV?
$ kubectl describe pv pv-git
Name: pv-git
Labels: type=local
Annotations: pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass: mlo-git
Status: Bound
Claim: mlo-dev/pvc-git
Reclaim Policy: Retain
Access Modes: RWX
VolumeMode: Filesystem
Capacity: 1Gi
Node Affinity: <none>
Message:
Source:
Type: HostPath (bare host directory volume)
Path: /git
HostPathType:
Events: <none>
最佳答案
我试图重现您的场景(但是,如果您将提供您的 storageclass
yaml 以精确复制,并更改 AccessMode
以进行测试),我认为这种行为是正确的(按设计工作)。
当您要检查特定对象是否为 namespaced
时你可以使用命令:
$ kubectl api-resources | grep pv
persistentvolumeclaims pvc true PersistentVolumeClaim
persistentvolumes pv false PersistentVolume
如
PVC
是真的它的平均值
pvc
被命名空间,并且
PV
不是。
taken
并且在那一刻不能再次使用。
您应该创建第二个 PV
. 它可以改变取决于
reclaimPolicy
以及
pop
发生了什么/
deployment
我猜你正在使用
Static供应。
A cluster administrator creates a number of PVs. They carry the details of the real storage, which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption.
PV
至 1
PVC
.
When none of the static PVs the administrator created match a user's PersistentVolumeClaim, the cluster may try to dynamically provision a volume specially for the PVC. This provisioning is based on StorageClasses: the PVC must request a storage class and the administrator must have created and configured that class for dynamic provisioning to occur.
PVC
绑定(bind)到
PV
.由于 GKE 正在使用
Dynamic provisioning
, 当您仅定义
PVC
它使用了
default storageclass
并自动创建
PV
.
$ kubectl get pv,pvc -A
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pv-git 1Gi RWO Retain Bound mlo-dev/pvc-git mlo-git 15s
persistentvolume/pvc-e7a1e950-396b-40f6-b8d1-8dffc9a304d0 1Gi RWO Delete Bound mlo-stage/pvc-git mlo-git 6s
NAMESPACE NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mlo-dev persistentvolumeclaim/pvc-git Bound pv-git 1Gi RWO mlo-git 10s
mlo-stage persistentvolumeclaim/pvc-git Bound pvc-e7a1e950-396b-40f6-b8d1-8dffc9a304d0 1Gi RWO mlo-git 9s
解决方案
PersistentVolume
绑定(bind)第二个
PVC
.
PVC
的更多信息查看
this SO thread .
PV
帮不上忙 ,请提供有关您的环境(Minikube/Kubeadm、K8s 版本、操作系统等)和您的
storageclass
的更多详细信息YAML。
关于Kubernetes:2个命名空间中的2个PVC绑定(bind)到同一个PV,一个成功,一个失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63864416/
我有一个 Kubernetes 集群设置(本地),它有一个 NFS 共享(my-nfs.internal.tld)安装到 /exports/backup在每个节点上创建备份。 现在我正在设置我的日志记
开发商! 我遇到了错误消息 Error in if (obs 通过分配 x = nrstp$V3和 weight = invdist , 你会得到 mean(x) = 0 .这导致 y=0 , c
根据官方文档 https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/使用“保留”策略可以手动恢复 P
环境信息: Computer detail: One master node and four slave nodes. All are CentOS Linux release 7.8.2003 (
我正在尝试了解Kubernetes如何处理节点文件系统上的持久卷。 例如,如果我有一个minikube作为我的Kubernetes集群节点,并且我用PVC为may pod创建了多个PV,并且我通过ss
有状态集 es-data 在我们的测试环境中失败,我被要求删除相应的 PV。 所以我删除了es-data的以下内容: 1) 聚氯乙烯 2) 光伏 他们显示为终止并被留在周末。今天早上到达时,他们仍然显
我可以将同一个 PV 的不同子路径挂载到同一个容器的不同位置吗? 我在我公司的 Kubernetes 集群上运行了几个 wordpress 实例。每个实例都有自己的持久性卷和容器。我的设置的唯一特点是
我一直在努力运行简单的3节点Kubernetes集群。 $ kubectl get nodes
我正在开发PV(光伏)模块特性图的模拟应用程序。需要帮助,因为我不太了解电学,无法将公式适应 Java 代码。 I = f(V) function (I-V characteristic) 和 P =
我有一个 3 节点 coros kubernetes 集群启动并运行。 我想使用来自独立 NFS 服务器的 persitentvolumes(pv)。 nfs.yaml apiVersion: v1
如果我运行 mkdir -pv,-p 可以工作,但我没有得到详细的输出;但是,如果我只运行 mkdir -v,则会出现预期的详细输出。同样值得注意的是,-v 的长格式似乎根本不起作用。 根据我的测试:
'/usr/local/bin/wave' 只接受文件名作为输入,因此我需要调用该过程,然后“发送”命令,并等待写入输出文件。然后我的进程可以继续读取输出文件。这是我的代码,它不会写入输出文件: hd
因此,我尝试将文件的输出(使用 get 检索)提供到日志文件中。 我拥有的是这样的: get whateverfile | pv > somefile.log 我也尝试过用 xargs 来喂养它:
我正在做备份 dd if=/dev/vda1 | lzop >/etc/BACKUP/im.lzo 我想使用命令 pv 查看进度条,但我不知道正确的语法是什么。 我试过: pv dd if=/dev/
我正在尝试制作一个小脚本来显示目录在磁盘上使用的总存储空间。为了弄清楚我正在使用 du 命令。但是,为了在 DU 处理一个非常大的目录时向用户提供一些反馈,我想通过管道运行输出并显示行数,这样用户也可
所以我正在尝试使用 PV 为各种命令(即 tar)创建进度条。我在 ruby 脚本中运行这些命令。问题在于,由于 pv 是管道链中的最后一个命令,它吸收了所有错误。 即。 result = `ta
我正在使用 pv 实用程序来评估将日志条目添加到日志文件中的速度,如下所示: tail -f -n 0 mylog.log | pv -lr -t -i 5 > /dev/null 这会输出添加速度并
欢迎访问我的GitHub 这里分类和汇总了欣宸的全部原创(含配套源码): https://github.com/zq2599/blog_demos 本篇概览 欣
我这个想法源自4月份的Twitter开发者大会,公布数据是Twitter日访问量30亿,年增长1500%,日搜索请求6亿,日独立访问者1.8亿,每天5500万个Tweets,所有这些主要都是通过AP
我的学士论文有点卡住了,希望你能帮助我。为了评估光伏系统,我需要计算总能量之间的差异。这些在带有时间戳但没有 ID 号的 MySQL 表中自动更新。我需要自动获取这些能量之间的增量/差异作为额外的列,
我是一名优秀的程序员,十分优秀!