-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwsgi.py
More file actions
27 lines (20 loc) · 789 Bytes
/
wsgi.py
File metadata and controls
27 lines (20 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from flask import Flask, make_response
from openbrokerapi import api, log_util
from helmbroker.broker import HelmServiceBroker
from helmbroker.config import Config
application = Flask("helmbroker")
@application.route("/healthz")
def healthz():
return "OK"
@application.route("/readiness")
def readiness():
if "KUBECONFIG" in os.environ:
return "OK"
elif ("KUBERNETES_SERVICE_HOST" in os.environ
or "KUBERNETES_CLUSTER_DOMAIN" in os.environ) \
and "KUBERNETES_SERVICE_PORT" in os.environ:
return "OK"
return make_response("kubernetes not available", 500)
application.config.from_object(Config)
application.register_blueprint(api.get_blueprint(HelmServiceBroker(), api.BrokerCredentials("", ""), log_util.basic_config()))