You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workshop/content/040-overview.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
Title: Application overview
2
+
Title: Interacting with OpenShift
3
3
PrevPage: 030-deploy-an-app
4
4
NextPage: 050-creating-an-application
5
5
---
@@ -10,6 +10,8 @@ The goal for this lab is to showcase `odo` and all of its primitives and to do s
10
10
11
11
Now although the intent is to show as much as possible of what `odo` can do, because of how the workshop environment works, we have skipped how you can log in to OpenShift using `odo`. In the workshop environment, you have already been logged in from the terminal window. You also have a project created for you in advance.
12
12
13
+
### Authentication
14
+
13
15
If you were using `odo` with your own cluster, you could log in to the cluster by using:
14
16
15
17
```bash
@@ -18,6 +20,8 @@ odo login
18
20
19
21
The command will interactively prompt you for details of the cluster. Alternatively you could supply the address of the OpenShift cluster as an argument.
20
22
23
+
### Projects
24
+
21
25
To create, change, or delete projects, you can use the `odo project` command. Run `odo project get` to show you the name of the current project you are working in:
22
26
23
27
```execute
@@ -33,3 +37,66 @@ odo project --help
33
37
The `--help` option can be used on any `odo` command to see more details about what it can do.
34
38
35
39
Since we already have a project created for us, we are good to go though, and do not need to create one.
40
+
41
+
## Component configuration and global preferences
42
+
43
+
There are a couple other commands you can run to view component configuration and `odo` preferences that are global.
44
+
45
+
Run this command to view the values for global `odo` preferences:
46
+
47
+
```execute-1
48
+
odo preference view
49
+
```
50
+
51
+
The preference parameters are defined as follows:
52
+
53
+
54
+
**NamePrefix** - Default prefix is the current directory name. Use this value to set a default name prefix
55
+
56
+
**Timeout** - Timeout (in seconds) for OpenShift server connection check
57
+
58
+
**UpdateNotification** - Controls if an update notification is shown or not (true or false)
59
+
60
+
61
+
To view the current component configuration, run this command:
62
+
63
+
```execute-1
64
+
odo config view
65
+
```
66
+
67
+
The component configuration parameters are defined as follows:
68
+
69
+
70
+
**Application** - Application is the name of application the component needs to be part of
71
+
72
+
**CPU** - The minimum and maximum CPU a component can consume
73
+
74
+
**Ignore** - Consider the .odoignore file for push and watch
75
+
76
+
**MaxCPU** - The maximum CPU a component can consume
77
+
78
+
**MaxMemory** - The maximum memory a component can consume
79
+
80
+
**Memory** - The minimum and maximum memory a component can consume
81
+
82
+
**MinCPU** - The minimum CPU a component can consume
83
+
84
+
**MinMemory** - The minimum memory a component is provided
85
+
86
+
**Name** - The name of the component
87
+
88
+
**Ports** - Ports to be opened in the component
89
+
90
+
**Project** - Project is the name of the project the component is part of
91
+
92
+
**Ref** - Git ref to use for creating component from git source
93
+
94
+
**SourceLocation** - The path indicates the location of binary file or git source
95
+
96
+
**SourceType** - Type of component source - git/binary/local
Copy file name to clipboardExpand all lines: workshop/content/060-creating-new-binary-component.md
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,12 @@ ComponentSettings:
85
85
Name: frontend
86
86
```
87
87
88
+
To view this in a more human-readable way, run:
89
+
90
+
```execute-1
91
+
odo config view
92
+
```
93
+
88
94
While we have this configuration defined, the application is not yet deployed on OpenShift.
89
95
90
96
When we run `odo push`, a container will be created with the Java application server and then, since this is a binary component, your JAR file will be pushed to that container.
@@ -114,20 +120,6 @@ When the push completes, ``odo`` will display output similar to:
114
120
✓ Changes successfully pushed to component: frontend
115
121
```
116
122
117
-
You can verify that the Java runtime has started your application by tailing the logs for your component:
118
-
119
-
```execute-1
120
-
odo log -f
121
-
```
122
-
123
-
Select the terminal window and enter:
124
-
125
-
```execute-1
126
-
<ctrl+c>
127
-
```
128
-
129
-
when you're finished checking out the logs.
130
-
131
123
## Component configuration
132
124
When creating a component, some configuration will be inherited by default, but there is a way to override these defaults.
Copy file name to clipboardExpand all lines: workshop/content/061-exposing-components-to-public.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,27 @@ Similar to when we create a component, creating a URL sets that information in t
16
16
odo push
17
17
```
18
18
19
-
The URL created for the application will be displayed. Visit the URL in your web browser to view the application.
19
+
Watch the logs and wait until the component is ready.
20
+
21
+
```execute-2
22
+
cd ~/frontend
23
+
odo log -f
24
+
```
25
+
26
+
You're looking for a message like this:
27
+
28
+
```
29
+
2019-04-26 23:55:05.355 INFO 752 --- [ main] c.o.evg.roadshow.ParksMapApplication
30
+
: Started ParksMapApplication in 5.261 seconds (JVM running for 5.853)
31
+
```
32
+
33
+
Once you see that, execute `ctrl+c`
34
+
35
+
```execute-2
36
+
<ctrl+c>
37
+
```
38
+
39
+
The URL created for the application will be displayed in the output of the `odo push` command. Visit the URL in your web browser to view the application.
Copy file name to clipboardExpand all lines: workshop/content/075-create-a-service.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,32 +26,34 @@ When you don't specify any parameter to the creation of a service, you'll be int
26
26
27
27
-*Which kind of service do you wish to create* Select `database` with the arrows and hit enter.
28
28
-*Which database service class should we use* As you type `mongo` the list will be filtered. From the two available options, select `mongodb-ephemeral`
29
-
- For the following options, just accept the defaults.
29
+
- For the following options, accept the defaults**except** for the last question. Answer **y** to "Wait for the service to be ready".
30
30
31
31
You will see something similar to this:
32
32
33
33
```bash
34
34
odo service create
35
-
? Which kind of service do you wish to create? database
36
-
? Which database service class should we use? mongodb-ephemeral
35
+
? Which kind of service do you wish to create database
36
+
? Which database service class should we use mongodb-ephemeral
37
37
? Enter a value for string property DATABASE_SERVICE_NAME (Database Service Name): mongodb
38
38
? Enter a value for string property MEMORY_LIMIT (Memory Limit): 512Mi
39
39
? Enter a value for string property MONGODB_DATABASE (MongoDB Database Name): sampledb
40
40
? Enter a value for string property MONGODB_VERSION (Version of MongoDB Image): 3.2
41
41
? Provide values for non-required properties No
42
42
? How should we name your service mongodb-ephemeral
43
-
✓ Service 'mongodb-ephemeral' was created
44
-
Progress of the provisioning will not be reported and might take a long time.
45
-
You can see the current status by executing 'odo service list'
43
+
? Output the non-interactive version of the selected options No
44
+
? Wait for the service to be ready Yes
45
+
✓ Creating service
46
+
✓ Waiting for service to come up
47
+
✓ Service 'mongodb-ephemeral' is ready for use
46
48
```
47
49
48
-
Now we can wait until the service is provisioned:
50
+
Run the following to confirm that the service is provisioned:
49
51
50
52
```execute-1
51
53
odo service list
52
54
```
53
55
54
-
Keep re-running this command, and once provisioned, we should see similar output to this:
Copy file name to clipboardExpand all lines: workshop/content/080-linking-components-to-services.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This will inject configuration into the backend about the mongodb and restart th
17
17
We can see when our application has been restarted by looking at the logs of the backend.
18
18
19
19
```execute-1
20
-
odo log backend
20
+
odo log backend -f
21
21
```
22
22
23
23
__NOTE__: As a redeployment is happening in OpenShift, this might take some time. Check the logs until the component has successfully restarted. The message you need to see before continuing is:
@@ -26,9 +26,15 @@ __NOTE__: As a redeployment is happening in OpenShift, this might take some time
26
26
Listening on 0.0.0.0, port 8080
27
27
```
28
28
29
+
Then enter:
30
+
31
+
```execute-1
32
+
<ctrl+c>
33
+
```
34
+
29
35
__NOTE__: Due to a bug this is currently taking a bit longer than expected, so be patient.
30
36
31
-
When the component finally restarts, you should now see a log showing the connection details to our database. We can now execute the same command we did before to load the database with data.
37
+
When the component restarts, you should now see a log showing the connection details to our database. We can now execute the same command we did before to load the database with data.
Copy file name to clipboardExpand all lines: workshop/content/081-change-active-component.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Now that our backend is fully functional, we need to connect to it from our `fro
8
8
9
9
As we're going to execute some actions with the `frontend` component, we need to set it as our active component.
10
10
11
-
__NOTE__: In the near future, the current component will be defined by the directory you're in with your shell, just like *Git* does. For now, there's a way to get and change the current selected component to which some of this commands will relate.
11
+
The current, or active, component is defined by the directory you're in with your shell, just as in *Git*.
12
12
13
13
To get a list of existing components within your application do:
14
14
@@ -25,16 +25,16 @@ ACTIVE NAME TYPE
25
25
frontend java
26
26
```
27
27
28
-
The active component is the `backend`. You can either take one of two paths, change your active component and execute the `in-context` actions on it or we can specify to any command to which component the command is related. Let's do the former, but this is how the latter would look like.
28
+
The active component is the `backend`. You can either take one of two paths, change to the directory for your component and execute the `in-context` actions on it or we can specify to any command to which component the command is related. Let's do the former, but this is how the latter would look like.
29
29
30
30
```bash
31
31
odo <COMMAND> --component frontend
32
32
```
33
33
34
-
Now to set your active component, do:
34
+
Now to set the frontend as your active component, do:
Copy file name to clipboardExpand all lines: workshop/content/091-linking-application-components.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,10 @@ __NOTE__: Here we have explicitly provided the component to which the link shoul
16
16
17
17
This will inject configuration into the frontend about the backend and restart the frontend.
18
18
19
-
Some components might expose multiple ports, and you need to select which one is the appropriate to use. In case you don't specify the port to use, you will see a nice warning message instructing you how to best proceed.
20
-
21
-
Your frontend component will be redeployed.
22
-
23
-
__NOTE__: We have found a bug in `odo` as we were testing this lab and you'll need to re-push your application again. This will be fixed in the coming week. Trust us :-D
19
+
Now, re-push the component:
24
20
25
21
```execute-1
26
-
cd ~/frontend
27
-
odo push frontend
22
+
odo push
28
23
```
29
24
30
25
You can check the the startup logs:
@@ -46,3 +41,5 @@ Once the component has successfully been re-deployed you can see the changes in
Copy file name to clipboardExpand all lines: workshop/content/100-making-changes-to-source-code.md
+4-10Lines changed: 4 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,13 @@ NextPage: 105-whats-next
6
6
7
7
We've deployed the first version of our sample application and tested it by visiting it with a browser. Let's look at how OpenShift and ``odo`` help make it easier to iterate on that app once it's running.
8
8
9
-
Let's first get back to our `nodejs backend` component.
10
-
11
-
```execute-1
12
-
odo component set backend
13
-
```
14
-
15
-
Let's also make sure we're in the right directory on the upper terminal:
9
+
Let's first get back to our `backend` component.
16
10
17
11
```execute-1
18
12
cd ~/backend
19
13
```
20
14
21
-
and the lower terminal.
15
+
Let's also make sure we're in the right directory on the lower terminal:
22
16
23
17
```execute-2
24
18
cd ~/backend
@@ -30,7 +24,7 @@ Now we start the ``odo`` tool to ``watch`` for changes on the file system in the
30
24
odo watch
31
25
```
32
26
33
-
To change the displayed name for our backend, we edit the file `bin/config.js`.
27
+
We will make a small change to the displayed name for our backend, from "National Parks" to "Worldwide National Parks". To change the displayed name for our backend, we edit the file `bin/config.js`.
34
28
35
29
```execute-1
36
30
vi bin/config.js
@@ -56,7 +50,7 @@ Once it does, make a new query to the REST endpoint to validate it has changed.
__NOTE__: The same bug as before also makes the watch operation missbehave and be slow. As we said before, this will be fixed in the coming week. Trust us :-D
53
+
__NOTE__: The same bug as before also makes the watch operation be slow. As we said before, this will be fixed in the coming week. Trust us :-D
0 commit comments