如何为 argo 正确配置卷?
How can I properly provision a volume for argo?
我在正确的命名空间中有一个持久卷 运行ning:
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
我相信我的配置与这里描述的一致
但是,由于我使用的是 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 问题。确保您提交工作流程所用的服务帐户具有卷的读取权限。
我在正确的命名空间中有一个持久卷 运行ning:
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
我相信我的配置与这里描述的一致
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 问题。确保您提交工作流程所用的服务帐户具有卷的读取权限。