diff --git a/src/pylon/config/pylon.md b/src/pylon/config/pylon.md
index 2a1eb8fbf8..8e228074da 100644
--- a/src/pylon/config/pylon.md
+++ b/src/pylon/config/pylon.md
@@ -29,6 +29,7 @@ pylon:
port: 80
uri: "http://master_ip:80"
#ssl:
+ # port: 443
# # self-sign
# crt_name: xxxxxx
# crt_path: /path/to/xxxxxx
@@ -38,47 +39,13 @@ pylon:
## Table
-
-
- Data in Configuration File |
- Data in Cluster Object Model |
- Data in Jinja2 Template |
- Data type |
-
-
- pylon.port |
- com["pylon"]["port"] |
- cluster_cfg["pylon"]["port"] |
- Int |
-
-
- pylon.uri |
- com["pylon"]["uri"] |
- cluster_cfg["pylon"]["uri"] |
- URL |
-
-
- pylon.ssl.crt_name |
- com["pylon"]["ssl"]["crt_name"] |
- cluster_cfg["pylon"]["ssl"]["crt_name"] |
- certificate file name |
-
-
- pylon.ssl.crt_path |
- com["pylon"]["ssl"]["crt_path"] |
- cluster_cfg["pylon"]["ssl"]["crt_path"] |
- the path to certificate file |
-
-
- pylon.ssl.key_name |
- com["pylon"]["ssl"]["key_name"] |
- cluster_cfg["pylon"]["ssl"]["key_name"] |
- certificate key file name |
-
-
- pylon.ssl.key_path |
- com["pylon"]["ssl"]["key_path"] |
- cluster_cfg["pylon"]["ssl"]["key_path"] |
- the path to certificate key file |
-
-
\ No newline at end of file
+| Data in Configuration File | Data in Cluster Object Model | ata in Jinja2 Template | Data type|
+| --- | --- | --- | --- |
+| pylon.port | com["pylon"]["port"] | cluster_cfg["pylon"]["port"] | Int |
+| pylon.uri | com["pylon"]["uri"] | cluster_cfg["pylon"]["uri"] | URL |
+| pylon.ssl.port | com["pylon"]["ssl"]["port"] | cluster_cfg["pylon"]["ssl"]["crt_name"] | Int |
+| pylon.ssl.crt_name | com["pylon"]["ssl"]["crt_name"] | cluster_cfg["pylon"]["ssl"]["crt_name"] | certificate file name |
+| pylon.ssl.crt_path | com["pylon"]["ssl"]["crt_path"] | cluster_cfg["pylon"]["ssl"]["crt_path"] | the path to certificate file |
+| pylon.ssl.key_name | com["pylon"]["ssl"]["key_name"] | cluster_cfg["pylon"]["ssl"]["key_name"] | certificate key file name |
+| pylon.ssl.key_path | com["pylon"]["ssl"]["key_path"] | cluster_cfg["pylon"]["ssl"]["key_path"] | the path to certificate key file |
+
diff --git a/src/pylon/config/pylon.py b/src/pylon/config/pylon.py
index 592bc9c6bf..3aa869e6a1 100644
--- a/src/pylon/config/pylon.py
+++ b/src/pylon/config/pylon.py
@@ -36,11 +36,15 @@ def run(self):
machine_list = self.cluster_configuration['machine-list']
master_ip = [host['hostip'] for host in machine_list if host.get('pai-master') == 'true'][0]
port = self.service_configuration['port']
+ sslConfig = {'port': 443}
+ if 'ssl' in self.service_configuration:
+ sslConfig.update(self.service_configuration['ssl'])
+ sslPort = sslConfig['port']
uri = 'http://{0}:{1}'.format(master_ip, port)
- uriHttps = 'https://{0}'.format(master_ip)
+ uriHttps = 'https://{0}:{1}'.format(master_ip, sslPort)
if 'domain' in self.service_configuration:
uri = 'http://{0}:{1}'.format(self.service_configuration['domain'], port)
- uriHttps = 'https://{0}'.format(self.service_configuration['domain'])
+ uriHttps = 'https://{0}:{1}'.format(self.service_configuration['domain'], sslPort)
webhdfs_legacy_port = self.service_configuration['webhdfs-legacy-port']
ret = {
@@ -49,8 +53,7 @@ def run(self):
'uri-https': uriHttps,
'webhdfs-legacy-port': webhdfs_legacy_port,
}
- if 'ssl' in self.service_configuration:
- ret['ssl'] = self.service_configuration['ssl']
+ ret['ssl'] = sslConfig if sslConfig else None
return ret
diff --git a/src/pylon/config/pylon.yaml b/src/pylon/config/pylon.yaml
index 3a33263d54..58ea6cf32f 100644
--- a/src/pylon/config/pylon.yaml
+++ b/src/pylon/config/pylon.yaml
@@ -23,6 +23,7 @@ webhdfs-legacy-port: 50070
deploy-service: false
#ssl:
+# port: 443
# # self-sign
# crt_name: xxxxxx
# crt_path: /path/to/xxxxxx
diff --git a/src/pylon/deploy/pylon.yaml.template b/src/pylon/deploy/pylon.yaml.template
index 17d7375eca..7fbef39c3c 100644
--- a/src/pylon/deploy/pylon.yaml.template
+++ b/src/pylon/deploy/pylon.yaml.template
@@ -97,9 +97,11 @@ spec:
- name: pylon
containerPort: 80
hostPort: {{ cluster_cfg['pylon']['port'] }}
+{% if 'ssl' in cluster_cfg['pylon'] %}
- name: pylon-https
containerPort: 443
- hostPort: 443
+ hostPort: {{ cluster_cfg['pylon']['ssl']['port'] }}
+{% endif %}
{% if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
{% if cluster_cfg['pylon']['webhdfs-legacy-port'] %}
- name: pylon-webhdfs