brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [2/4] brooklyn-docs git commit: update examples to use external secret provider
Date Tue, 26 Sep 2017 14:41:57 GMT
update examples to use external secret provider


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/85d5a696
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/85d5a696
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/85d5a696

Branch: refs/heads/master
Commit: 85d5a6966abd504c62f7bfadfcdeb8258e70f739
Parents: 8138884
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Sep 8 13:48:43 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Sep 8 13:48:43 2017 +0100

----------------------------------------------------------------------
 guide/blueprints/clusters-and-policies.md              |  8 ++++++--
 .../example_yaml/appserver-clustered-w-db-concise.yaml |  4 ++--
 .../example_yaml/appserver-clustered-w-db.yaml         | 13 ++++++++++---
 .../example_yaml/appserver-w-db-other-flavor.yaml      | 10 ++++++++--
 guide/blueprints/example_yaml/appserver-w-db.yaml      | 10 ++++++++--
 guide/blueprints/example_yaml/appserver-w-policy.yaml  | 10 ++++++++--
 guide/blueprints/multiple-services.md                  |  9 +++++++--
 .../testcases/getting-started-test-example.yaml        |  3 ++-
 guide/ops/cli/cli-usage-guide.md                       |  5 +++--
 guide/ops/gui/_my-web-cluster.yaml                     |  3 ++-
 guide/ops/gui/_my-web-cluster2.yaml                    |  3 ++-
 guide/start/_my-web-cluster.yaml                       |  3 ++-
 guide/start/_my-web-cluster2.yaml                      |  3 ++-
 13 files changed, 62 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/clusters-and-policies.md
----------------------------------------------------------------------
diff --git a/guide/blueprints/clusters-and-policies.md b/guide/blueprints/clusters-and-policies.md
index d40c97f..0e9630f 100644
--- a/guide/blueprints/clusters-and-policies.md
+++ b/guide/blueprints/clusters-and-policies.md
@@ -17,8 +17,12 @@ deployment of our `hello-world-sql` application as follows:
 {% endhighlight %}
 
 This sets up Nginx as the controller by default, but that can be configured
-using the `controllerSpec` key. In fact, JBoss is the default appserver,
-and because configuration in Brooklyn is inherited by default,
+using the `controllerSpec` key. 
+This uses the same [externalized config](../ops/externalized-config.html) 
+as in other examples to hide the password.
+
+JBoss is actually the default appserver in the `ControlledDynamicWebAppCluster`,
+so because `brooklyn.config` keys in Brooklyn are inherited by default,
 the same blueprint can be expressed more concisely as:
 
 {% highlight yaml %}

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/example_yaml/appserver-clustered-w-db-concise.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/example_yaml/appserver-clustered-w-db-concise.yaml b/guide/blueprints/example_yaml/appserver-clustered-w-db-concise.yaml
index 64ed9a0..1905352 100644
--- a/guide/blueprints/example_yaml/appserver-clustered-w-db-concise.yaml
+++ b/guide/blueprints/example_yaml/appserver-clustered-w-db-concise.yaml
@@ -6,10 +6,10 @@ services:
     wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
     http.port: 8080+
     java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
-           component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample",
"hidden-brooklyn-password"))
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: DB HelloWorld Visitors
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/example_yaml/appserver-clustered-w-db.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/example_yaml/appserver-clustered-w-db.yaml b/guide/blueprints/example_yaml/appserver-clustered-w-db.yaml
index a3fa749..04c8519 100644
--- a/guide/blueprints/example_yaml/appserver-clustered-w-db.yaml
+++ b/guide/blueprints/example_yaml/appserver-clustered-w-db.yaml
@@ -10,10 +10,17 @@ services:
           wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
           http.port: 8080+
           java.sysprops:
-            brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
-                component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
"br00k11n")
+            brooklyn.example.db.url:
+              $brooklyn:formatString:
+                - jdbc:%s%s?user=%s\\&password=%s
+                - $brooklyn:component("db").attributeWhenReady("datastore.url")
+                - visitors
+                - brooklyn
+                - $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: DB HelloWorld Visitors
   brooklyn.config:
