Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KIALI-1536] Updating Bookinfo Ansible Playbook with Istio 1.0 scripts and MySQL and MongoDB #468

Merged
merged 7 commits into from Sep 19, 2018

Conversation

@gbaufake
Copy link
Member

commented Aug 29, 2018

  • Including MongoDB and MYSQL options
  • It does include the traffic generator
  • Updates the old readme (it was referring to istio 0.8.0)
  • In consonance with #452

cc @jmazzitelli.

Best Regards,
Guilherme Baufaker Rẽgo

@gbaufake gbaufake requested a review from jmazzitelli Aug 29, 2018
- If you want to enable MongoDB for ratings, you may use the following command

```
ansible-playbook bookinfo.yml -e ingress_route=false -e traffic_generator=true -e rate=1 -e -vv

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Aug 29, 2018

Contributor

What's the difference between this command and the one on line 49? Is there supposed to be an option to turn on mongodb that is missing here?

```


=== Kiali Traffic Generator with MongoDB

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Aug 29, 2018

Contributor

Since this also supports MySQL, you should add a section about that, too ("Kiali Traffic Generator with MySQL DB").

Copy link
Contributor

left a comment

see my comments

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2018

@jmazzitelli
Solved in 313d849

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2018

@jmazzitelli
Can you review it?

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

$ ansible-playbook bookinfo.yml -e ingress_route=true -e traffic_generator=true -e rate=1 -vv -e mysql=true -e bookinfo_namespace=bookinfoansible

results in:

fatal: [localhost]: FAILED! => {"changed": true, "cmd": "oc get route istio-ingressgateway -o jsonpath='{.spec.host}{\"\\n\"}' -n istio-system", "delta": "0:00:00.170135", "end": "2018-08-31 16:25:30.744247", "msg": "non-zero return code", "rc": 1, "start": "2018-08-31 16:25:30.574112", "stderr": "Error from server (NotFound): routes.route.openshift.io \"istio-ingressgateway\" not found", "stderr_lines": ["Error from server (NotFound): routes.route.openshift.io \"istio-ingressgateway\" not found"], "stdout": "", "stdout_lines": []}

I do have bookinfoansible namespace and I see the bookinfo pods in there but that's it:

$ oc get pods -n bookinfoansible
NAME                               READY     STATUS    RESTARTS   AGE
details-v1-676d789f4c-6kr9b        2/2       Running   0          3m
mysqldb-v1-59f47f47f6-sgj2d        2/2       Running   0          2m
productpage-v1-54f88486bc-48jb4    2/2       Running   0          2m
ratings-v1-fb7df5987-p4jhh         2/2       Running   0          2m
ratings-v2-mysql-cf4894d7f-2hsgz   2/2       Running   0          2m
reviews-v1-8568fdcf99-mtlrp        2/2       Running   0          2m
reviews-v2-8596f84c5-zjvv2         2/2       Running   0          2m
reviews-v3-56568b7595-4jnj9        2/2       Running   0          2m

Kiali shows me no traffic.

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

Also, I see the -rename files are removed - how do I set the app label values to be something different? The rename files are so we could have the app labels like "productpage-app" where the service name is still simply "productpage"?

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2018

@jmazzitelli
On the upstream installer, I have added the export for ingress-gateway service (in order to use the route), probably you are not doing the same on the same (a simple oc expose svc ingress-gateway would solve the problem)

The new meshes has the named resources (virtual service, app, deployment) - so i thought the bookinfo-renamed is not "useful", i can bring it back if you want.

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

The new meshes has the named resources (virtual service, app, deployment)

I don't see the difference in the service names versus the app label. For example, I was looking for a service named "details" but an app label on the details workload pod to be something different (like "details-app" but I don't see that:

$ oc get service details -o custom-columns=LABELS:.metadata.labels -n bookinfoansible
LABELS
map[app:details]

$ oc get pod details-v1-676d789f4c-6kr9b -o custom-columns=LABELS:.metadata.labels -n bookinfoansible
LABELS
map[app:details pod-template-hash:2328345907 version:v1]

Notice the service name, the service app label, and the pod app label are all the same: details

We want the app label to be something different from a service name, deployment name, or pod name. So in this case it would be nice if the app labels shown above were something like "details-app".

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

On the upstream installer, I have added the export for ingress-gateway service (in order to use the route), probably you are not doing the same on the same (a simple oc expose svc ingress-gateway would solve the problem)

Can we have this ansible playbook expose that if it isn't exposed already?

