openshift-labs / learn-katacoda

The OpenShift learning portal, powered by Katacoda
https://learn.openshift.com
159 stars 266 forks source link

now.httpbin.org does not work #367

Closed jesusmah closed 5 years ago

jesusmah commented 5 years ago

Going through scenario 8-egress I get an error reaching out now.httpbin.org:

$ cd ~/projects/istio-tutorial/recommendation/java/vertx
$ git diff
diff --git a/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java b/recommendation/java/vertx/src/main/java/com/redhat/developer/
index 72cf8bf..5e686e6 100755
--- a/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java
+++ b/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java
@@ -15,7 +15,7 @@ import io.vertx.ext.web.codec.BodyCodec;

 public class RecommendationVerticle extends AbstractVerticle {

-    private static final String RESPONSE_STRING_FORMAT = "recommendation v1 from '%s': %d\n";
+    private static final String RESPONSE_STRING_FORMAT = "recommendation v3 from '%s': %d\n";
     private static final String HTTP_NOW = "now.httpbin.org";

     private static final String HOSTNAME = parseContainerIdFromHostname(
@@ -47,8 +47,8 @@ public class RecommendationVerticle extends AbstractVerticle {
         Router router = Router.router(vertx);
 //        router.get("/").handler(this::timeout);
         router.get("/").handler(this::logging);
-        router.get("/").handler(this::getRecommendations);
-//        router.get("/").handler(this::getNow);
+//        router.get("/").handler(this::getRecommendations);
+        router.get("/").handler(this::getNow);
         router.get("/misbehave").handler(this::misbehave);
         router.get("/behave").handler(this::behave);

$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building recommendation 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- vertx-maven-plugin:1.0.13:initialize (vmp) @ recommendation ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ recommendation ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/projects/istio-tutorial/recommendation/java/vertx/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ recommendation ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /root/projects/istio-tutorial/recommendation/java/vertx/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ recommendation ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/projects/istio-tutorial/recommendation/java/vertx/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ recommendation ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ recommendation ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ recommendation ---
[INFO] Building jar: /root/projects/istio-tutorial/recommendation/java/vertx/target/recommendation.jar
[INFO]
[INFO] --- vertx-maven-plugin:1.0.13:package (vmp) @ recommendation ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.892 s
[INFO] Finished at: 2019-02-27T19:07:33+00:00
[INFO] Final Memory: 21M/284M
[INFO] ------------------------------------------------------------------------
$ docker build -t example/recommendation:v3 .
Sending build context to Docker daemon 7.389 MB
Step 1/4 : FROM fabric8/java-jboss-openjdk8-jdk:1.3.1
 ---> 366af6ad1240
Step 2/4 : ENV JAVA_APP_DIR /deployments
 ---> Using cache
 ---> 58779528dd20
Step 3/4 : EXPOSE 8080 8778 9779
 ---> Using cache
 ---> 580262e89720
Step 4/4 : COPY target/recommendation.jar /deployments/
 ---> fecd2556f5c8
Removing intermediate container b63bb5516135
Successfully built fecd2556f5c8
$ docker images | grep recommendation
example/recommendation                                              v3                  fecd2556f5c8        3 seconds ago       443 MB
example/recommendation                                              v2                  315990621fdb        2 minutes ago       443 MB
example/recommendation                                              v1                  60f812512c29        2 minutes ago       443 MB
$ oc apply -f <(istioctl kube-inject -f ../../kubernetes/Deployment-v3.yml) -n tutorial
deployment.extensions "recommendation-v3" created
$ oc get pods -w
NAME                                 READY     STATUS     RESTARTS   AGE
customer-685cff774c-k8t6l            2/2       Running    0          3m
preference-v1-5d86858d8d-blnhl       2/2       Running    0          3m
recommendation-v1-64658c6f6-q98wj    2/2       Running    0          2m
recommendation-v2-7cb7794786-n2qp5   2/2       Running    0          2m
recommendation-v3-547b6c5c56-kvpbt   0/2       Init:0/1   0          2s
recommendation-v3-547b6c5c56-kvpbt   0/2       Init:0/1   0         3s
recommendation-v3-547b6c5c56-kvpbt   0/2       PodInitializing   0         4s
recommendation-v3-547b6c5c56-kvpbt   1/2       Running   0         7s
recommendation-v3-547b6c5c56-kvpbt   2/2       Running   0         16s
^C$ ^C
$ istioctl create -f ~/projects/istio-tutorial/istiofiles/destination-rule-recommendation-v1-v2-v3.yml -n tutorial; \
> istioctl create -f ~/projects/istio-tutorial/istiofiles/virtual-service-recommendation-v3.yml
Created config destination-rule/tutorial/recommendation at revision 8213
Created config virtual-service/tutorial/recommendation at revision 8215
$ ^C
$ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ ^C
$ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ istioctl create -f ~/projects/istio-tutorial/istiofiles/service-entry-egress-httpbin.yml -n tutorial
Created config service-entry/tutorial/httpbin-egress-rule at revision 8321
$ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ ^C
$ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
$ ^C
$ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com
customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries
BenHall commented 5 years ago

Thanks for letting us know. It looks like they have removed the service. We'll look at what's the alternative.

On Wed, 27 Feb 2019, 19:12 Jesus Almaraz, notifications@github.com wrote:

Going through scenario 8-egress I get an error reaching out now.httpbin.org:

$ cd ~/projects/istio-tutorial/recommendation/java/vertx $ git diff diff --git a/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java b/recommendation/java/vertx/src/main/java/com/redhat/developer/ index 72cf8bf..5e686e6 100755 --- a/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java +++ b/recommendation/java/vertx/src/main/java/com/redhat/developer/demos/recommendation/RecommendationVerticle.java @@ -15,7 +15,7 @@ import io.vertx.ext.web.codec.BodyCodec;

public class RecommendationVerticle extends AbstractVerticle {

  • private static final String RESPONSE_STRING_FORMAT = "recommendation v1 from '%s': %d\n";
  • private static final String RESPONSE_STRING_FORMAT = "recommendation v3 from '%s': %d\n"; private static final String HTTP_NOW = "now.httpbin.org";

    private static final String HOSTNAME = parseContainerIdFromHostname( @@ -47,8 +47,8 @@ public class RecommendationVerticle extends AbstractVerticle { Router router = Router.router(vertx); // router.get("/").handler(this::timeout); router.get("/").handler(this::logging);

  • router.get("/").handler(this::getRecommendations); -// router.get("/").handler(this::getNow); +// router.get("/").handler(this::getRecommendations);
  • router.get("/").handler(this::getNow); router.get("/misbehave").handler(this::misbehave); router.get("/behave").handler(this::behave);

$ mvn package [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building recommendation 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- vertx-maven-plugin:1.0.13:initialize (vmp) @ recommendation --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ recommendation --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /root/projects/istio-tutorial/recommendation/java/vertx/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ recommendation --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /root/projects/istio-tutorial/recommendation/java/vertx/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ recommendation --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /root/projects/istio-tutorial/recommendation/java/vertx/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ recommendation --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ recommendation --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ recommendation --- [INFO] Building jar: /root/projects/istio-tutorial/recommendation/java/vertx/target/recommendation.jar [INFO] [INFO] --- vertx-maven-plugin:1.0.13:package (vmp) @ recommendation --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.892 s [INFO] Finished at: 2019-02-27T19:07:33+00:00 [INFO] Final Memory: 21M/284M [INFO] ------------------------------------------------------------------------ $ docker build -t example/recommendation:v3 . Sending build context to Docker daemon 7.389 MB Step 1/4 : FROM fabric8/java-jboss-openjdk8-jdk:1.3.1 ---> 366af6ad1240 Step 2/4 : ENV JAVA_APP_DIR /deployments ---> Using cache ---> 58779528dd20 Step 3/4 : EXPOSE 8080 8778 9779 ---> Using cache ---> 580262e89720 Step 4/4 : COPY target/recommendation.jar /deployments/ ---> fecd2556f5c8 Removing intermediate container b63bb5516135 Successfully built fecd2556f5c8 $ docker images | grep recommendation example/recommendation v3 fecd2556f5c8 3 seconds ago 443 MB example/recommendation v2 315990621fdb 2 minutes ago 443 MB example/recommendation v1 60f812512c29 2 minutes ago 443 MB $ oc apply -f <(istioctl kube-inject -f ../../kubernetes/Deployment-v3.yml) -n tutorial deployment.extensions "recommendation-v3" created $ oc get pods -w NAME READY STATUS RESTARTS AGE customer-685cff774c-k8t6l 2/2 Running 0 3m preference-v1-5d86858d8d-blnhl 2/2 Running 0 3m recommendation-v1-64658c6f6-q98wj 2/2 Running 0 2m recommendation-v2-7cb7794786-n2qp5 2/2 Running 0 2m recommendation-v3-547b6c5c56-kvpbt 0/2 Init:0/1 0 2s recommendation-v3-547b6c5c56-kvpbt 0/2 Init:0/1 0 3s recommendation-v3-547b6c5c56-kvpbt 0/2 PodInitializing 0 4s recommendation-v3-547b6c5c56-kvpbt 1/2 Running 0 7s recommendation-v3-547b6c5c56-kvpbt 2/2 Running 0 16s ^C$ ^C $ istioctl create -f ~/projects/istio-tutorial/istiofiles/destination-rule-recommendation-v1-v2-v3.yml -n tutorial; \

istioctl create -f ~/projects/istio-tutorial/istiofiles/virtual-service-recommendation-v3.yml Created config destination-rule/tutorial/recommendation at revision 8213 Created config virtual-service/tutorial/recommendation at revision 8215 $ ^C $ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ ^C $ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ istioctl create -f ~/projects/istio-tutorial/istiofiles/service-entry-egress-httpbin.yml -n tutorial Created config service-entry/tutorial/httpbin-egress-rule at revision 8321 $ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ curl http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ ^C $ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries $ ^C $ curl -m 5 http://customer-tutorial.2886795284-80-kitek03.environments.katacoda.com customer => 503 preference => 503 failed to resolve 'now.httpbin.org' after 3 queries

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openshift-labs/learn-katacoda/issues/367, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFCtvSuPubFu1E6MVm3FLa8_C5mXeOVks5vRtisgaJpZM4bVQAx .

marekjelen commented 5 years ago

@rafabene

rafabene commented 5 years ago

This needs to be fixed first in the upstream: https://github.com/redhat-developer-demos/istio-tutorial/issues/203

rafabene commented 5 years ago

This should be fixed by this commit: https://github.com/redhat-developer-demos/istio-tutorial/commit/12cc5af9323b225e2162eb98326416a1088fa25b - Testing now

rafabene commented 5 years ago

The PR #400 Fixes this scenario. @BenHall @mhausenblas @marekjelen Can you merge it, please?