-    datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
+    datastore.creation.script.url: https://github.com/apache/brooklyn-library/blob/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
+

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/example_yaml/appserver-w-db-other-flavor.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/example_yaml/appserver-w-db-other-flavor.yaml b/guide/blueprints/example_yaml/appserver-w-db-other-flavor.yaml
index 9b648d8..14d9f44 100644
--- a/guide/blueprints/example_yaml/appserver-w-db-other-flavor.yaml
+++ b/guide/blueprints/example_yaml/appserver-w-db-other-flavor.yaml
@@ -6,12 +6,18 @@ services:
     wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
     http.port: 8080+
     java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+      brooklyn.example.db.url:
+        $brooklyn:formatString:
+          - jdbc:%s%s?user=%s\\&password=%s
+          - $brooklyn:component("db").attributeWhenReady("datastore.url")
+          - visitors
+          - brooklyn
+          - $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
 - type: org.apache.brooklyn.entity.database.mariadb.MariaDbNode
   id: db
   name: DB HelloWorld Visitors
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql
     provisioning.properties:
       minRam: 8192

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/example_yaml/appserver-w-db.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/example_yaml/appserver-w-db.yaml b/guide/blueprints/example_yaml/appserver-w-db.yaml
index d4bc706..768ba64 100644
--- a/guide/blueprints/example_yaml/appserver-w-db.yaml
+++ b/guide/blueprints/example_yaml/appserver-w-db.yaml
@@ -6,10 +6,16 @@ services:
     wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
     http.port: 8080+
     java.sysprops: 
-      brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
-         component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", "br00k11n")
+      brooklyn.example.db.url:
+        $brooklyn:formatString:
+          - jdbc:%s%s?user=%s\\&password=%s
+          - $brooklyn:component("db").attributeWhenReady("datastore.url")
+          - visitors
+          - brooklyn
+          - $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: DB HelloWorld Visitors
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/example_yaml/appserver-w-policy.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/example_yaml/appserver-w-policy.yaml b/guide/blueprints/example_yaml/appserver-w-policy.yaml
index 4b10f59..4e193c6 100644
--- a/guide/blueprints/example_yaml/appserver-w-policy.yaml
+++ b/guide/blueprints/example_yaml/appserver-w-policy.yaml
@@ -10,8 +10,13 @@ services:
           wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
           http.port: 8080+
           java.sysprops:
-            brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
-                component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn",
"br00k11n")
+            brooklyn.example.db.url:
+              $brooklyn:formatString:
+              - jdbc:%s%s?user=%s\\&password=%s
+              - $brooklyn:component("db").attributeWhenReady("datastore.url")
+              - visitors
+              - brooklyn
+              - $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
   brooklyn.policies:
   - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
     brooklyn.config:
@@ -24,4 +29,5 @@ services:
   id: db
   name: DB HelloWorld Visitors
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://github.com/apache/brooklyn-library/raw/master/examples/simple-web-cluster/src/main/resources/visitors-creation-script.sql

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/multiple-services.md
----------------------------------------------------------------------
diff --git a/guide/blueprints/multiple-services.md b/guide/blueprints/multiple-services.md
index 518b64c..955e2bd 100644
--- a/guide/blueprints/multiple-services.md
+++ b/guide/blueprints/multiple-services.md
@@ -41,8 +41,11 @@ Here there are a few things going on:
 * We've added a second service, which will be the database;
   you'll note the database has been configured to run a custom setup script
 * We've injected the URL of the second service into the appserver as a Java system property
-  (so our app knows where to find the database) 
-
+  (so our app knows where to find the database)
+* We've used externalized config to keep secret information out of the blueprint;
+  this is loaded at runtime from an [externalized config provider](../ops/externalized-config.html),
+  such as a remote credentials store
+ 
 **Caution: Be careful if you write your YAML in an editor which attempts to put "smart-quotes"
in.
 All quote characters must be plain ASCII, not fancy left-double-quotes and right-double-quotes!**
 
@@ -81,6 +84,8 @@ Here's an example deploying the same application but with different flavors
of t
 {% readj example_yaml/appserver-w-db-other-flavor.yaml %}
 {% endhighlight %}
 
