diff --git a/app.py b/app.py index 6be048d..c3c8962 100755 --- a/app.py +++ b/app.py @@ -44,7 +44,7 @@ def __init__(self): else: # App is running on a developer workstation kubernetes.config.load_kube_config() - self.k8s_config = kubernetes.client.Configuration() + self.k8s_config = kubernetes.client.Configuration().get_default_copy() self.service_account_token = self.k8s_config.api_key['authorization'].partition(' ')[2] @@ -163,5 +163,6 @@ def log_message(self, format, *args): if __name__ == '__main__': + # only listen for connections from ose-oauth-proxy in the same pod (see template/openshift-prometheus-proxy.yaml) httpd = ProxyHTTPServer(('127.0.0.1', 8080), partial(ProxyMetricsHandler, ProxyConfig())) httpd.serve_forever() diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..269bf09 --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +openshift diff --git a/requirements.txt b/requirements.txt index 269bf09..ff16436 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,67 @@ -openshift +# +# This file is autogenerated by pip-compile with python 3.6 +# To update, run: +# +# pip-compile requirements.in +# +cachetools==4.2.4 + # via google-auth +certifi==2021.10.8 + # via + # kubernetes + # requests +charset-normalizer==2.0.7 + # via requests +google-auth==2.3.3 + # via kubernetes +idna==3.3 + # via requests +jinja2==3.0.2 + # via openshift +kubernetes==12.0.1 + # via openshift +markupsafe==2.0.1 + # via jinja2 +oauthlib==3.1.1 + # via requests-oauthlib +openshift==0.12.1 + # via -r requirements.in +pyasn1==0.4.8 + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.2.8 + # via google-auth +python-dateutil==2.8.2 + # via kubernetes +python-string-utils==1.0.0 + # via openshift +pyyaml==6.0 + # via kubernetes +requests==2.26.0 + # via + # kubernetes + # requests-oauthlib +requests-oauthlib==1.3.0 + # via kubernetes +rsa==4.7.2 + # via google-auth +ruamel.yaml==0.17.17 + # via openshift +ruamel.yaml.clib==0.2.6 + # via ruamel.yaml +six==1.16.0 + # via + # google-auth + # kubernetes + # openshift + # python-dateutil +urllib3==1.26.7 + # via + # kubernetes + # requests +websocket-client==1.2.1 + # via kubernetes + +# The following packages are considered to be unsafe in a requirements file: +# setuptools