Skip to content

Commit 724dab2

Browse files
authored
Merge pull request #3353 from rhamilto/run-on
Adding Create From URL documentation
2 parents 3a2e6a2 + b4ed52d commit 724dab2

File tree

3 files changed

+147
-9
lines changed

3 files changed

+147
-9
lines changed

Diff for: _topic_map.yml

+2
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ Topics:
714714
File: jobs
715715
- Name: Cron Jobs
716716
File: cron_jobs
717+
- Name: Create from URL
718+
File: create_from_url
717719
- Name: Revision History
718720
File: revhistory_dev_guide
719721
Distros: openshift-enterprise,openshift-dedicated

Diff for: dev_guide/create_from_url.adoc

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[[dev-guide-create-from-url]]
2+
= Create from URL
3+
{product-author}
4+
{product-version}
5+
:data-uri:
6+
:icons:
7+
:experimental:
8+
:toc: macro
9+
:toc-title:
10+
:prewrap!:
11+
12+
toc::[]
13+
14+
[[overview]]
15+
== Overview
16+
17+
Create From URL is a function that allows you to construct a URL from an image
18+
stream, image tag, or template.
19+
20+
Create from URL only works with image streams or templates from
21+
namespaces that have been explicitly whitelisted. The whitelist contains
22+
the 'openshift' namespace by default. To add namespaces to the whitelist, see
23+
xref:../install_config/web_console_customization.adoc#configuring-the-create-
24+
from-url-namespace-whitelist[Configuring the Create From URL Namespace Whitelist].
25+
26+
[[create-for-url-using-an-image-stream-and-image-tag]]
27+
== Using an Image Stream and Image Tag
28+
29+
[[image-stream-and-image-tag-query-string-parameters]]
30+
=== Query String Parameters
31+
32+
[options="header"]
33+
|===
34+
|Name|Description|Required|Schema|Default
35+
|imageStream|The value metadata.name as defined in the image stream to be used.|
36+
true|string|
37+
|imageTag|The value spec.tags.name as defined in the image stream to be used.|
38+
true|string|
39+
|namespace|The name of the namespace containing the image stream and image tag
40+
to use.|false|string|openshift
41+
|name|Identifies the resources created for this application.|false|string|
42+
|sourceURI|The git repository URL containing the application source code.|false|
43+
string|
44+
|sourceRef|The branch, tag, or commit for the application source code specified
45+
in sourceURI.|false|string|
46+
|contextDir|The subdirectory for the application source code specified in
47+
sourceURI, used as the context directory for the build.|false|string|
48+
|===
49+
50+
[NOTE]
51+
====
52+
link:https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters[Reserved characters] in parameter values should be URL encoded.
53+
====
54+
55+
[[example-usage-of-an-image-stream-and-image-tag]]
56+
==== Example
57+
----
58+
create?imageStream=nodejs&imageTag=4&name=nodejs&sourceURI=https%3A%2F%2Fgithub.com%2Fopenshift%2Fnodejs-ex.git&sourceRef=master&contextDir=%2F
59+
----
60+
61+
[[create-from-url-using-a-template]]
62+
== Using a Template
63+
64+
[[template-query-string-parameters]]
65+
=== Query String Parameters
66+
67+
[options="header"]
68+
|===
69+
|Name|Description|Required|Schema|Default
70+
|template|The value of metadata.name as defined in the template to be used.|
71+
true|string|
72+
|templateParamsMap|A JSON parameters map containing the template parameter name
73+
and corresponding value you wish to override.|false|JSON|
74+
|namespace|The name of the namespace containing the template to use.|false|string|openshift
75+
|===
76+
77+
[NOTE]
78+
====
79+
link:https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters[Reserved characters] in parameter values should be URL encoded.
80+
====
81+
82+
[[example-usage-of-a-template]]
83+
==== Example
84+
----
85+
create?template=nodejs-mongodb-example&templateParamsMap={"SOURCE_REPOSITORY_URL"%3A"https%3A%2F%2Fgithub.com%2Fopenshift%2Fnodejs-ex.git"}
86+
----

Diff for: install_config/web_console_customization.adoc

