我有一个持久卷在正确的命名空间中运行:
apiVersion: v1
kind: PersistentVolume
metadata:
name: raw-data
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 2Gi
hostPath:
path: /data
storageClassName: storage
并且希望运行包含批量索赔模板的工作流:
...
volumeClaimTemplates:
- metadata:
name: raw-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 2Gi
我相信我的配置与这里描述的一致https://stackoverflow.com/a/52669115/213269然而,由于我在argo而不是kubernetes上工作,所以存在一些差异。我收到以下错误:
Unschedulable: 0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
问题:如何正确设置音量?
更新:
我已经尝试将一个持久卷部署到argo命名空间中,并从工作流中指向它,现在收到以下错误:
persistentvolumeclaims "workflow-name" is forbidden: User "system:serviceaccount:argo:argo" cannot get resource "persistentvolumeclaims" in API group "" in the namespace "argo"
我还在Kubernetes配置中添加了一个新的用户和上下文,但没有成功。
更新:
我添加了以下角色,现在错误已从";。。。用户无法获取资源"至";用户无法创建资源"请注意,我的用户确实有权创建persistentvolumeclaims。
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: workflow namespace: argo rules: - apiGroups: - "" resources: - pods verbs: - get - list - watch - create - update - patch - delete - apiGroups: - "" resources: - pods/log verbs: - get - list - watch - create - update - patch - delete - apiGroups: - "" resources: - persistentvolumeclaims verbs: - get - list - watch - create - update - patch - delete
这似乎是一个RBAC问题。请确保提交工作流的服务帐户具有对卷的读取访问权限。