Skip to content

Commit 7ff09e0

Browse files
Updated configuration and preference chapters, and downloads odo latest and beta1. Latest is default
1 parent 9d86cf1 commit 7ff09e0

12 files changed

+158
-121
lines changed

.bash_profile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if hash powerline-shell 2>/dev/null; then
1111
fi
1212
fi
1313

14+
#alias odo=odo-v1.0.0-beta1
1415
alias odo=odo-latest
1516

1617
complete -C /opt/app-root/bin/odo odo

.workshop/anmol

Lines changed: 0 additions & 5 deletions
This file was deleted.

.workshop/setup

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ set -eo pipefail
66

77
# Use odo v1.0.0-beta1
88
# ----------------
9-
curl -kLs https://github.com/openshift/odo/releases/download/v1.0.0-beta1/odo-linux-amd64 -o /opt/app-root/bin/odo-latest
9+
curl -kLs https://github.com/openshift/odo/releases/download/v1.0.0-beta1/odo-linux-amd64 -o /opt/app-root/bin/odo-v1.0.0-beta1
10+
chmod 755 /opt/app-root/bin/odo-v1.0.0-beta1
11+
# ----------------
12+
# Also get odo latest binary built
13+
# ----------------
14+
curl -kLs https://dl.bintray.com/odo/odo/latest/linux-amd64/odo -o /opt/app-root/bin/odo-latest
1015
chmod 755 /opt/app-root/bin/odo-latest
1116
# ----------------
1217

13-
odo utils config set UpdateNotification false
18+
/opt/app-root/bin/odo-latest preference set UpdateNotification false
1419

1520
if [ x"$PROJECT_NAMESPACE" != x"" ]; then
1621
# TODO: Change back to view once the issue is solved

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/openshiftlabs/workshop-dashboard:2.8.1
1+
FROM quay.io/openshiftlabs/workshop-dashboard:2.10.3
22

33
RUN source /opt/workshop/etc/profile.d/python.sh && \
44
pip install --no-cache-dir powerline-shell==0.7.0 && \
@@ -28,4 +28,4 @@ RUN rm Dockerfile .gitignore .dockerignore && \
2828

2929
USER 1001
3030

31-
ENV ODO_VERSION=0.0.17
31+
ENV ODO_VERSION=v1.0.0-beta1

workshop/content/040-overview.md

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Now although the intent is to show as much as possible of what `odo` can do, bec
1515
If you were using `odo` with your own cluster, you could log in to the cluster by using:
1616

1717
```bash
18-
odo login
18+
odo login <CLUSTER_URL>
1919
```
2020

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.
21+
The command will interactively prompt you for details of the user.
2222

2323
### Projects
2424

@@ -36,67 +36,4 @@ odo project --help
3636

3737
The `--help` option can be used on any `odo` command to see more details about what it can do.
3838

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
97-
98-
**Type** - The type of component
99-
100-
**Url** - URL to access the component
101-
102-
39+
Since we already have a project created for us, we are good to go though, and do not need to create one.

workshop/content/060-creating-new-binary-component.md

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Title: Creating a new binary component
33
PrevPage: 050-creating-an-application
4-
NextPage: 061-exposing-components-to-public
4+
NextPage: 062-component-configuration
55
---
66

77
A selection of runtimes, frameworks, and other components is available on an OpenShift cluster for building your applications.
@@ -59,7 +59,7 @@ odo create java frontend --binary target/parksmap-web.jar --app parksmap
5959
Please use `odo push` command to create the component with source deployed
6060
```
6161

62-
What does it mean for ``odo`` to create the configuration for a component? Let's take a look.
62+
What does it mean for ``odo`` to create the configuration for a component? Let's take a look.
6363

6464
```execute-1
6565
ls -al .odo
@@ -91,7 +91,7 @@ To view this in a more human-readable way, run:
9191
odo config view
9292
```
9393

94-
While we have this configuration defined, the application is not yet deployed on OpenShift.
94+
While we have this configuration defined, the application is not yet deployed on OpenShift. We will learn in the next lab more about the component's configuration.
9595

9696
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.
9797

@@ -120,41 +120,4 @@ When the push completes, ``odo`` will display output similar to:
120120
✓ Changes successfully pushed to component: frontend
121121
```
122122