+59-9
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ window.OPENSHIFT_EXTENSION_PROPERTIES = {
115115
====
116116

117117
[[customizing-the-logo]]
118-
=== Customizing the Logo
118+
== Customizing the Logo
119119

120120
The following style changes the logo in the web console header:
121121

@@ -142,7 +142,7 @@ assetConfig:
142142
----
143143

144144
[[changing-links-to-documentation]]
145-
=== Changing Links to Documentation
145+
== Changing Links to Documentation
146146

147147
Links to external documentation are shown in various sections of the web
148148
console. The following example changes the URL for two given links to the
@@ -173,7 +173,7 @@ assetConfig:
173173
----
174174

175175
[[adding-or-changing-links-to-download-the-cli]]
176-
=== Adding or Changing Links to Download the CLI
176+
== Adding or Changing Links to Download the CLI
177177

178178
The *About* page in the web console provides download links for the
179179
xref:../cli_reference/index.adoc#cli-reference-index[command line interface (CLI)] tools. These
@@ -259,9 +259,9 @@ assetConfig:
259259
----
260260

261261
[[configuring-navigation-menus]]
262-
=== Configuring Navigation Menus
262+
== Configuring Navigation Menus
263263

264-
==== Top Navigation Dropdown Menus
264+
=== Top Navigation Dropdown Menus
265265

266266
The top navigation bar of the web console contains the help icon and the user
267267
dropdown menus. You can add additional menu items to these using the
@@ -309,7 +309,7 @@ angular
309309
hawtioPluginLoader.addModule('<myExtensionModule>');
310310
----
311311

312-
==== Project Left Navigation
312+
=== Project Left Navigation
313313

314314
When navigating within a project, a menu appears on the left with primary and
315315
secondary navigation. This menu structure is defined as a constant and can be
@@ -416,7 +416,7 @@ endif::[]
416416
endif::[]
417417

418418
[[configuring-catalog-categories]]
419-
=== Configuring Catalog Categories
419+
== Configuring Catalog Categories
420420

421421
Catalog categories organize the display of builder images and templates on the
422422
*Add to Project* page on the {product-title} web console. A builder image or
@@ -515,8 +515,58 @@ endif::[]
515515

516516
endif::[]
517517

518+
[[configuring-the-create-from-url-namespace-whitelist]]
519+
== Configuring the Create From URL Namespace Whitelist
520+
521+
xref:../dev_guide/create_from_url.adoc#dev-guide-create-from-url[Create from URL]
522+
only works with image streams or templates from namespaces that have been
523+
explicitly specified in OPENSHIFT_CONSTANTS.CREATE_FROM_URL_WHITELIST. To add
524+
namespaces to the whitelist, follow these steps:
525+
526+
[NOTE]
527+
====
528+
'openshift' is included in the whitelist by default. It should not be removed.
529+
====
530+
531+
. Create the following configuration scripts within a file (for example,
532+
*_create-from-url-whitelist.js_*):
533+
+
534+
====
535+
----
536+
// Add a namespace containing the image streams and/or templates
537+
window.OPENSHIFT_CONSTANTS.CREATE_FROM_URL_WHITELIST.push(
538+
'shared-stuff'
539+
);
540+
----
541+
====
542+
543+
. Save the file and add it to the master configuration at
544+
*_/etc/origin/master/master-config.yml_*:
545+
+
546+
====
547+
----
548+
assetConfig:
549+
...
550+
extensionScripts:
551+
- /path/to/create-from-url-whitelist.js
552+
----
553+
====
554+
555+
. Restart the master host:
556+
+
557+
====
558+
ifdef::openshift-origin[]
559+
# systemctl restart origin-master
560+
endif::[]
561+
ifdef::openshift-enterprise[]
562+
# systemctl restart atomic-openshift-master
563+
endif::[]
564+
====
565+
566+
endif::[]
567+
518568
[[web-console-enable-wildcard-routes]]
519-
=== Enabling Wildcard Routes
569+
== Enabling Wildcard Routes
520570

521571
If you enabled wildcard routes for a router, you can also enable wildcard
522572
routes in the web console. This lets users enter hostnames starting with an
@@ -541,7 +591,7 @@ xref:../install_config/router/default_haproxy_router.adoc#using-wildcard-routes[
541591
how to configure HAProxy routers to allow wildcard routes].
542592

543593
[[web-console-enable-tech-preview-feature]]
544-
=== Enabling Features in Technology Preview
594+
== Enabling Features in Technology Preview
545595

546596
Sometimes features are available in Technology Preview. By default, these
547597
features are disabled and hidden in the web console.

0 commit comments

Comments
 (0)