Created
February 18, 2016 07:00
-
-
Save aborilov/3c4116ec494d3d88d7b1 to your computer and use it in GitHub Desktop.
get pod from kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import requests | |
resp = requests.get('https://127.0.0.1/api/podapi', auth=('test', '1'), verify=False) | |
pods = resp.json() | |
namespace = pods['data'][0]['id'] | |
resp = requests.get('http://localhost:8080/api/v1/namespaces/{}/pods'.format(namespace)) | |
pod = resp.json() | |
print pod['items'][0]['spec']['containers'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment