Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy PVC inspection plugin #2660

Open
leomichalski opened this issue Apr 17, 2024 · 1 comment
Open

Easy PVC inspection plugin #2660

leomichalski opened this issue Apr 17, 2024 · 1 comment

Comments

@leomichalski
Copy link




Is your feature request related to a problem? Please describe.
Too much hassle to inspect volume contents.

Describe the solution you'd like
I just wrote a plugin to inspect the folders inside a PVC. Should I open a PR to the plugins folder?

Describe alternatives you've considered
I thought about integrating it in k9s, but I'm not sure if there's a docker image that everyone would consider safe to use. Any thoughts on this?

Additional context
Here's the plugin:

plugins:
  inspect-pvc:
    shortCut: s
    confirm: false
    description: Explore PVC
    scopes:
    - persistentvolumeclaims
    command: sh
    background: false
    args:
      - -c
      - |
        kubectl run --rm -it k9s-inspecting-${NAMESPACE}-${NAME} --image=busybox --restart=Never --namespace ${NAMESPACE} --context ${CONTEXT} --overrides='{
            "spec": {
                "containers": [
                    {
                        "image": "busybox",
                        "name": "k9s-inspecting-${NAMESPACE}-${NAME}",
                        "volumeMounts": [
                            {
                                "mountPath": "/inspecting-pvc-${NAMESPACE}-${NAME}",
                                "name": "k9s-inspected-pvc"
                            }
                        ],
                        "workingDir": "/inspecting-pvc-${NAMESPACE}-${NAME}",
                        "stdin": true,
                        "tty": true,
                        "imagePullPolicy": "Always"
                    }
                ],
                "volumes": [
                    {
                        "name": "k9s-inspected-pvc",
                        "persistentVolumeClaim": {
                            "claimName": "${NAME}"
                        }
                    }
                ]
            }
        }' --command -- sh
@leomichalski
Copy link
Author

Based on https://frank.sauerburger.io/2021/12/01/inspect-k8s-pvc.html by @sauerburger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant