Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get the kubernetes default config, freeze pip dependencies #3

Merged
merged 3 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand Down Expand Up @@ -163,5 +163,5 @@ def log_message(self, format, *args):


if __name__ == '__main__':
httpd = ProxyHTTPServer(('127.0.0.1', 8080), partial(ProxyMetricsHandler, ProxyConfig()))
httpd = ProxyHTTPServer(('0.0.0.0', 8080), partial(ProxyMetricsHandler, ProxyConfig()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the pull request. openshift-prometheus-proxy deliberately binds to localhost only, so that it's only reachable via OAuth Proxy. This should still work on OCP 4 as the same configuration is used by the OCP 4 monitoring stack. Have you seen issues with this code on OCP 4?

httpd.serve_forever()
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openshift
68 changes: 67 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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