<reponame>reymont/seal

from kubernetes import client, config
from seal import settings


def main():
    #Token = "<KEY>"
    #APISERVER = 'https://192.168.100.111:6443'
    APISERVER = getattr(settings, 'APISERVER')
    Token = getattr(settings, 'Token')

    configuration = client.Configuration()
    configuration.host = APISERVER
    configuration.verify_ssl = False
    configuration.api_key = {"authorization": "Bearer " + Token}
    client.Configuration.set_default(configuration)
    v1 = client.CoreV1Api()
    ret = v1.list_pod_for_all_namespaces(watch=False)

    ret1  = v1.read_namespaced_pod("nginx-58bdcbcd-z8v2s","default")
    print(ret1)
    # for i in ret.items:
    #     print("%s\t%s\t%s" %
    #           (i.status.pod_ip, i.metadata.namespace, i.metadata.name))


if __name__ == '__main__':
    main()
from kubernetes import client, config
from seal import settings


def main():
    #Token = "<KEY>"
    #APISERVER = 'https://192.168.100.111:6443'
    APISERVER = getattr(settings, 'APISERVER')
    Token = getattr(settings, 'Token')

    configuration = client.Configuration()
    configuration.host = APISERVER
    configuration.verify_ssl = False
    configuration.api_key = {"authorization": "Bearer " + Token}
    client.Configuration.set_default(configuration)
    v1 = client.CoreV1Api()
    ret = v1.list_pod_for_all_namespaces(watch=False)

    ret1  = v1.read_namespaced_pod("nginx-58bdcbcd-z8v2s","default")
    print(ret1)
    # for i in ret.items:
    #     print("%s\t%s\t%s" %
    #           (i.status.pod_ip, i.metadata.namespace, i.metadata.name))


if __name__ == '__main__':
    main()
#Token = "<KEY>" #APISERVER = 'https://192.168.100.111:6443' # for i in ret.items: #     print("%s\t%s\t%s" % #           (i.status.pod_ip, i.metadata.namespace, i.metadata.name))