コード例 #1
0
            "email": "*****@*****.**",
            "git_repo": "https://github.com/fwalker-redhat/kube-tenant-adm-controller"}


def get_pods():
    config.load_incluster_config()
    v1 = client.CoreV1Api()
    print("Listing pods with their IPs:")
    ret = v1.list_pod_for_all_namespaces(watch=False)
    for i in ret.items:
        print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name))


health.add_check(api_available)
envdump.add_section("application", application_data)


@app.route('/')
def hello_world():
    logging.debug("Running validate")
    get_pods()
    return 'Hello World!'


app.add_url_rule("/healthz", "healthz", view_func=lambda: health.check())
app.add_url_rule("/environment", "environment", view_func=lambda: envdump.dump_environment())


if __name__ == '__main__':
    app.run()