This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 549
/
Copy pathpylon.yaml.template
118 lines (117 loc) · 4.67 KB
/
pylon.yaml.template
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
# 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: pylon-ds
spec:
selector:
matchLabels:
app: pylon
template:
metadata:
name: pylon
labels:
app: pylon
spec:
hostNetwork: false
hostPID: false
containers:
- name: pylon
image: {{ cluster_cfg['cluster']['docker-registry']['prefix'] }}pylon:{{ cluster_cfg['cluster']['docker-registry']['tag'] }}
imagePullPolicy: Always
volumeMounts:
- mountPath: /pylon-config
name: pylon-configuration
{% if 'ssl' in cluster_cfg['pylon'] %}
- mountPath: /https-config
name: https-configuration
{% endif %}
command:
- "/bin/bash"
- "/pylon-config/run.sh"
env:
- name: REST_SERVER_URI
value: {{ cluster_cfg['rest-server']['uri'] }}
- name: K8S_API_SERVER_URI
value: {{ cluster_cfg['layout']['kubernetes']['api-servers-url'] }}
- name: CLUSTER_TYPE
value: cluster_cfg["cluster"]["common"]["cluster-type"]
{% if 'ssl' in cluster_cfg['pylon'] %}
- name: SSL_ENABLE
value: 'true'
- name: CRT_NAME
value: '{{ cluster_cfg['pylon']['ssl']['crt_name'] }}'
- name: KEY_NAME
value: '{{ cluster_cfg['pylon']['ssl']['key_name'] }}'
{% endif %}
- name: PROMETHEUS_URI
value: {{ cluster_cfg['prometheus']['url'] }}
- name: ALERT_MANGER_URI
value: {{ cluster_cfg['alert-manager']['url'] }}
- name: K8S_DASHBOARD_URI
value: {{ cluster_cfg['layout']['kubernetes']['dashboard-url'] }}
{% if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
{% if cluster_cfg['pylon']['webhdfs-legacy-port'] %}
- name: WEBHDFS_LEGACY_PORT
value: '{{ cluster_cfg['pylon']['webhdfs-legacy-port'] }}'
{% endif %}
- name: WEBHDFS_URI
value: http://{{ cluster_cfg['hadoop-name-node']['master-ip'] }}:5070
- 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: PAI_WEB_PORTAL_URI
value: {{ cluster_cfg['webportal']['uri'] }}
ports:
- name: pylon
containerPort: 80
hostPort: {{ cluster_cfg['pylon']['port'] }}
- name: pylon-https
containerPort: 443
hostPort: 443
{% if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
{% if cluster_cfg['pylon']['webhdfs-legacy-port'] %}
- name: pylon-webhdfs
containerPort: {{ cluster_cfg['pylon']['webhdfs-legacy-port'] }}
hostPort: {{ cluster_cfg['pylon']['webhdfs-legacy-port'] }}
{% endif %}
{% endif %}
livenessProbe:
httpGet:
path: /healthz
port: pylon
initialDelaySeconds: 10
periodSeconds: 60
{%- if cluster_cfg['cluster']['common']['qos-switch'] == "true" %}
resources:
limits:
memory: "1Gi"
{%- endif %}
imagePullSecrets:
- name: {{ cluster_cfg["cluster"]["docker-registry"]["secret-name"] }}
volumes:
- name: pylon-configuration
configMap:
name: pylon-config
{% if 'ssl' in cluster_cfg['pylon'] %}
- name: https-configuration
configMap:
name: https-config
{% endif %}