Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from kubernetes import config,client
- configuration = kubernetes.client.Configuration()
- configuration.api_key['authorization'] = 'my decoded token from service account'
- configuration.api_key_prefix['authorization'] = 'Bearer'
- configuration.ssl_ca_cert = '/etc/secret-volume/ca-cert-chain'
- configuration.cert_file = 'cert.crt'
- configuration.key_file = '/etc/secret-volume/secret-key'
- configuration.verify_ssl = False
- configuration.assert_hostname = False
- v1 = kubernetes.client.CoreV1Api(kubernetes.client.ApiClient(configuration))
- @app.route('/pods')
- def pods():
- ret = v1.list_pod_for_all_namespaces(watch=False)
- return jsonify(ret)
- kubernetes.client.rest.ApiException: (404)
- Reason: NOT FOUND
- HTTP response headers: HTTPHeaderDict({'Content-Length': '233', 'Content-Type': 'text/html', 'Date': 'Tue, 17 Jul 2018 22:47:02 GMT', 'Server': 'Werkzeug/0.14.1 Python/3.5.5'})
- HTTP response body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
- curl https://192.168.64.11:8443/api/v1/namespaces/my-namespace/pods --
- cert ~/.minikube/apiserver.crt --key ~/.minikube/apiserver.key --cacert
- ~/.minikube/ca.crt
Add Comment
Please, Sign In to add comment