You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/11 05:53:50 UTC
[GitHub] [apisix-ingress-controller] jikunchong opened a new issue #750: request help: how to access istio services (demo: Bookinfo)?
jikunchong opened a new issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750
### Issue description
我在 KubeSphere 中部署了 istio 的 demo app: Bookinfo,已确认通过 NodePort 方式能正常访问 productpage 微服务。
现在希望通过 apisix-ingress-controller 访问到 Bookinfo productpage,不知是否可行?
有没有类似 nginx.ingress.kubernetes.io/service-upstream: true 的注解配置,或者是更好的推荐配置方式?
### Environment
* your apisix-ingress-controller version (1.3.0);
* your Kubernetes cluster version (1.22.1);
* if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (Linux nuc10 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux).
* KubeSphere 3.2.0
* Istio 1.11.2
* MetalLB 0.11.0 (apisix-gateway 使用 LoadBalancer 方式)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-976628526
不知道最终改了什么,apisix gateway 上没有注入 istio-proxy,现在却可以通过 bookinfo-ingress 配置的路由地址访问到 productpage 页面了(http://api.domain.local/productpage/)。bookinfo-ingress 配置:
```
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bookinfo-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /bookinfo/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/alias-name: apisix
kubesphere.io/creator: admin
kubesphere.io/description: ''
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /bookinfo/
pathType: Prefix
backend:
service:
name: productpage
port:
number: 9080
```
但自动和手动的注入功能还是均没有成功。如果哪位成功了,麻烦留个言,先谢了。
很奇怪的是 kubeshere 向导生成的 bookinfo 示例都注入成功了的,但我自己部署的 httpbin 却没有注入 istio-proxy。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-975010737
thanks, I try try
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-1013041838
FYI: this is the blog content https://apisix.apache.org/blog/2021/12/17/exposure-istio-with-apisix-ingress/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974622287
看 apisix ingress controller 的容器日志是这样的:
```
2021-11-20T17:25:50+08:00 error apisix/route.go:191 failed to reflect route delete to cache: not found
2021-11-20T17:25:50+08:00 error apisix/route.go:161 failed to create route: unexpected status code 400; error message: {"error_msg":"failed to fetch upstream info by upstream id [b3f9690], response code: 404"}
2021-11-20T17:25:50+08:00 error ingress/ingress.go:178 failed to sync ingress artifacts {"error": "1 error occurred:\n\t* unexpected status code 400; error message: {\"error_msg\":\"failed to fetch upstream info by upstream id [b3f9690], response code: 404\"}\n\n\n"}
2021-11-20T17:25:50+08:00 warn ingress/ingress.go:191 sync ingress failed, will retry {"object": {"Type":2,"Object":{"Key":"try-apps/bookinfo-ingress","GroupVersion":"networking/v1","OldObject":{}},"Tombstone":null}, "error": "1 error occurred:\n\t* unexpected status code 400; error message: {\"error_msg\":\"failed to fetch upstream info by upstream id [b3f9690], response code: 404\"}\n\n\n"}
```
但我应该如何解决呢?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974621466
请问有成功的示例吗?我之前部署的 httpbin demo 都能正常生成规则,并在 apisix dashboard 中可以看到,并可以正常访问。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: httpbin-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /httpbin/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/alias-name: ''
kubesphere.io/creator: admin
kubesphere.io/description: httpbin ingress
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /httpbin/
pathType: Prefix
backend:
service:
name: httpbin
port:
number: 8080
```
但换成 istio bookinfo productpage 服务后,就不能生成规则了(访问成果:{"error_msg":"404 Route Not Found"} )。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bookinfo-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /bookinfo/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/creator: admin
kubesphere.io/description: ''
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /bookinfo/
pathType: Prefix
backend:
service:
name: productpage
port:
number: 9080
```
所以你说这个 service-resolve-granularity 我也就没法配置。我不知道问题出在哪里了?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974621466
请问有成功的示例吗?我之前部署的 httpbin demo 都能正常生成规则,在 apisix dashboard 中可以看到,并可以正常访问。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: httpbin-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /httpbin/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/alias-name: ''
kubesphere.io/creator: admin
kubesphere.io/description: httpbin ingress
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /httpbin/
pathType: Prefix
backend:
service:
name: httpbin
port:
number: 8080
```
但换成 istio bookinfo productpage 服务后,就不能生成规则了(浏览器访问结果:{"error_msg":"404 Route Not Found"} )。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bookinfo-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /bookinfo/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/creator: admin
kubesphere.io/description: ''
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /bookinfo/
pathType: Prefix
backend:
service:
name: productpage
port:
number: 9080
```
所以你说这个 service-resolve-granularity 我不确定该怎么配置了?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-976628526
不知道最终改了什么,apisix gateway 上没有注入 istio-proxy,现在却可以通过 bookinfo-ingress 配置的路由地址访问到 productpage 页面了(http://api.domain.local/productpage/)。bookinfo-ingress 配置:
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bookinfo-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /bookinfo/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/alias-name: apisix
kubesphere.io/creator: admin
kubesphere.io/description: ''
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /bookinfo/
pathType: Prefix
backend:
service:
name: productpage
port:
number: 9080
```
但自动和手动的注入功能还是均没有成功。如果哪位成功了,麻烦留个言,先谢了。
很奇怪的是 kubeshere 向导生成的 bookinfo 示例都注入成功了的,但我自己部署的 httpbin 却没有注入 istio-proxy。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong closed issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong closed issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974622287
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-975219100
If you are in a test environment, you can try to create a namespace first, then label it, and then deploy apisix-ingress and apisix
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-976628526
不知道最终改了什么,现在可以通过 apisix 访问到 productpage 页面了。
但自动注入的功能还是没有成功。如果哪位成功了,麻烦留个言,先谢了。
很奇怪的是 kubeshere 向导生成的 bookinfo 示例都注入成功了的,但我自己部署的 httpbin 却没有注入 istio-proxy。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974762475
For this kind of scenario, I have tested and available.
I will write a complete article next week to explain the steps. The key point here is that you need to enable automatic injection of istio for the namespace where apisix is located.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974762594
like this:
![2021-11-16 15-58-39屏幕截图](https://user-images.githubusercontent.com/3264292/142752004-4174af40-453f-46dc-808a-623fe6c81781.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tokers commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-966179573
@jikunchong See https://apisix.apache.org/docs/ingress-controller/references/apisix_route_v2beta1/#service-resolve-granularity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974622287
看 apisix ingress controller 的容器日志是这样的:
```
2021-11-20T17:25:50+08:00 error apisix/route.go:191 failed to reflect route delete to cache: not found
2021-11-20T17:25:50+08:00 error apisix/route.go:161 failed to create route: unexpected status code 400; error message: {"error_msg":"failed to fetch upstream info by upstream id [b3f9690], response code: 404"}
2021-11-20T17:25:50+08:00 error ingress/ingress.go:178 failed to sync ingress artifacts {"error": "1 error occurred:\n\t* unexpected status code 400; error message: {\"error_msg\":\"failed to fetch upstream info by upstream id [b3f9690], response code: 404\"}\n\n\n"}
2021-11-20T17:25:50+08:00 warn ingress/ingress.go:191 sync ingress failed, will retry {"object": {"Type":2,"Object":{"Key":"try-apps/bookinfo-ingress","GroupVersion":"networking/v1","OldObject":{}},"Tombstone":null}, "error": "1 error occurred:\n\t* unexpected status code 400; error message: {\"error_msg\":\"failed to fetch upstream info by upstream id [b3f9690], response code: 404\"}\n\n\n"}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong edited a comment on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong edited a comment on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974621466
请问有成功的示例吗?我之前部署的 httpbin demo 都能正常生成规则,在 apisix dashboard 中可以看到,并可以正常访问。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: httpbin-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /httpbin/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/alias-name: ''
kubesphere.io/creator: admin
kubesphere.io/description: httpbin ingress
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /httpbin/
pathType: Prefix
backend:
service:
name: httpbin
port:
number: 8080
```
但换成 istio bookinfo productpage 服务后,就不能生成规则了(访问成果:{"error_msg":"404 Route Not Found"} )。
```yaml
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bookinfo-ingress
namespace: try-apps
annotations:
k8s.apisix.apache.org/rewrite-target-regex: /bookinfo/(.*)
k8s.apisix.apache.org/rewrite-target-regex-template: /$1
kubesphere.io/creator: admin
kubesphere.io/description: ''
spec:
ingressClassName: apisix
rules:
- host: api.domain.local
http:
paths:
- path: /bookinfo/
pathType: Prefix
backend:
service:
name: productpage
port:
number: 9080
```
所以你说这个 service-resolve-granularity 我也就没法配置。我不知道问题出在哪里了?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974621466
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-974762475
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-975198103
没成功,请问除了给空间打 istio-injection=enabled 标签外,还需要做什么?
```shell
sudo kubectl label namespace apisix-system istio-injection=enabled
sudo kubectl label namespace try-apps istio-injection=enabled
sudo kubectl get namespace -L istio-injection
NAME STATUS AGE ISTIO-INJECTION
apisix-system Active 17d enabled
try-apps Active 16d enabled
```
我参考 productpage,手动在 apisix 的 Deployment 加注解,重建 Pod,也没看到 istio-proxy sidecar。
```yaml
metadata:
name: productpage-v1
namespace: apisix-system
# ...
annotations:
# ...
servicemesh.kubesphere.io/enabled: 'true'
spec:
template:
metadata:
annotations:
sidecar.istio.io/inject: 'true'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] jikunchong commented on issue #750: request help: how to access istio services (demo: Bookinfo)?
Posted by GitBox <gi...@apache.org>.
jikunchong commented on issue #750:
URL: https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-975367200
我就新建了个 mesh-apps 空间,打 istio-injection=enabled 标签,然后部署了个 nginx,也没有自动注入。
我现在只求手动注入都行,主要是要解决 apisix gateway 的流量能进入 istio 服务就行。
@tao12345666333 可否再稍微详细说明一下,还有什么关键点被我忽略了?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org