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

Dashboard deployment #680

Merged
merged 3 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions src/ClusterBootstrap/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,11 @@ def deploy_webUI_on_node(ipAddress):
if ( "servers" not in config["Dashboards"]["grafana"]):
config["Dashboards"]["grafana"]["servers"] = masternodes[0]

config["grafana_endpoint"] = "http://%s:%s" % (config["Dashboards"]["grafana"]["servers"], config["Dashboards"]["grafana"]["port"])
config["prometheus_endpoint"] = "http://%s:%s" % (config["prometheus"]["host"], config["prometheus"]["port"])



reportConfig = config["Dashboards"]
reportConfig["kuberneteAPI"] = {}
reportConfig["kuberneteAPI"]["port"] = config["k8sAPIport"]
Expand All @@ -1414,6 +1419,8 @@ def deploy_webUI_on_node(ipAddress):
utils.render_template_directory("./template/RestfulAPI", "./deploy/RestfulAPI",config)
utils.sudo_scp(config["ssh_cert"],"./deploy/RestfulAPI/config.yaml","/etc/RestfulAPI/config.yaml", sshUser, webUIIP )

utils.render_template_directory("./template/dashboard", "./deploy/dashboard",config)
utils.sudo_scp(config["ssh_cert"],"./deploy/dashboard/production.yaml","/etc/dashboard/production.yaml", sshUser, webUIIP )

print "==============================================="
print "Web UI is running at: http://%s:%s" % (webUIIP,str(config["webuiport"]))
Expand Down
64 changes: 64 additions & 0 deletions src/ClusterBootstrap/services/dashboard/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{% if false %}
apiVersion: v1
kind: Service
metadata:
name: dashboard
namespace: default
spec:
ports:
- port: {{cnf["webuiport"]}}
selector:
app: dashboard
---
{% endif %}
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: dashboard
namespace: default
spec:
selector:
matchLabels:
dashboard-node: pod
template:
metadata:
name: dashboard
labels:
app: dashboard
dashboard-node: pod
spec:
{% if cnf["dnsPolicy"] %}
dnsPolicy: {{cnf["dnsPolicy"]}}
{% endif %}
nodeSelector:
webportal: active
{% if true %}
hostNetwork: true
{% endif %}
containers:
- name: dashboard
image: {{cnf["worker-dockerregistry"]}}{{cnf["dockerprefix"]}}dashboard:{{cnf["dockertag"]}}
imagePullPolicy: Always
{% if false %}
ports:
- name: dashboard
containerPort: 80
{% endif %}
imagePullPolicy: Always
volumeMounts:
- mountPath: /usr/src/app/config
name: dashboardconfig
- mountPath: /var/log/dashboard
name: dashboardlog
volumes:
- name: dashboardconfig
hostPath:
path: /etc/dashboard
- name: dashboardlog
hostPath:
path: /var/log/dashboard
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/master
effect: NoSchedule
20 changes: 20 additions & 0 deletions src/ClusterBootstrap/template/dashboard/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sign: {{cnf["master_token"]}}

winbind: {{cnf["WinbindServers"]}}
masterToken: {{cnf["master_token"]}}

AddGroupLink: https://dlts.azurewebsites.net/v2/htmlfiles/Overview/VirtualClusters.html
WikiLink: https://aka.ms/dltsuserwiki_v2

activeDirectory:
tenant: {{cnf["activeDirectory"]["tenant"]}}
clientId: {{cnf["activeDirectory"]["clientId"]}}
clientSecret: {{cnf["activeDirectory"]["clientSecret"]}}

clusters:
{{cnf["cluster_name"]}}:
restfulapi: {{cnf["restapi"]}}
grafana: {{cnf["grafana_endpoint"]}}
prometheus: {{cnf["prometheus_endpoint"]}}
workStorage: {{cnf["workFolderAccessPoint"]}}
dataStorage: {{cnf["dataFolderAccessPoint"]}}
21 changes: 21 additions & 0 deletions src/docker-images/dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:erbium


ADD dashboard /usr/src/app/
WORKDIR /usr/src/app

ENV NODE_OPTIONS --max-http-header-size=65536

RUN yarn --frozen-lockfile


RUN ls /usr/src/app/
RUN npm run build

ENV HOST 0.0.0.0
ENV PORT 80

VOLUME /usr/src/app/config
EXPOSE 80

CMD npm start --production
9 changes: 9 additions & 0 deletions src/docker-images/dashboard/prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# This command will be executed under directory
# src/ClusterBootstrap/deploy/docker-images/.../

rm -rf dashboard
cd ../../../
python deploy.py webui
cd deploy/docker-images/dashboard
cp -r ../../../../dashboard dashboard