+By changing two lines we've switched from JBoss and MySQL to Tomcat and MariaDB.
+
 We've also brought in the `provisioning.properties` from the VM example earlier
 so our database has 8GB RAM.
 Any of those properties, including `imageId` and `user`, can be defined on a per-entity basis.

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/blueprints/test/example_yaml/testcases/getting-started-test-example.yaml
----------------------------------------------------------------------
diff --git a/guide/blueprints/test/example_yaml/testcases/getting-started-test-example.yaml
b/guide/blueprints/test/example_yaml/testcases/getting-started-test-example.yaml
index 339f121..9b2ab89 100644
--- a/guide/blueprints/test/example_yaml/testcases/getting-started-test-example.yaml
+++ b/guide/blueprints/test/example_yaml/testcases/getting-started-test-example.yaml
@@ -15,11 +15,12 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         entity("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   id: db
   name: My DB
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
 - type: org.apache.brooklyn.test.framework.TestHttpCall
   name: Check HTTP Response Status Code

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/ops/cli/cli-usage-guide.md
----------------------------------------------------------------------
diff --git a/guide/ops/cli/cli-usage-guide.md b/guide/ops/cli/cli-usage-guide.md
index ae1c69e..a225e25 100644
--- a/guide/ops/cli/cli-usage-guide.md
+++ b/guide/ops/cli/cli-usage-guide.md
@@ -439,7 +439,7 @@ tvZoNUTN   ssh: launching NginxControllerImpl{id...   Sun Dec 20 19:18:08
GMT 20
 {% endhighlight %}
 
 ## YAML Blueprint
-This the YAML blueprint used for this document.
+This the YAML blueprint used for this document, based on the [web cluster](../../blueprints/clusters-and-policies.html)
examples.
 
 {% highlight text %}
 name: WebCluster
@@ -465,7 +465,7 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
   brooklyn.policies:
   - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
     brooklyn.config:
@@ -481,5 +481,6 @@ services:
   id: db
   name: WebDB
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
 {% endhighlight %}

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/ops/gui/_my-web-cluster.yaml
----------------------------------------------------------------------
diff --git a/guide/ops/gui/_my-web-cluster.yaml b/guide/ops/gui/_my-web-cluster.yaml
index c92da48..a00949e 100644
--- a/guide/ops/gui/_my-web-cluster.yaml
+++ b/guide/ops/gui/_my-web-cluster.yaml
@@ -15,9 +15,10 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   name: My DB
   id: db
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/ops/gui/_my-web-cluster2.yaml
----------------------------------------------------------------------
diff --git a/guide/ops/gui/_my-web-cluster2.yaml b/guide/ops/gui/_my-web-cluster2.yaml
index 86a5978..bef8d1a 100644
--- a/guide/ops/gui/_my-web-cluster2.yaml
+++ b/guide/ops/gui/_my-web-cluster2.yaml
@@ -12,7 +12,7 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
   brooklyn.policies:
   - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
     brooklyn.config:
@@ -28,4 +28,5 @@ services:
   id: db
   name: My DB
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/start/_my-web-cluster.yaml
----------------------------------------------------------------------
diff --git a/guide/start/_my-web-cluster.yaml b/guide/start/_my-web-cluster.yaml
index c92da48..a00949e 100644
--- a/guide/start/_my-web-cluster.yaml
+++ b/guide/start/_my-web-cluster.yaml
@@ -15,9 +15,10 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
   name: My DB
   id: db
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/85d5a696/guide/start/_my-web-cluster2.yaml
----------------------------------------------------------------------
diff --git a/guide/start/_my-web-cluster2.yaml b/guide/start/_my-web-cluster2.yaml
index 86a5978..bef8d1a 100644
--- a/guide/start/_my-web-cluster2.yaml
+++ b/guide/start/_my-web-cluster2.yaml
@@ -12,7 +12,7 @@ services:
       brooklyn.example.db.url: >
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
-        "visitors", "brooklyn", "br00k11n")
+        "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
   brooklyn.policies:
   - type: org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy
     brooklyn.config:
@@ -28,4 +28,5 @@ services:
   id: db
   name: My DB
   brooklyn.config:
+    creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
     datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script


Mime
View raw message