Skip to content

Conversation

frankbu
Copy link
Contributor

@frankbu frankbu commented Apr 20, 2018

This is a WIP first pass at trying to use a Gateway, instead of Ingress, to access the Bookinfo app. It doesn't work yet.

@rshriram @vadimeisenbergibm : I'm not sure if the problem is just that my environment is not configured correctly for envoyv2/v1alpha3, or something else, but here's what I tried:

Franks-MacBook-Pro:istio frankbudinsky$ istioctl create -f samples/bookinfo/routing/bookinfo-gateway.yaml 
Created config gateway/default/bookinfo-gateway at revision 361465
Created config virtual-service/default/bookinfo at revision 361466
Franks-MacBook-Pro:istio frankbudinsky$ export GATEWAY_URL=$(kubectl get po -l istio=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[0].nodePort}')
Franks-MacBook-Pro:istio frankbudinsky$ echo $GATEWAY_URL
192.168.99.100:31380
Franks-MacBook-Pro:istio frankbudinsky$ curl -v http://${GATEWAY_URL}/productpage
*   Trying 192.168.99.100...
* TCP_NODELAY set
* Connection failed
* connect to 192.168.99.100 port 31380 failed: Connection refused
* Failed to connect to 192.168.99.100 port 31380: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 192.168.99.100 port 31380: Connection refused

I'm creating a Gateway and corresponding VirtualService in the default namespace, which is using a selector to try to use the istio-ingressgateway implementation pod running in istio-system. I'm wondering if this might be the problem. How can we do cross-namespace referencing?

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: frankbu

Assign the PR to them by writing /assign @frankbu in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@istio-testing
Copy link
Collaborator

istio-testing commented Apr 20, 2018

@frankbu: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/e2e-bookInfoTests.sh 550b9cd link /test e2e-bookInfo
prow/e2e-bookInfoTests-v1alpha3.sh 550b9cd link /test e2e-bookInfo-envoyv2-v1alpha3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ZackButcher
Copy link
Contributor

ZackButcher commented Apr 20, 2018

The problem is that we read the host: "*" as a short name and fully qualify it (to *.default.svc.cluster.local) when we ingest the Gateway and VirtualService.

Here's a snippet of the generated config:

"virtual_hosts": [
    {
        "domains": [
            "*.default.svc.cluster.local"
        ],
        "name": "bookinfo-gateway:80",
        "routes": [
            {
                "decorator": {
                    "operation": "bookinfo-gateway"
                },
                "match": {
                    "path": "/productpage"
                },
                "route": {
                    "cluster": "outbound|http||test-server.default.svc.cluster.local",
                    "timeout": "0.000s",
                    "use_websocket": false
                }
            },
$ curl -v http://192.168.99.100:31380/login -H "Host: foo.com"
*   Trying 192.168.99.100...
* TCP_NODELAY set
* Connected to 192.168.99.100 (192.168.99.100) port 31380 (#0)
> GET /login HTTP/1.1
> Host: foo.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< date: Fri, 20 Apr 2018 22:32:32 GMT
< server: envoy
< content-length: 0
<
* Connection #0 to host 192.168.99.100 left intact

$ curl -v http://192.168.99.100:31380/login -H "Host: foo.default.svc.cluster.local"
*   Trying 192.168.99.100...
* TCP_NODELAY set
* Connected to 192.168.99.100 (192.168.99.100) port 31380 (#0)
> GET /login HTTP/1.1
> Host: foo.default.svc.cluster.local
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< date: Fri, 20 Apr 2018 22:34:34 GMT
< content-length: 27
< content-type: text/plain; charset=utf-8
< x-envoy-upstream-service-time: 1
< server: envoy
<
* Connection #0 to host 192.168.99.100 left intact
default handler echoing: ""%

I'll get a fix out shortly.

@@ -0,0 +1,38 @@
apiVersion: networking.istio.io/v1alpha3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this have to be used in some script to do the actual testing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it has to, let me submit a separate PR for that.

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadimeisenbergibm
Copy link
Contributor

@frankbu Could you please move the old Ingress definition into samples/bookinfo/kube/bookinfo-gateway.yaml? It should be used in v1alpha1 documentation and tests, until v1alpha1 is removed.

@rshriram
Copy link
Member

@frankbu Thanks for the initial cut and the example gateway config. This helped us fix a big bug (thanks @ZackButcher ).
I spoke to @vadimeisenbergibm . Since he is working on sunday (israel time), I asked him to take over this work and get bookinfo working with the gateway example you have here. So, closing this PR in favor of his..

@rshriram rshriram closed this Apr 21, 2018
@rshriram rshriram deleted the bookinfo-gateway branch April 21, 2018 19:30
@linsun linsun added this to the Istio 0.8 milestone Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants