-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions
committed
Oct 23, 2024
1 parent
655787d
commit dfd2f4b
Showing
58 changed files
with
47,396 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'asciidoctor' | ||
require 'erb' | ||
|
||
guard 'shell' do | ||
watch(/.*\.adoc$/) {|m| | ||
Asciidoctor.render_file('index.adoc', \ | ||
:in_place => true, \ | ||
:safe => Asciidoctor::SafeMode::UNSAFE, \ | ||
:attributes=> { \ | ||
'source-highlighter' => 'prettify', \ | ||
'icons' => 'font', \ | ||
'linkcss'=> 'true', \ | ||
'copycss' => 'true', \ | ||
'doctype' => 'book'}) | ||
} | ||
end | ||
|
||
guard 'livereload' do | ||
watch(%r{^.+\.(css|js|html)$}) | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="generator" content="Asciidoctor 2.0.10"> | ||
<title>Cloud Foundry</title> | ||
<link rel="stylesheet" href="css/site.css"> | ||
<script src="js/setup.js"></script><script defer src="js/site.js"></script> | ||
|
||
</head> | ||
<body class="book toc2 toc-left"><div id="banner-container" class="container" role="banner"> | ||
<div id="banner" class="contained" role="banner"> | ||
<div id="switch-theme"> | ||
<input type="checkbox" id="switch-theme-checkbox" /> | ||
<label for="switch-theme-checkbox">Dark Theme</label> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="tocbar-container" class="container" role="navigation"> | ||
<div id="tocbar" class="contained" role="navigation"> | ||
<button id="toggle-toc"></button> | ||
</div> | ||
</div> | ||
<div id="main-container" class="container"> | ||
<div id="main" class="contained"> | ||
<div id="doc" class="doc"> | ||
<div id="header"> | ||
<div id="toc" class="toc2"> | ||
<div id="toctitle">Table of Contents</div> | ||
<span id="back-to-index"><a href="${index-link}">Back to index</a></span><ul class="sectlevel1"> | ||
<li><a href="#_cloud_foundry">Cloud Foundry</a> | ||
<ul class="sectlevel2"> | ||
<li><a href="#_user_provided_services">User-Provided Services</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div id="content"> | ||
<div class="sect1"> | ||
<h2 id="_cloud_foundry"><a class="anchor" href="#_cloud_foundry"></a><a class="link" href="#_cloud_foundry">Cloud Foundry</a></h2> | ||
<div class="sectionbody"> | ||
<div class="paragraph"> | ||
<p>Spring Framework on Google Cloud provides support for Cloud Foundry’s <a href="https://docs.pivotal.io/partners/gcp-sb/index.html">GCP Service Broker</a>. | ||
Our Pub/Sub, Cloud Spanner, Storage, Cloud Trace and Cloud SQL MySQL and PostgreSQL starters are Cloud Foundry aware and retrieve properties like project ID, credentials, etc., that are used in auto configuration from the Cloud Foundry environment.</p> | ||
</div> | ||
<div class="paragraph"> | ||
<p>In order to take advantage of the Cloud Foundry support make sure the following dependency is added:</p> | ||
</div> | ||
<div class="listingblock"> | ||
<div class="content"> | ||
<pre class="highlight"><code class="language-xml" data-lang="xml"><dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>spring-cloud-gcp-starter-cloudfoundry</artifactId> | ||
</dependency></code></pre> | ||
</div> | ||
</div> | ||
<div class="paragraph"> | ||
<p>In cases like Pub/Sub’s topic and subscription, or Storage’s bucket name, where those parameters are not used in auto configuration, you can fetch them using the VCAP mapping provided by Spring Boot. | ||
For example, to retrieve the provisioned Pub/Sub topic, you can use the <code>vcap.services.mypubsub.credentials.topic_name</code> property from the application environment.</p> | ||
</div> | ||
<div class="admonitionblock note"> | ||
<table> | ||
<tr> | ||
<td class="icon"> | ||
<i class="fa icon-note" title="Note"></i> | ||
</td> | ||
<td class="content"> | ||
If the same service is bound to the same application more than once, the auto configuration will not be able to choose among bindings and will not be activated for that service. | ||
This includes both MySQL and PostgreSQL bindings to the same app. | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="admonitionblock warning"> | ||
<table> | ||
<tr> | ||
<td class="icon"> | ||
<i class="fa icon-warning" title="Warning"></i> | ||
</td> | ||
<td class="content"> | ||
In order for the Cloud SQL integration to work in Cloud Foundry, auto-reconfiguration must be disabled. | ||
You can do so using the <code>cf set-env <APP> JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}'</code> command. | ||
Otherwise, Cloud Foundry will produce a <code>DataSource</code> with an invalid JDBC URL (i.e., <code>jdbc:mysql://null/null</code>). | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="sect2"> | ||
<h3 id="_user_provided_services"><a class="anchor" href="#_user_provided_services"></a><a class="link" href="#_user_provided_services">User-Provided Services</a></h3> | ||
<div class="paragraph"> | ||
<p><a href="https://docs.cloudfoundry.org/devguide/services/user-provided.html">User-provided services</a> enable developers to use services that are not available in the marketplace with their apps running on Cloud Foundry. | ||
For example, you may want to use a user-provided service that points to a shared Google Service (like Cloud Spanner) used across your organization.</p> | ||
</div> | ||
<div class="paragraph"> | ||
<p>In order for Spring Framework on Google Cloud to detect your user-provided service as a Google Cloud Service, you must add an <a href="https://docs.cloudfoundry.org/devguide/services/managing-services.html#instance-tags-create">instance tag</a> indicating the Google Cloud Service it uses. | ||
The tag should simply be the Cloud Foundry name for the Google Service.</p> | ||
</div> | ||
<div class="paragraph"> | ||
<p>For example, if you create a user-provided service using Cloud Spanner, you might run:</p> | ||
</div> | ||
<div class="listingblock"> | ||
<div class="content"> | ||
<pre class="highlight"><code class="language-shell" data-lang="shell">$ cf create-user-provided-service user-spanner-service -t "google-spanner" ...</code></pre> | ||
</div> | ||
</div> | ||
<div class="paragraph"> | ||
<p>This allows Spring Framework on Google Cloud to retrieve the correct service properties from Cloud Foundry and use them in the auto configuration for your application.</p> | ||
</div> | ||
<div class="paragraph"> | ||
<p>A mapping of Google service names to Cloud Foundry names are provided below:</p> | ||
</div> | ||
<table class="tableblock frame-all grid-all stretch"> | ||
<colgroup> | ||
<col style="width: 50%;"> | ||
<col style="width: 50%;"> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock">Google Cloud Service</p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock">Cloud Foundry Name (add this as a tag)</p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/pubsub">Google Cloud Pub/Sub</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-pubsub</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/storage">Google Cloud Storage</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-storage</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/spanner">Google Cloud Spanner</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-spanner</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/datastore">Datastore</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-datastore</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/firestore">Firestore</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-firestore</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/bigquery">BigQuery</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-bigquery</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/products/operations">Cloud Trace</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-stackdriver-trace</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/sql">Cloud Sql (MySQL)</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-cloudsql-mysql</code></p></td> | ||
</tr> | ||
<tr> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://cloud.google.com/sql">Cloud Sql (PostgreSQL)</a></p></td> | ||
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>google-cloudsql-postgres</code></p></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="js/highlight/highlight.min.js"></script> | ||
<script>hljs.initHighlighting()</script> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.