Search code examples
google-cloud-platformistiogoogle-cloud-runknativegoogle-anthos

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.

Which I follow this qwiklabs for study the 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

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.
It about VirtualSerivce and look like I have a Istio Ingress before to build this proxy.
Is that a correct way to trobleshooting?

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


Solution

  • You can change the config-domain config map in the knative namespace. 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)
    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.

    The curl -H Host... is a cheat to lie to the Istio controller and say to it "Yes I come from there". If you really come from there (your own domain name) no need to cheat!