{"action":"created","issue":{"url":"https://api.github.com/repos/istio/istio/issues/9224","repository_url":"https://api.github.com/repos/istio/istio","labels_url":"https://api.github.com/repos/istio/istio/issues/9224/labels{/name}","comments_url":"https://api.github.com/repos/istio/istio/issues/9224/comments","events_url":"https://api.github.com/repos/istio/istio/issues/9224/events","html_url":"https://github.com/istio/istio/issues/9224","id":368190955,"node_id":"MDU6SXNzdWUzNjgxOTA5NTU=","number":9224,"title":"Connect external mysql database by egress gateway does not work","user":{"login":"zoupl","id":11764973,"node_id":"MDQ6VXNlcjExNzY0OTcz","avatar_url":"https://avatars1.githubusercontent.com/u/11764973?v=4","gravatar_id":"","url":"https://api.github.com/users/zoupl","html_url":"https://github.com/zoupl","followers_url":"https://api.github.com/users/zoupl/followers","following_url":"https://api.github.com/users/zoupl/following{/other_user}","gists_url":"https://api.github.com/users/zoupl/gists{/gist_id}","starred_url":"https://api.github.com/users/zoupl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoupl/subscriptions","organizations_url":"https://api.github.com/users/zoupl/orgs","repos_url":"https://api.github.com/users/zoupl/repos","events_url":"https://api.github.com/users/zoupl/events{/privacy}","received_events_url":"https://api.github.com/users/zoupl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-10-09T12:42:25Z","updated_at":"2018-12-06T17:02:56Z","closed_at":null,"author_association":"NONE","body":"**I deployed ServiceEntry like this:**\r\n\r\n```\r\napiVersion: networking.istio.io/v1alpha3\r\nkind: ServiceEntry\r\nmetadata:\r\n  name: cnn\r\nspec:\r\n  hosts:\r\n  - dbext.telcloud.svc.cluster.local\r\n  ports:\r\n  - number: 3306\r\n    name: db\r\n    protocol: TCP\r\n  location: MESH_EXTERNAL\r\n  resolution: STATIC\r\n  endpoints:\r\n  - address: 10.144.166.68\r\n    ports:\r\n      http: 3306\r\n\r\n```\r\n**In a pod which have mysql client in it , i tried to connect to mysql and it is ok.**\r\n\r\n```\r\nmysql -uroot -p  -h dbext.telcloud.svc.cluster.local -P 3306\r\nEnter password:\r\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 45\r\nServer version: 5.7.23 MySQL Community Server (GPL)\r\n\r\nCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql>\r\n\r\n```\r\n**Later I deployed egress gateway and virtual service,  then, i tried to connect to mysql,  and it failed.\r\nHere is egress gateway and virtualservice:**\r\n\r\n```\r\napiVersion: networking.istio.io/v1alpha3\r\nkind: Gateway\r\nmetadata:\r\n  name: istio-egressgateway\r\nspec:\r\n  selector:\r\n    istio: egressgateway\r\n  servers:\r\n  - port:\r\n      number: 3306\r\n      name: db\r\n      protocol: TCP\r\n    hosts:\r\n    - \"dbext.telcloud.svc.cluster.local\"\r\n---\r\napiVersion: networking.istio.io/v1alpha3\r\nkind: DestinationRule\r\nmetadata:\r\n  name: egressgateway-for-cnn\r\nspec:\r\n  host: istio-egressgateway.istio-system.svc.cluster.local\r\n  subsets:\r\n  - name: cnn\r\n\r\n\r\napiVersion: networking.istio.io/v1alpha3\r\nkind: VirtualService\r\nmetadata:\r\n  name: dbext\r\nspec:\r\n  hosts:\r\n  - dbext.telcloud.svc.cluster.local\r\n  gateways:\r\n  - istio-egressgateway\r\n  - mesh\r\n  tcp:\r\n  - match:\r\n    - gateways:\r\n      - mesh\r\n      port: 80\r\n    route:\r\n    - destination:\r\n        host: istio-egressgateway.istio-system.svc.cluster.local\r\n        subset: cnn\r\n        port:\r\n          number: 80\r\n      weight: 100\r\n  - match:\r\n    - gateways:\r\n      - istio-egressgateway\r\n      port: 80\r\n    route:\r\n    - destination:\r\n        host: dbext.telcloud.svc.cluster.local\r\n        port:\r\n          number: 3306\r\n      weight: 100\r\n\r\n```\r\n\r\n**Here is my result:**\r\n```\r\nroot@mysql-fb75876c6-dcbh8:/# mysql -uroot -p -h dbext.telcloud.svc.cluster.local -P 80\r\nEnter password:\r\n```\r\n\r\n**It was stuck, and there was no messages in logs of egress gateway.**\r\n\r\n**Expected behavior**\r\nmysql -uroot -p -h dbext.telcloud.svc.cluster.local -P 80, this command should be ok.\r\n\r\n\r\n**Version**\r\nIstio 1.0.2 release  \r\nkubernetes v1.11.3\r\n\r\n**Installation**\r\nInstall istio by helm\r\n\r\n**Environment**\r\ncentos 7.4\r\n"},"comment":{"url":"https://api.github.com/repos/istio/istio/issues/comments/444948352","html_url":"https://github.com/istio/istio/issues/9224#issuecomment-444948352","issue_url":"https://api.github.com/repos/istio/istio/issues/9224","id":444948352,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDk0ODM1Mg==","user":{"login":"vadimeisenbergibm","id":16784982,"node_id":"MDQ6VXNlcjE2Nzg0OTgy","avatar_url":"https://avatars1.githubusercontent.com/u/16784982?v=4","gravatar_id":"","url":"https://api.github.com/users/vadimeisenbergibm","html_url":"https://github.com/vadimeisenbergibm","followers_url":"https://api.github.com/users/vadimeisenbergibm/followers","following_url":"https://api.github.com/users/vadimeisenbergibm/following{/other_user}","gists_url":"https://api.github.com/users/vadimeisenbergibm/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimeisenbergibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimeisenbergibm/subscriptions","organizations_url":"https://api.github.com/users/vadimeisenbergibm/orgs","repos_url":"https://api.github.com/users/vadimeisenbergibm/repos","events_url":"https://api.github.com/users/vadimeisenbergibm/events{/privacy}","received_events_url":"https://api.github.com/users/vadimeisenbergibm/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T17:02:56Z","updated_at":"2018-12-06T17:02:56Z","author_association":"MEMBER","body":"@tchanorcl Great, I am glad to hear that. I will check the DNS issue - probably will have to create two entry one with the hostname and DNS resolution, and another one with CIDR blocks (ignored hostname)."}}
{"actor":{"display_login":"vadimeisenbergibm"}}