Replies: 1 comment
-
Here is a basic apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: pvc-status-check
namespace: argo
spec:
templates:
- name: check-pvc-status
inputs: {}
outputs: {}
metadata: {}
script:
name: ""
image: bitnami/kubectl:latest
command:
- bash
resources: {}
source: |
# Get PVC name dynamically
PVC_NAME=$(kubectl get pvc | grep status-check-pvc | awk '{print $1}')
echo "PVC Name: $PVC_NAME"
# Fetch full PVC status details
echo "PersistentVolumeClaimStatus:"
kubectl get pvc $PVC_NAME -o jsonpath='{.status}' | jq .
entrypoint: check-pvc-status
arguments: {}
serviceAccountName: argo-workflow-sa
volumeClaimTemplates:
- metadata:
name: status-check-pvc
creationTimestamp: null
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {} Example output: PVC Name: pvc-status-check-l9cvw-status-check-pvc
PersistentVolumeClaimStatus:
{
"accessModes": [
"ReadWriteOnce"
],
"capacity": {
"storage": "1Gi"
},
"phase": "Bound"
} Also, to access the apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pvc-status-role
namespace: argo
rules:
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pvc-status-rolebinding
namespace: argo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pvc-status-role
subjects:
- kind: ServiceAccount
name: argo-workflow-sa
namespace: argo |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I couldn't find any example of using PersistentVolumeClaimStatus in workflow template. Neither google search nor bing copilot could find an example
Beta Was this translation helpful? Give feedback.
All reactions