If the playbook runs this: oc get route ingress-gateway -n istio-system and checks the exit code (0 means the route already exists, non-0 means it doesn't exist and we need to create it). If the exit code is non-0, the playbook can run "oc expose svc ingress-gateway -n istio-system" to ensure the route is created.

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2018

@jmazzitelli
By new meshes, I was referring the kiali-test-mesh project.

@gbaufake gbaufake force-pushed the gbaufake:ansible_bookinfo_update branch 2 times, most recently from 9c2ddbd to c32697b Aug 31, 2018
@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2018

@gbaufake the only thing I would want now is the ability for this ansible playbook to change the app labels to something different kinda like we were able to do before (but without hardcoding the yaml in those rename/ files - kinda sucked that we had to put full copies of the yaml - i was hoping ansible had a way to edit the yaml on the fly to be able to do this).

So is it possible to change this so, for example, I send in the option "-e app_label_suffix=foo" and have all the app labels in bookinfo demo have "foo" at the end of their names (like detailsfoo, productpagefoo, ratingsfoo, etc)?

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 4, 2018

@jmazzitelli
I will add that.

@gbaufake gbaufake force-pushed the gbaufake:ansible_bookinfo_update branch from c32697b to 093e517 Sep 12, 2018
@gbaufake gbaufake changed the title Updating Bookinfo Ansible Playbook with Istio 1.0 scripts and MySQL and MongoDB [KIALI-1536] Updating Bookinfo Ansible Playbook with Istio 1.0 scripts and MySQL and MongoDB Sep 12, 2018
@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 12, 2018

@jmazzitelli
Can you review?

@gbaufake gbaufake requested a review from jmazzitelli Sep 12, 2018
@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 12, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #16

  • ✔️ Istio-and-Kiali-on-Openshift #[1206]
  • ✔️ Kiali-on-Openshift #[553]
  • ✔️ Kiali-Istio-Checker #[992]
  • ✔️ run-kiali-e2e-tests #[47]

KIALI_NAME=kialicorepr468-istio-system

@@ -18,9 +18,9 @@
apiVersion: v1
kind: Service
metadata:
name: details
name: details-service${LABEL}

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Sep 12, 2018

Contributor

does this work? I believe the bookinfo code hardcodes the names of the services - so you renaming the service "details-service-${LABEL}" is going to break that code - I bet if you run this, you'll get 100% errors going to all these services because you renamed them.

This is why we need to append ${LABEL} to the end of the app labels. If it was just a matter of renaming the service names to have "-service" prefixes at the end, then we would have no need for ${LABEL} at all - since the service name and app label values would all be different. But we can't rename the services - they have to remain "details" and "reviews" and "ratings" because the bookinfo application code literally hardcodes those values. Thus, we need to keep the service names the same and add ${LABEL} to the end of only the app label values.

@@ -53,15 +53,15 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: ratings
name: ratings-service${LABEL}

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Sep 12, 2018

Contributor

Can't make this change. Service name needs to be ratings.

@@ -88,15 +88,15 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: reviews
name: reviews-service

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Sep 12, 2018

Contributor

can't make this change - service name must be "reviews"

@@ -161,15 +161,15 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: productpage
name: productpage-service

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Sep 12, 2018

Contributor

can't make this change, service name must be productpage

Copy link
Contributor

left a comment

See my comments. I haven't run this, but I'm pretty sure renaming the service names breaks the bookinfo demo (I actually tried to do this myself, that is why I think this - I'm pretty sure when I did this, the entire app broke).

@gbaufake gbaufake force-pushed the gbaufake:ansible_bookinfo_update branch from ba645bd to 3339383 Sep 12, 2018
@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 12, 2018

@jmazzitelli
Reverted services names, only using customized app-labels
in 3339383

Please, can you do another review? 😃

@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 13, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #18

  • 🔴 Istio-and-Kiali-on-Openshift #[1213]
  • 🔴 Kiali-on-Openshift #[560]

KIALI_NAME=kialicorepr468-istio-system

@gbaufake gbaufake force-pushed the gbaufake:ansible_bookinfo_update branch from 9d8666d to acb6f18 Sep 13, 2018
@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 13, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #23

  • 🔴 Istio-and-Kiali-on-Openshift #[1227]
  • 🔴 Kiali-on-Openshift #[575]

KIALI_NAME=kialicorepr468-istio-system

@kiali kiali deleted a comment from rhqci Sep 13, 2018
@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #28

  • 🔴 Istio-and-Kiali-on-Openshift #[1245]
  • 🔴 Kiali-on-Openshift #[589]

KIALI_NAME=kialicorepr468-istio-system

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 14, 2018

kialiqeci

@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #31

  • 🔴 Istio-and-Kiali-on-Openshift #[1248]
  • ✔️ Kiali-on-Openshift #[592]
  • ✔️ Kiali-Istio-Checker #[1019]
  • 🔴 run-kiali-e2e-tests #[65]

KIALI_NAME=kialicorepr468-istio-system

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Sep 14, 2018

the .sh script works now.
however, ansible script still produces errors to details and mongo ratings

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 14, 2018

kialiqeci

@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #34

KIALI_NAME=kialicorepr468-istio-system

@gbaufake gbaufake requested a review from jmazzitelli Sep 18, 2018
@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 18, 2018

@jmazzitelli
I think I have solved everything in e823f54

The ansible commands ansible-playbook install_bookinfo.yml -e bookinfo_namespace='bookinfoansible' -e rename_label=-mazz -e ingress_route=false -e traffic_generator=true -e rate=1 -e mongodb=true -v

and

ansible-playbook install_bookinfo.yml -e bookinfo_namespace='bookinfoansible' -e rename_label=-mazz -e ingress_route=false -e traffic_generator=true -e rate=1 -e mysql=true -v

should work now.

Please review it.

gbaufake and others added 7 commits Aug 29, 2018
- Including MongoDB and MYSQL options
- Including Traffic Generator
- Renaming Resources
- Updated Readme
2. use correct name for ingressgateway
3. Minor format change to readme (surround the -e option in asciidoc backticks)
@gbaufake gbaufake force-pushed the gbaufake:ansible_bookinfo_update branch from bf4998f to e823f54 Sep 18, 2018
@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 18, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #49

KIALI_NAME=kialicorepr468-istio-system

@rhqci

This comment has been minimized.

Copy link
Collaborator

commented Sep 18, 2018

✔️ Jenkins CI: kiali-core-pr-e2e-test #50

KIALI_NAME=kialicorepr468-istio-system

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2018

@gbaufake I'm seeing a problem, but it might not be related to this PR.

I ran that first command but with a different namespace from what I used before (so I don't have any data in Prometheus from this namespace):

ansible-playbook install_bookinfo.yml -e bookinfo_namespace='bookinfomazz' -e rename_label=-mazz -e ingress_route=false -e traffic_generator=true -e rate=1 -e mongodb=true -vv

it ran OK, and I see the pods:

$ oc get pods -n bookinfomazz 
NAME                                  READY     STATUS    RESTARTS   AGE
details-v1-66c5cd958c-pq4zn           2/2       Running   0          2m
kiali-traffic-generator-wtqts         1/1       Running   0          1m
mongodb-v1-5bc59977bc-9vz4w           2/2       Running   0          2m
productpage-v1-5b9d8bccbc-xb84c       2/2       Running   0          2m
ratings-v1-64755c9fdc-brhrv           2/2       Running   0          2m
ratings-v2-mongodb-6d4655696c-nzvr4   2/2       Running   0          2m
reviews-v1-768677b475-j74zx           2/2       Running   0          2m
reviews-v2-57d745894f-fzmch           2/2       Running   0          2m
reviews-v3-7f9b9944b7-ffggr           2/2       Running   0          2m

but I don't see traffic:

image

When I look at the traffic generator pod logs, I see no messages at all (does the traffic generator produce any logs? My logs are completely empty - not even a "Starting" message).

After I waited several minutes, I tried to generate my own traffic. I can see productpage is exposed - this returns a 200:

$ curl -o /dev/null -k -s -w %{http_code} 'http://productpage-bookinfomazz.192.168.1.19.nip.io/productpage?u=normal'
200

I then went to http://istio-ingressgateway-istio-system.192.168.1.19.nip.io/productpage in my browser and that worked.

But my graph shows no traffic. I look in Prometheus, and I do not see anything hitting the bookinfomazz namespace workloads - prometheus query:

istio_requests_total{destination_workload_namespace="bookinfomazz"}

returns 0 rows.

I'm not sure what is going on.

@jmazzitelli

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2018

I stopped OS/Istio, deleted everything, re-installed/re-started the cluster in a clean state, and now its working.

@gbaufake

This comment has been minimized.

Copy link
Member Author

commented Sep 19, 2018

Copy link
Contributor

left a comment

all is working now

@jmazzitelli jmazzitelli merged commit 96cc2b5 into kiali:master Sep 19, 2018
2 checks passed
2 checks passed
Jenkins-CI Test PASSed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gbaufake gbaufake deleted the gbaufake:ansible_bookinfo_update branch Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.