Giuseppe Lavagetto has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311378

Change subject: puppetdb: expose dashboard via cache-misc
......................................................................

puppetdb: expose dashboard via cache-misc

Just the dashboard and the metrics for both datacenters will be made
publicly available. Note that this will just expose the dashboard and
nothing else.

Change-Id: I7370dee33ba3be855118b3b0809805c2fb9a650c
---
M modules/puppetmaster/templates/nginx-puppetdb.conf.erb
M modules/role/manifests/cache/misc.pp
M modules/varnish/templates/misc-common.inc.vcl.erb
3 files changed, 43 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/78/311378/1

diff --git a/modules/puppetmaster/templates/nginx-puppetdb.conf.erb 
b/modules/puppetmaster/templates/nginx-puppetdb.conf.erb
index 450eed5..99a253f 100644
--- a/modules/puppetmaster/templates/nginx-puppetdb.conf.erb
+++ b/modules/puppetmaster/templates/nginx-puppetdb.conf.erb
@@ -24,3 +24,30 @@
     }
 }
 
+# Server to specifically expose the dashboard and the metrics
+server {
+    listen 80 default_server;
+
+    access_log /var/log/nginx/dashboard_access.log;
+    error_log /var/log/nginx/dashboard_error.log;
+
+    root /dev/null;
+
+    location /dashboard/ {
+        proxy_pass http://localhost:<%= @jetty_port %>/dashboard/;
+        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header    X-Real-IP $remote_addr;    
+    }
+
+    location /v3/metrics/ {
+        proxy_pass http://localhost:<%= @jetty_port %>/v3/metrics/;
+        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header    X-Real-IP $remote_addr;    
+    }
+
+    location /v3/version {
+        proxy_pass http://localhost:<%= @jetty_port %>/v3/version;
+        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header    X-Real-IP $remote_addr;    
+    }
+}       
diff --git a/modules/role/manifests/cache/misc.pp 
b/modules/role/manifests/cache/misc.pp
index 367c2af..b375b6d 100644
--- a/modules/role/manifests/cache/misc.pp
+++ b/modules/role/manifests/cache/misc.pp
@@ -194,6 +194,20 @@
             'be_opts'     => $app_def_be_opts,
             'req_host_re' => '^([^.]+\.)?planet\.wikimedia\.org$'
         },
+        'puppetdb-codfw' => {
+            'dynamic'  => 'no',
+            'type'     => 'random',
+            'backends' => 'nihal.codfw.wmnet',
+            'be_opts'  => $app_def_be_opts,
+            'req_host' => 'puppetdb-codfw.wikimedia.org',
+        },
+        'puppetdb-eqiad' => {
+            'dynamic'  => 'no',
+            'type'     => 'random',
+            'backends' => 'nitrogen.eqiad.wmnet',
+            'be_opts'  => $app_def_be_opts,
+            'req_host' => 'puppetdb-eqiad.wikimedia.org',
+        },
         'pybal_config' => {
             'dynamic'  => 'no',
             'type'     => 'random',
diff --git a/modules/varnish/templates/misc-common.inc.vcl.erb 
b/modules/varnish/templates/misc-common.inc.vcl.erb
index 497e8a7..6c82e86 100644
--- a/modules/varnish/templates/misc-common.inc.vcl.erb
+++ b/modules/varnish/templates/misc-common.inc.vcl.erb
@@ -9,6 +9,8 @@
         || req.http.Host == "config-master.wikimedia.org"
         || req.http.Host == "etherpad.wikimedia.org" // No caching of configs; 
scripts may want to know when things change
         || req.http.Host == "stream.wikimedia.org"
+        || req.http.Host == "puppetdb-eqiad.wikimedia.org" // This exposes a 
real-time dashboard, no reason to cache it
+        || req.http.Host == "puppetdb-codfw.wikimedia.org"
     ) {
         return (pass);
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/311378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7370dee33ba3be855118b3b0809805c2fb9a650c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to