maclof / kubernetes-client

A simple yet elegant client for accessing and controlling a Kubernetes cluster (https://github.com/kubernetes/kubernetes)
MIT License
232 stars 82 forks source link

Add support for ephemeral containers #109

Closed brucedevcom closed 1 year ago

brucedevcom commented 2 years ago

This PR adds a debug() function to pod repositories which allows you to attach an ephemeral container to a running pod.

Functionally similar to kubectl debug but providing the ability to provide an entire EphemeralContainer spec (see: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#ephemeralcontainer-v1-core)

The $spec param should be an array of a strategic merge patch, ie:

[
    "spec" => [
        "ephemeralContainers" => [
            ...
        ]
    ]
]