简体   繁体   English

如何在 istio 服务上创建入口到云运行 anthos (knative)

[英]How to create ingress on istio service to cloud run anthos (knative)

I'm working on Cloud Run Anthos at GCP and host on GKE cluster.我正在 GCP 上开发 Cloud Run Anthos,并在 GKE 集群上托管。

Which I follow this qwiklabs for study the Cloud Run Anthos,我按照这个 q​​wiklabs 研究 Cloud Run Anthos,

https://www.qwiklabs.com/focuses/5147?catalog_rank=%7B%22rank%22%3A6%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=7054914 https://www.qwiklabs.com/focuses/5147?catalog_rank=%7B%22rank%22%3A6%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=7054914

The example in hands-on lab.动手实验室中的示例。 They used below command to check the service is working or not.他们使用下面的命令来检查服务是否正常工作。

curl -H Host : <URL> <IP_CLUSTER>

And I wonder about reality used.我想知道使用的现实。 No one add Host in the every request to working.没有人在每个工作请求中添加主机
My question is, It have any possible to solve this issue?我的问题是,有没有可能解决这个问题? I just want to used the invoke request by browser or any application but no sure is possible?我只想通过浏览器或任何应用程序使用调用请求,但不确定是否可行?

I reach the resource document about Istio ingress, Which the example of qwiklab used it also.我找到了关于 Istio ingress 的资源文档,qwiklab 的例子也使用了它。
It about VirtualSerivce and look like I have a Istio Ingress before to build this proxy.它是关于VirtualSerivce 的,看起来我之前有一个Istio Ingress来构建这个代理。
Is that a correct way to trobleshooting?这是解决问题的正确方法吗?

https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRewrite https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRewrite

You can change the config-domain config map in the knative namespace.您可以更改 knative 命名空间中的 config-domain 配置映射。 you can see the config like this你可以看到这样的配置

kubectl describe configmap config-domain --namespace knative-serving

Then you can update it like this然后你可以像这样更新它

  • Create a config file in a file config-domain.yaml (for example)在文件config-domain.yaml创建一个配置文件(例如)
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-domain
  namespace: knative-serving
data:
  gblaquiere.dev: ""
  • Apply the configuration应用配置
kubectl apply -f config-domain.yaml

more detail here 更多细节在这里

With the new domain name, configure your DNS registrar to match your domain name to the load balancer external IP and you website will present the correct host on each request.使用新域名,配置您的 DNS 注册商以将您的域名与负载均衡器的外部 IP 匹配,您的网站将在每个请求中显示正确的主机。

The curl -H Host... is a cheat to lie to the Istio controller and say to it "Yes I come from there". curl -H Host... 是欺骗 Istio 控制器并对其说“是的,我来自那里”的欺骗。 If you really come from there (your own domain name) no need to cheat!如果您真的来自那里(您自己的域名),则无需作弊!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM