#49 REDIS_URL configuration
This commit is contained in:
@@ -106,12 +106,14 @@ The following environment variables are supported:
|
||||
Set to "true" for local development to reload code changes.
|
||||
``MOCK``
|
||||
Set to "true" to mock Kubernetes cluster data.
|
||||
``REDIS_URL``
|
||||
Optional Redis server to use for pub/sub events and job locking when running more than one replica.
|
||||
|
||||
|
||||
Supported Browsers
|
||||
==================
|
||||
|
||||
The UI uses WebGL and ECMAScript 6 features.
|
||||
The UI uses WebGL, ECMAScript 6, and EventSource features.
|
||||
The following browsers are known to work:
|
||||
|
||||
* Chrome/Chromium 53.0+
|
||||
|
||||
4
app.py
4
app.py
@@ -24,6 +24,7 @@ from flask import Flask, redirect
|
||||
from flask_oauthlib.client import OAuth, OAuthRemoteApp
|
||||
from urllib.parse import urljoin
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
class MemoryStore:
|
||||
def __init__(self):
|
||||
@@ -54,7 +55,7 @@ class MemoryStore:
|
||||
|
||||
class RedisStore:
|
||||
def __init__(self, url):
|
||||
self._url = url
|
||||
logging.info('Connecting to Redis on {}..'.format(url))
|
||||
self._redis = redis.StrictRedis.from_url(url)
|
||||
self._redlock = Redlock([url])
|
||||
|
||||
@@ -375,7 +376,6 @@ def update():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
http_server = gevent.wsgi.WSGIServer(('0.0.0.0', SERVER_PORT), app)
|
||||
gevent.spawn(update)
|
||||
logging.info('Listening on :{}..'.format(SERVER_PORT))
|
||||
|
||||
@@ -28,6 +28,9 @@ spec:
|
||||
port: 8080
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 1
|
||||
env:
|
||||
- name: REDIS_URL
|
||||
value: kube-ops-view-redis:6379
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
|
||||
Reference in New Issue
Block a user