1

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

zzob
  • 993
  • 3
  • 9
  • 19

1 Answers1

2

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!

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • what is meaning of this line ```gblaquiere.dev: ""``` – zzob Sep 24 '20 at 03:03
  • So If I apply the config map, I can access the pod wih IP domain via browser? – zzob Sep 24 '20 at 03:48
  • What do you mean by IP domain? If you register in your DNS `my-service.-my-namespace.mydomain.com A ` and you set `mydomain.com` in the config map, you can access to your service because the HOST in the request header is the correct one. – guillaume blaquiere Sep 24 '20 at 06:57
  • Sorry for misunderstand, I just want to access via IP cluster (LoadBalancer) by browser. Is that possible ? – zzob Sep 24 '20 at 07:00
  • 1
    Not directly, you have to present your request with the correct host to allow Istio controller to route the request to the correct service. You need a domain name, and a registration in a DNS registrar. Or to customize your client side code to override the host header. – guillaume blaquiere Sep 24 '20 at 07:03
  • Because the service is running on Knative right? I reach the Istio docs. Which allow all host to the service https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/ Not sure that can adapt to implement with Knative. – zzob Sep 24 '20 at 07:26
  • I read the docs (above commet) with they try to let's the client access the service via browser. Which allow all host to service right? – zzob Sep 24 '20 at 07:41
  • 1
    I think you can't with Knative (and especially the Cloud Run add on on GKE) but you are at the limit of my knowledge there! – guillaume blaquiere Sep 24 '20 at 12:42