Merge "define Sl services for DevopsPortal"
diff --git a/.releasenotes/notes/custom-path-proxy-7f587526696c0744.yaml b/.releasenotes/notes/custom-path-proxy-7f587526696c0744.yaml
new file mode 100644
index 0000000..6f16e07
--- /dev/null
+++ b/.releasenotes/notes/custom-path-proxy-7f587526696c0744.yaml
@@ -0,0 +1,30 @@
+---
+summary: >
+  Additional path for DevopsPortal nginx proxy service
+
+features:
+   - |
+     Possibility of defining additional path to service endpoints. Need to define 'custom_path' variable on system level metadata.
+     Result of endpoint looks like 'address:port/custom_path'. Main goal of this feature - auto loading special frame on DevopsPortal dashboard.
+
+     Example:
+     .. code-block:: yaml
+     parameters:
+       _param:
+         grafana_prometheus_ssl:
+           enabled: false
+       devops_portal:
+         config:
+           service:
+             stacklight-prometheus:
+               configure_proxy: false
+               enabled: true
+               endpoint:
+                 address: ${_param:grafana_prometheus_address}
+                 custom_path: alerts
+                 port: ${_param:grafana_prometheus_port}
+                 https: ${_param:grafana_prometheus_ssl:enabled}
+
+
+fixes:
+  - related bug: https://mirantis.jira.com/browse/PROD-15068 
diff --git a/devops_portal/service/grafana.yml b/devops_portal/service/grafana.yml
new file mode 100644
index 0000000..402604a
--- /dev/null
+++ b/devops_portal/service/grafana.yml
@@ -0,0 +1,14 @@
+parameters:
+  _param:
+    grafana_ssl:
+      enabled: false
+  devops_portal:
+    config:
+      service:
+        grafana:
+          configure_proxy: false
+          enabled: true
+          endpoint:
+            address: ${_param:grafana_address}
+            port: ${_param:grafana_port}
+            https: ${_param:grafana_ssl:enabled}
diff --git a/devops_portal/service/stacklight-grafana.yml b/devops_portal/service/stacklight-grafana.yml
new file mode 100644
index 0000000..00f0990
--- /dev/null
+++ b/devops_portal/service/stacklight-grafana.yml
@@ -0,0 +1,14 @@
+parameters:
+  _param:
+    grafana_ssl:
+      enabled: false
+  devops_portal:
+    config:
+      service:
+        stacklight-grafana:
+          configure_proxy: false
+          enabled: true
+          endpoint:
+            address: ${_param:grafana_address}
+            port: ${_param:grafana_port}
+            https: ${_param:grafana_ssl:enabled}
diff --git a/devops_portal/service/stacklight-kibana.yml b/devops_portal/service/stacklight-kibana.yml
new file mode 100644
index 0000000..9fa86ae
--- /dev/null
+++ b/devops_portal/service/stacklight-kibana.yml
@@ -0,0 +1,11 @@
+parameters:
+  devops_portal:
+    config:
+      service:
+        stacklight-kibana:
+          configure_proxy: true
+          enabled: true
+          endpoint:
+            address: ${_param:haproxy_kibana_bind_host}
+            port: ${_param:haproxy_kibana_bind_port}
+            https: ${_param:haproxy_kibana_ssl:enabled}
diff --git a/devops_portal/service/stacklight-prometheus.yml b/devops_portal/service/stacklight-prometheus.yml
new file mode 100644
index 0000000..119c13f
--- /dev/null
+++ b/devops_portal/service/stacklight-prometheus.yml
@@ -0,0 +1,15 @@
+parameters:
+  _param:
+    grafana_prometheus_ssl:
+      enabled: false
+  devops_portal:
+    config:
+      service:
+        stacklight-prometheus:
+          configure_proxy: false
+          enabled: true
+          endpoint:
+            address: ${_param:grafana_prometheus_address}
+            custom_path: alerts
+            port: ${_param:stacklight_prometheus_port}
+            https: ${_param:grafana_prometheus_ssl:enabled}
diff --git a/haproxy/proxy/listen/stacklight/kibana.yml b/haproxy/proxy/listen/stacklight/kibana.yml
index e92e38a..e244fb1 100644
--- a/haproxy/proxy/listen/stacklight/kibana.yml
+++ b/haproxy/proxy/listen/stacklight/kibana.yml
@@ -1,4 +1,10 @@
 parameters:
+  _param:
+    haproxy_kibana_bind_host: ${_param:cluster_vip_address}
+    haproxy_kibana_bind_port: ${_param:cluster_kibana_port}
+    haproxy_kibana_exposed_port: ${_param:cluster_kibana_port}
+    haproxy_kibana_ssl:
+      enabled: false
   haproxy:
     proxy:
       listen:
@@ -10,19 +16,23 @@
             - prefer-last-server
             - dontlog-normal
           balance: roundrobin
+          http_request:
+            - action: "add-header X-Forwarded-Proto https"
+              condition: "if { ssl_fc }"
           binds:
-            - address: ${_param:cluster_vip_address}
-              port: 5601
+            - address: ${_param:haproxy_kibana_bind_host}
+              port: ${_param:haproxy_kibana_bind_port}
+              ssl: ${_param:haproxy_kibana_ssl}
           servers:
             - name: ${_param:cluster_node01_hostname}
               host: ${_param:cluster_node01_address}
-              port: 5601
+              port: ${_param:haproxy_kibana_exposed_port}
               params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'
             - name: ${_param:cluster_node02_hostname}
               host: ${_param:cluster_node02_address}
-              port: 5601
+              port: ${_param:haproxy_kibana_exposed_port}
               params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'
             - name: ${_param:cluster_node03_hostname}
               host: ${_param:cluster_node03_address}
-              port: 5601
+              port: ${_param:haproxy_kibana_exposed_port}
               params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'