mirror of
https://github.com/auricom/home-cluster.git
synced 2025-10-02 08:47:17 +02:00
feat: overhaul
This commit is contained in:
51
.taskfiles/kubernetes/Taskfile.yaml
Normal file
51
.taskfiles/kubernetes/Taskfile.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
|
||||
mount:
|
||||
desc: Mount a PersistentVolumeClaim to a temporary pod
|
||||
summary: |
|
||||
Args:
|
||||
ns: Namespace the PVC is in (default: default)
|
||||
claim: PVC to mount (required)
|
||||
interactive: true
|
||||
cmd: |
|
||||
kubectl run -n {{.ns}} debug-{{.claim}} -i --tty --rm --image=null --privileged --overrides='
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "debug",
|
||||
"image": "cgr.dev/chainguard/wolfi-base",
|
||||
"command": ["sleep","9999999"],
|
||||
"stdin": true,
|
||||
"stdinOnce": true,
|
||||
"tty": true,
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "config",
|
||||
"mountPath": "/config"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"volumes": [
|
||||
{
|
||||
"name": "config",
|
||||
"persistentVolumeClaim": {
|
||||
"claimName": "{{.claim}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Never"
|
||||
}
|
||||
}'
|
||||
requires:
|
||||
vars: [claim]
|
||||
vars:
|
||||
ns: '{{.ns | default "default"}}'
|
||||
preconditions:
|
||||
- { msg: PVC not found, sh: "kubectl -n {{.ns}} get persistentvolumeclaim {{.claim}}" }
|
Reference in New Issue
Block a user