Merge branch 'tmszdmsk-random-pod-labels'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.5
|
||||
FROM alpine:3.6
|
||||
MAINTAINER Henning Jacobs <henning@jacobs1.de>
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
6
Makefile
6
Makefile
@@ -3,7 +3,7 @@
|
||||
IMAGE ?= hjacobs/kube-ops-view
|
||||
VERSION ?= $(shell git describe --tags --always --dirty)
|
||||
TAG ?= $(VERSION)
|
||||
GITHEAD = $(shell git rev-parse --short HEAD)
|
||||
GITHEAD = $(shell git rev-parse HEAD)
|
||||
GITURL = $(shell git config --get remote.origin.url)
|
||||
GITSTATUS = $(shell git status --porcelain || echo "no changes")
|
||||
TTYFLAGS = $(shell test -t 0 && echo "-it")
|
||||
@@ -17,8 +17,8 @@ test:
|
||||
tox
|
||||
|
||||
appjs:
|
||||
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:7.4-alpine npm install
|
||||
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:7.4-alpine npm run build
|
||||
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:8.4-alpine npm install
|
||||
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:8.4-alpine npm run build
|
||||
|
||||
docker: appjs scm-source.json
|
||||
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
|
||||
|
||||
@@ -52,6 +52,13 @@ You can run the app locally with ``kubectl proxy`` against your running cluster:
|
||||
$ kubectl proxy &
|
||||
$ docker run -it --net=host hjacobs/kube-ops-view
|
||||
|
||||
If you are using Docker for Mac, this needs to be slightly different in order to navigate the VM/container inception:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kubectl proxy --accept-hosts '.*' &
|
||||
$ docker run -it -p 8080:8080 -e CLUSTERS=http://docker.for.mac.localhost:8001 hjacobs/kube-ops-view
|
||||
|
||||
Now direct your browser to http://localhost:8080
|
||||
|
||||
You can also try the UI with the integrated mock mode. This does not require any Kubernetes cluster access:
|
||||
|
||||
3823
app/package-lock.json
generated
Normal file
3823
app/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -26,20 +26,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/hjacobs/kube-ops-view#readme",
|
||||
"dependencies": {
|
||||
"pixi.js": "^4.3.2",
|
||||
"babel-runtime": "^6.20.0",
|
||||
"babel-polyfill": "^6.20.0"
|
||||
"pixi.js": "^4.5.5",
|
||||
"babel-runtime": "^6.26.0",
|
||||
"babel-polyfill": "^6.26.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.21.0",
|
||||
"babel-loader": "^6.2.10",
|
||||
"babel-preset-es2015": "^6.18.0",
|
||||
"babel-plugin-transform-runtime": "^6.15.0",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"brfs": "^1.4.3",
|
||||
"eslint": "^3.13.1",
|
||||
"eslint-loader": "^1.6.1",
|
||||
"rimraf": "^2.5.4",
|
||||
"transform-loader": "^0.2.3",
|
||||
"webpack": "^1.14.0"
|
||||
"eslint": "^4.5.0",
|
||||
"eslint-loader": "^1.9.0",
|
||||
"rimraf": "^2.6.1",
|
||||
"transform-loader": "^0.2.4",
|
||||
"webpack": "^3.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ var path = require('path'),
|
||||
module.exports = {
|
||||
context: path.join(__dirname, './'),
|
||||
entry: entry,
|
||||
debug: DEBUG,
|
||||
target: 'web',
|
||||
devtool: DEBUG ? 'inline-source-map' : false,
|
||||
output: {
|
||||
@@ -22,23 +21,21 @@ module.exports = {
|
||||
fs: 'empty'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin()
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
debug: DEBUG
|
||||
})
|
||||
],
|
||||
module: {
|
||||
preLoaders: [
|
||||
{test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/}
|
||||
],
|
||||
loaders: [
|
||||
rules: [
|
||||
{enforce: 'pre', test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/},
|
||||
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', query: {plugins: ['transform-runtime'], presets: ['es2015']}},
|
||||
{test: /\.html$/, exclude: /node_modules/, loader: 'file-loader?name=[path][name].[ext]'},
|
||||
{test: /\.jpe?g$|\.svg$|\.png$/, exclude: /node_modules/, loader: 'file-loader?name=[path][name].[ext]'},
|
||||
{test: /\.json$/, exclude: /node_modules/, loader: 'json'},
|
||||
{test: /\.(otf|eot|svg|ttf|woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=8192&mimetype=application/font-woff'},
|
||||
{test: /\.json$/, include: path.join(__dirname, 'node_modules', 'pixi.js'), loader: 'json'}
|
||||
],
|
||||
postLoaders: [{
|
||||
include: path.resolve(__dirname, 'node_modules/pixi.js'),
|
||||
loader: 'transform?brfs'
|
||||
}]
|
||||
{test: /\.json$/, include: path.join(__dirname, 'node_modules', 'pixi.js'), loader: 'json'},
|
||||
{enforce: 'post', include: path.resolve(__dirname, 'node_modules/pixi.js'), loader: 'transform-loader?brfs'}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
application: kube-ops-view
|
||||
version: v0.0.1
|
||||
version: v0.7.1
|
||||
name: kube-ops-view
|
||||
spec:
|
||||
replicas: 1
|
||||
@@ -14,13 +14,15 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
application: kube-ops-view
|
||||
version: v0.0.1
|
||||
version: v0.7.1
|
||||
spec:
|
||||
serviceAccount: kube-ops-view
|
||||
containers:
|
||||
- name: service
|
||||
image: hjacobs/kube-ops-view:latest
|
||||
# see https://github.com/hjacobs/kube-ops-view/releases
|
||||
image: hjacobs/kube-ops-view:0.7.1
|
||||
args:
|
||||
# remove this option to use built-in memory store
|
||||
- --redis-url=redis://kube-ops-view-redis:6379
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
@@ -2,9 +2,6 @@ apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: kube-ops-view
|
||||
annotations:
|
||||
# this annotation is specific to https://github.com/zalando-incubator/kube-ingress-aws-controller
|
||||
zalando.org/aws-load-balancer-ssl-cert: arn:aws:acm:eu-central-1:123456789123:certificate/12345678-4246-47b0-8884-123456789088
|
||||
spec:
|
||||
rules:
|
||||
- host: "kube-ops-view.example.org"
|
||||
|
||||
@@ -19,8 +19,19 @@ def generate_mock_pod(index: int, i: int, j: int):
|
||||
'log-lady',
|
||||
'sheriff-truman',
|
||||
]
|
||||
labels = {
|
||||
'env': ['prod', 'dev'],
|
||||
'owner': ['x-wing', 'iris']
|
||||
}
|
||||
pod_phases = ['Pending', 'Running', 'Running']
|
||||
labels = {}
|
||||
|
||||
pod_labels = {}
|
||||
for li, k in enumerate(labels):
|
||||
v = labels[k]
|
||||
label_choice = hash_int((index + 1) * (i + 1) * (j + 1) * (li + 1)) % (len(v) + 1)
|
||||
if(label_choice != 0):
|
||||
pod_labels[k] = v[label_choice - 1]
|
||||
|
||||
phase = pod_phases[hash_int((index + 1) * (i + 1) * (j + 1)) % len(pod_phases)]
|
||||
containers = []
|
||||
for k in range(1 + j % 2):
|
||||
@@ -38,7 +49,7 @@ def generate_mock_pod(index: int, i: int, j: int):
|
||||
pod = {
|
||||
'name': '{}-{}-{}'.format(names[hash_int((i + 1) * (j + 1)) % len(names)], i, j),
|
||||
'namespace': 'kube-system' if j < 3 else 'default',
|
||||
'labels': labels,
|
||||
'labels': pod_labels,
|
||||
'phase': phase,
|
||||
'containers': containers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user