Skip to content

Commit

Permalink
fix: Hello -> Namaste
Browse files Browse the repository at this point in the history
- Fixes the new revision deployments to use better noticeable change in the response message
- Adds note in build section about the container repository name

Fixes: #25 #26
  • Loading branch information
kameshsampath committed Mar 4, 2019
1 parent b8af4f3 commit 647446c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions 01-basics/knative/service-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ spec:
container:
image: dev.local/rhdevelopers/greeter:0.0.1
env:
- name: MESSAGE_PREFIX
value: Hello
- name: MESSAGE_PREFIX
value: Namaste
livenessProbe:
httpGet:
path: /healthz
Expand Down
6 changes: 3 additions & 3 deletions 01-basics/knative/service-pinned-rev1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ spec:
container:
image: dev.local/rhdevelopers/greeter:0.0.1
env:
- name: MESSAGE_PREFIX
value: Hello
- name: MESSAGE_PREFIX
value: Namaste
livenessProbe:
httpGet:
path: /healthz
readinessProbe:
httpGet:
path: /healthz
path: /healthz
6 changes: 3 additions & 3 deletions 01-basics/knative/service-pinned-rev2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ spec:
container:
image: dev.local/rhdevelopers/greeter:0.0.1
env:
- name: MESSAGE_PREFIX
value: Hello
- name: MESSAGE_PREFIX
value: Namaste
livenessProbe:
httpGet:
path: /healthz
readinessProbe:
httpGet:
path: /healthz
path: /healthz
2 changes: 1 addition & 1 deletion 02-configs-and-routes/config/configuration-rev2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
image: dev.local/rhdevelopers/greeter:0.0.1
env:
- name: MESSAGE_PREFIX
value: Hello
value: Namaste
livenessProbe:
httpGet:
path: /healthz
Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/01basic-fundas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
image: dev.local/rhdevelopers/greeter:0.0.1
env:
- name: MESSAGE_PREFIX #<1>
value: Hello
value: Namaste
----

<1> Adding an environment variable that will be used as the message prefix
Expand All @@ -160,7 +160,7 @@ image::greeter-00002.png[Greeter Service rev2]

Now running the <<basics-show-knative-revisions,command>> will show two revisions namely `greeter-00001` and `greeter-0002`.

<<basics-invoke-service,Invoking Service>> will now show an output like **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 2**, where __Hello__ is the value that we configured via environment variable in the Knative service resource file.
<<basics-invoke-service,Invoking Service>> will now show an output like **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 2**, where __Namaste__ is the value that we configured via environment variable in the Knative service resource file.

[#basics-pinning-revision]
== Pinning service to a revision
Expand Down
12 changes: 6 additions & 6 deletions documentation/modules/ROOT/pages/02configs-and-routes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ spec:
image: dev.local/rhdevelopers/greeter:0.0.1
env: #<1>
- name: MESSAGE_PREFIX
value: Hello
value: Namaste
----

<1> Adding an environment variable that will be used a message prefix.
Expand All @@ -191,7 +191,7 @@ image::greeter-00002.png[Greeter Service rev2]

Now running the <<show-knative-revisions,command>> will show two revisions: `greeter-00001` and `greeter-0002`.

<<invoke-service,Invoking Service>> will now show an output like **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 2**, where __Hello__ is the value that we configured via environment variable in the Knative service resource file.
<<invoke-service,Invoking Service>> will now show an output like **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 2**, where __Namaste__ is the value that we configured via environment variable in the Knative service resource file.

[#crtd-distributing-traffic]
== Distributing traffic
Expand Down Expand Up @@ -237,7 +237,7 @@ kubectl apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}
oc apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}/route/route_all_rev2.yaml[route/route_all_rev2.yaml]
----

You will notice the output on your monitoring terminal to be something like **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 13**.
You will notice the output on your monitoring terminal to be something like **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 13**.

[#crtd-all-rev1-rev2-50]
=== 50-50 split between revision 1 and revision 2
Expand All @@ -254,7 +254,7 @@ kubectl apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}
oc apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}/route/route_rev1-50_rev2-50.yaml[route/route_rev1-50_rev2-50.yaml]
----

You will notice the output will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 11** and **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 10** approximately distributed 50% between the two.
You will notice the output will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 11** and **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 10** approximately distributed 50% between the two.

[#crtd-all-rev1-rev2-75-25]
=== 75-25 split between revision 1 and revision 2
Expand All @@ -271,7 +271,7 @@ kubectl apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}
oc apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}/route/route_rev1-75_rev2-25.yaml[route/route_rev1-75_rev2-25.yaml]
----

You will notice the output will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 6** and **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 7**, with more requests responded by revision 1 approximately distributed 75% to 25 % between revision 1 and revision 2.
You will notice the output will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 6** and **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 7**, with more requests responded by revision 1 approximately distributed 75% to 25 % between revision 1 and revision 2.

[#crtd-all-rev1-rev2-10-90]
=== 10-90 split between revision 1 and revision 2
Expand All @@ -288,7 +288,7 @@ kubectl apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}
oc apply -n knativetutorial -f link:{github-repo}/{configs-and-routes-repo}/route/route_rev1-10_rev2-90.yaml[route/route_rev1-10_rev2-90.yaml]
----

You will notice the will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 4** and **Hello greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 5**, with more requests responded by revision 2 approximately 10% to 90% between revision 1 and revision 2.
You will notice the will be mix of responses like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 4** and **Namaste greeter => greeter-00002-deployment-8d9984dc8-rgzx6: 5**, with more requests responded by revision 2 approximately 10% to 90% between revision 1 and revision 2.

[NOTE]
====
Expand Down
4 changes: 3 additions & 1 deletion documentation/modules/ROOT/pages/04build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ jsonnet --ext-str contextDir='<the build context directory>' \
[source,bash,subs="+macros,+attributes",linenums]
----
jsonnet --ext-str contextDir='java/springboot' \
--ext-str image='docker.io/demo/event-greeter:0.0.1' \
--ext-str image='docker.io/demo/event-greeter:0.0.1' \ #<1>
link:{github-repo}/{build-repo}/knative/templates/docker-build.jsonnet[docker-build.jsonnet]\
| yq r - | tee ../docker-build.yaml
----

<1> In the example the destination container image will be pushed to the repository called `demo` in **hub.docker.com**. When you are creating the docker-build, be sure to update `demo` to the repository in your container registry where you want to push the built container image.

The above command will generate a knative build specification as shown below:

[.text-center]
Expand Down

0 comments on commit 647446c

Please sign in to comment.