123-
## Component configuration
124-
When creating a component, some configuration will be inherited by default, but there is a way to override these defaults.
125-
126-
An example is the memory and cpu for your component. When deploying components in an OpenShift platform, ``odo`` will not impose any configuration for cpu and memory, but sometimes the platform does impose some values for the minimum and maximum cpu and memory a deployment can have.
127-
128-
If you want to explicitly set these values, you could have done before:
129-
130-
```
131-
odo create java frontend \
132-
--binary target/parksmap-web.jar \
133-
--app parksmap \
134-
--memory 1Gi \
135-
--cpu 1
136-
```
137-
138-
This will guarantee that your component will be created requesting 1 GB of memory as minimum and maximum and 1 CPU as minimum and maximum.
139-
140-
If you want your component to get some minimum values and grow if needed, you could also have done:
141-
142-
```
143-
odo create java frontend \
144-
--binary target/parksmap-web.jar \
145-
--app parksmap \
146-
--min-memory 512Mi \
147-
--max-memory 1Gi \
148-
--min-cpu 0.5 \
149-
--max-cpu 1
150-
```
151-
152-
You can also set environment variables for your component at creation time. These will be passed to your component and you will be able to use them within your application's code.
153-
154-
```
155-
odo create java frontend --binary target/parksmap-web.jar \
156-
--app parksmap \
157-
--env DEBUG=true
158-
```
159-
160-
Now that you've created the `frontend` component for the application and pushed it to your OpenShift cluster, let's look at how you can access the application frontend.
123+
Now that you've created the `frontend` component for the application and pushed it to your OpenShift cluster, let's look at how you can access the application frontend. But before we do that, it's time to do a little break to introduce you better to odo configuration.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
Title: Component configuration
3+
PrevPage: 060-creating-new-binary-component
4+
NextPage: 065-exposing-components-to-public
5+
---
6+
7+
When creating a component, some configuration will be inherited by default, but there is a way to override these defaults.
8+
9+
An example is the memory and cpu for your component. When deploying components in an OpenShift platform, ``odo`` will not impose any configuration for cpu and memory, but sometimes the platform does impose some values for the minimum and maximum cpu and memory a deployment can have.
10+
11+
If you want to explicitly set these values, you could have done before:
12+
13+
```
14+
odo create java frontend \
15+
--binary target/parksmap-web.jar \
16+
--app parksmap \
17+
--memory 1Gi \
18+
--cpu 1
19+
```
20+
21+
This will guarantee that your component will be created requesting 1 GB of memory as minimum and maximum and 1 CPU as minimum and maximum.
22+
23+
If you want your component to get some minimum values and grow if needed, you could also have done:
24+
25+
```
26+
odo create java frontend \
27+
--binary target/parksmap-web.jar \
28+
--app parksmap \
29+
--min-memory 512Mi \
30+
--max-memory 1Gi \
31+
--min-cpu 0.5 \
32+
--max-cpu 1
33+
```
34+
35+
You can also set environment variables for your component at creation time. These will be passed to your component and you will be able to use them within your application's code.
36+
37+
```
38+
odo create java frontend --binary target/parksmap-web.jar \
39+
--app parksmap \
40+
--env DEBUG=true
41+
```
42+
43+
Odo, like git, stores it's configuration on a local folder `.odo`. As we have seen, we can see the component's configuration easily:
44+
45+
```execute-1
46+
odo config view
47+
```
48+
49+
The component configuration parameters are defined as follows:
50+
51+
* **Application** - Application is the name of application the component needs to be part of
52+
* **CPU** - The minimum and maximum CPU a component can consume
53+
* **Ignore** - Consider the .odoignore file for push and watch
54+
* **MaxCPU** - The maximum CPU a component can consume
55+
* **MaxMemory** - The maximum memory a component can consume
56+
* **Memory** - The minimum and maximum memory a component can consume
57+
* **MinCPU** - The minimum CPU a component can consume
58+
* **MinMemory** - The minimum memory a component is provided
59+
* **Name** - The name of the component
60+
* **Ports** - Ports to be opened in the component
61+
* **Project** - Project is the name of the project the component is part of
62+
* **Ref** - Git ref to use for creating component from git source
63+
* **SourceLocation** - The path indicates the location of binary file or git source
64+
* **SourceType** - Type of component source - git/binary/local
65+
* **Type** - The type of component
66+
* **Url** - URL to access the component
67+
68+
More will come as odo evolves.
69+
70+
But not only you can set predefined configuration, which will affect how your application will be deployed. When your application needs some configuration, this is the same mechanism to configure it.
71+
72+
Let's add a configuration to our current component:
73+
74+
```execute-1
75+
odo config set --env DEV_MODE=true
76+
```
77+
78+
We can now see the new configuration defined at the top of the output as `Environment variables`:
79+
80+
```execute-1
81+
odo config view
82+
```
83+
84+
One thing that you can now think is that, if we have a component already configured in Version Control with odo configuration in place, we can easily deploy the component in one step:
85+
86+
```
87+
git clone <COMPONENT_GIT_URL>
88+
odo push
89+
```
90+
91+
Soon you'll find many projects with odo configuration in place. For you to work with these applications you will only need to execute a simple command. Isn't that cool!!!

workshop/content/061-exposing-components-to-public.md renamed to workshop/content/065-exposing-components-to-public.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Title: Exposing components to public
3-
PrevPage: 060-creating-new-binary-component
3+
PrevPage: 062-component-configuration
44
NextPage: 070-deploying-component-from-source-code
55
---
66

@@ -13,7 +13,7 @@ odo url create frontend --port 8080
1313
Similar to when we create a component, creating a URL sets that information in the component configuration, but it doesn't get applied to your OpenShift cluster until you run `odo push`.
1414

1515
```execute-1
16-
odo push
16+
odo push --show-log
1717
```
1818

1919
Watch the logs and wait until the component is ready.

workshop/content/070-deploying-component-from-source-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Title: Deploying component from source code
3-
PrevPage: 061-exposing-components-to-public
3+
PrevPage: 065-exposing-components-to-public
44
NextPage: 075-create-a-service
55
---
66

workshop/content/110-installing-odo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Title: Installing odo
33
PrevPage: 105-whats-next
4-
NextPage: 120-finish
4+
NextPage: 115-odo-preferences
55
---
66

77
The `odo` tool is a single executable written in the Go

0 commit comments

Comments
 (0)