-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebportal-dind.yaml.template
More file actions
141 lines (140 loc) · 5.62 KB
/
webportal-dind.yaml.template
File metadata and controls
141 lines (140 loc) · 5.62 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
# to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: webportal-dind-ds
spec:
selector:
matchLabels:
app: webportal-dind
template:
metadata:
name: webportal-dind
labels:
app: webportal-dind
azure.workload.identity/use: "true"
spec:
serviceAccountName: azure-acr-identity
hostNetwork: false
hostPID: false
containers:
- name: webportal-dind
image: {{ cluster_cfg['cluster']['docker-registry']['prefix'] }}webportal-dind:{{ cluster_cfg['cluster']['docker-registry']['tag'] }}
imagePullPolicy: Always
securityContext:
privileged: true
command: ["/bin/bash", "-c", "bash /usr/local/bin/start-docker.sh && tail -f /dev/null"]
env:
- name: DOCKER_IMAGE
value: {{ cluster_cfg['cluster']['docker-registry']['prefix'] }}webportal
- name: DOCKER_NAMESPACE
value: {{ cluster_cfg['cluster']['docker-registry']['namespace'] }}
- name: DOCKER_TAG
value: {{ cluster_cfg['cluster']['docker-registry']['tag'] }}
- name: LAUNCHER_TYPE
value: {{ cluster_cfg["cluster"]["common"]["cluster-type"] }}
- name: LAUNCHER_SCHEDULER
{% if cluster_cfg['hivedscheduler']['config']|length > 1 %}
value: hivedscheduler
{% else %}
value: defaultscheduler
{% endif %}
- name: REST_SERVER_URI
value: {{ cluster_cfg['rest-server']['uri'] }}
- name: MARKETPLACE_API_URI
{%- if 'marketplace_api_uri' in cluster_cfg['marketplace-webportal'] %}
value: {{ cluster_cfg["marketplace-webportal"]["marketplace_api_uri"] }}
{%- else %}
{% if "ssl" in cluster_cfg["pylon"] and cluster_cfg["pylon"]["ssl"] %}
value: "{{ cluster_cfg['pylon']['uri-https']}}/marketplace/api"
{% else %}
value: "{{ cluster_cfg['pylon']['uri']}}/marketplace/api"
{% endif %}
{%- endif %}
- name: SAVE_TEMPLATE
{%- if cluster_cfg['webportal']['save-template'] and cluster_cfg['cluster']['common']['marketplace'] == "true" %}
value: "true"
{%- else %}
value: "false"
{%- endif %}
- name: PROMETHEUS_URI
value: {{ cluster_cfg['prometheus']['url'] }}
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
- name: YARN_WEB_PORTAL_URI
value: http://{{ cluster_cfg['hadoop-resource-manager']['master-ip'] }}:8088
{%- endif %}
- name: GRAFANA_URI
value: {{ cluster_cfg['grafana']['url'] }}
- name: K8S_DASHBOARD_URI
value: {{ cluster_cfg['layout']['kubernetes']['dashboard-url'] }}
- name: K8S_API_SERVER_URI
value: {{ cluster_cfg['layout']['kubernetes']['api-servers-url'] }}
- name: EXPORTER_PORT
value: "{{ cluster_cfg['node-exporter']['port'] }}"
{% if not cluster_cfg['authentication']['OIDC'] %}
- name: AUTHN_METHOD
value: basic
{% else %}
- name: AUTHN_METHOD
value: OIDC
{% endif %}
{%- if cluster_cfg['cluster']['common']['job-history'] == "true" %}
- name: JOB_HISTORY
value: "true"
{%- endif %}
- name: PROM_SCRAPE_TIME
value: {{ cluster_cfg['prometheus']['scrape_interval'] * 10 }}s
{% if cluster_cfg['webportal']['enable-job-transfer'] %}
- name: ENABLE_JOB_TRANSFER
value: "true"
{% else %}
- name: ENABLE_JOB_TRANSFER
value: "false"
{% endif %}
- name: WEBPORTAL_PLUGINS
# A raw JSON formatted value is required here.
value: |
[
{% if cluster_cfg['cluster']['common']['marketplace'] == "true" and cluster_cfg['webportal']['marketplace'] %}
{
"id": "marketplace",
"title": "Marketplace",
{% if "ssl" in cluster_cfg["pylon"] and cluster_cfg["pylon"]["ssl"] %}
"uri": "{{ cluster_cfg['pylon']['uri-https']}}/marketplace/plugin.js"
{% else %}
"uri": "{{ cluster_cfg['pylon']['uri']}}/marketplace/plugin.js"
{% endif %}
},
{% endif %}
{% if cluster_cfg['webportal']['plugins']|length > 0 %}
{% for item in cluster_cfg['webportal']['plugins'] %}
{{item}},
{% endfor %}
{% endif %}
]
ports:
- name: webportal
containerPort: 8080
hostPort: {{ cluster_cfg['webportal']['server-port'] }}
{%- if cluster_cfg['cluster']['common']['qos-switch'] == "true" %}
resources:
limits:
memory: "2Gi"
{%- endif %}
imagePullSecrets:
- name: {{ cluster_cfg["cluster"]["docker-registry"]["secret-name"] }}