Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Created August 7, 2018 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save random-robbie/7ceab7acfb02f98f52adb4305f2b436f to your computer and use it in GitHub Desktop.
Save random-robbie/7ceab7acfb02f98f52adb4305f2b436f to your computer and use it in GitHub Desktop.

Grabbing Namespace and POD and container from kubernetes API.

{
      "metadata": {
        "name": "spinnaker-k8spray-clouddriver-566c56787c-l6mnj",
        "namespace": "k8spray",
        "uid": "e36e6e6e-8974-11e8-9663-02ceba770664",
        "creationTimestamp": null
      },
      "spec": {
        "containers": [
          {
            "name": "clouddriver",
            "image": "quay.io/spinnaker/clouddriver@sha256:60a9b2f79207a8f70db93db981546350d6fd412e0e1f03640cc2f4bec35fc23c",
            "resources": {}
          }
        ]
      }

So in this example the name space is k8spray the pod name is spinnaker-k8spray-clouddriver-566c56787c-l6mnj container is clouddriver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment