question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Knative with custom domain

See original GitHub issue

Hello!

I tried to run Knative on microk8s on my private server and assign it a domain but I was not able to access it.

I did following:

  1. installed fresh microk8s
  2. enabled dns, istio and knative
  3. created service which was exact copy of the on mentioned here: https://knative.dev/docs/serving/samples/hello-world/helloworld-go/index.html
  4. Knative tutorial mentions Ingress setup but one should already be running, so I skipped this step (https://knative.dev/docs/serving/setting-up-custom-ingress-gateway/)
  5. I applited this file:
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-domain
  namespace: knative-serving
data:
  mydomain.tech: ""

as mentioned here: https://knative.dev/docs/serving/using-a-custom-domain/. Now in this step they mention that you have to

Set static IP for Knative Gateway

but my assumption was, that this is already done, even though running:

kubectl get svc $INGRESSGATEWAY --namespace istio-system

returned

NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                                                                                      AGE
istio-ingressgateway   LoadBalancer   10.152.183.189   <pending>     15020:32082/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:31711/TCP,15030:32397/TCP,15031:31159/TCP,15032:31821/TCP,15443:30975/TCP   44m
  1. I added DNS A records as mentioned here https://knative.dev/docs/serving/using-a-custom-domain/#update-your-dns-records.

In the final state, the app was running and I was able to access it both from the server and remotely using the IP of the server (e.g. remotely curl -H "Host: helloworld-go.default.mydomainn.tech" http://X.X.X.X:31380) but all attempts to access it by domain name failed with Connection refused.

My assumption is, that the traffic to port 80 isn’t passed to the services, but why?

inspection-report-20190918_100122.tar.gz

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
yeuscommented, Jul 16, 2021

Update for 2021, if any has the same problem: I was able to get it working by enabling the “metallb” load balancer included in microk8s. Apparently the Istio ingres needs to find a load balancer in order to work in this scenario.

It can be enabled like this:

microk8s enable metallb

if asked for the ip and you only have a single stati ip, specify it in the form: 192.168.1.10-192.168.1.10, because the dialog only accepts ip-ranges.

After having installed metallb, my isiot system automatically got an external ip assigned:

kubectl get svc istio-ingressgateway --namespace istio-system

There is thus no need for httpbin, as knative sets up its own ingress controller which should now be working!!

This seemd to be a super-easy weay to get everything up & running. basically, all I had to do was:

afterwards the hello-world example wors just as advertised and I can reach my services through the URL returned by knative

2reactions
matoouscommented, Sep 26, 2019

I was able to start httpbin service and access it (http://potski.tech:31380/headers) using the guide mentioned before, but now I am not able to expose it on port 80.

NAMESPACE      NAME                     TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                                                                                      AGE
default        httpbin                  ClusterIP      10.152.183.189   <none>        8000/TCP                                                                                                                                     23m
default        kubernetes               ClusterIP      10.152.183.1     <none>        443/TCP                                                                                                                                      2d15h
istio-system   grafana                  ClusterIP      10.152.183.215   <none>        3000/TCP                                                                                                                                     24m
istio-system   istio-citadel            ClusterIP      10.152.183.116   <none>        8060/TCP,15014/TCP                                                                                                                           24m
istio-system   istio-egressgateway      ClusterIP      10.152.183.77    <none>        80/TCP,443/TCP,15443/TCP                                                                                                                     24m
istio-system   istio-galley             ClusterIP      10.152.183.200   <none>        443/TCP,15014/TCP,9901/TCP                                                                                                                   24m
istio-system   istio-ingressgateway     LoadBalancer   10.152.183.182   <pending>     15020:31149/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:31138/TCP,15030:31990/TCP,15031:30381/TCP,15032:30421/TCP,15443:30659/TCP   24m
istio-system   istio-pilot              ClusterIP      10.152.183.74    <none>        15010/TCP,15011/TCP,8080/TCP,15014/TCP                                                                                                       24m
istio-system   istio-policy             ClusterIP      10.152.183.65    <none>        9091/TCP,15004/TCP,15014/TCP                                                                                                                 24m
istio-system   istio-sidecar-injector   ClusterIP      10.152.183.19    <none>        443/TCP                                                                                                                                      24m
istio-system   istio-telemetry          ClusterIP      10.152.183.43    <none>        9091/TCP,15004/TCP,15014/TCP,42422/TCP                                                                                                       24m
istio-system   jaeger-agent             ClusterIP      None             <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                                   24m
istio-system   jaeger-collector         ClusterIP      10.152.183.142   <none>        14267/TCP,14268/TCP                                                                                                                          24m
istio-system   jaeger-query             ClusterIP      10.152.183.125   <none>        16686/TCP                                                                                                                                    24m
istio-system   kiali                    ClusterIP      10.152.183.144   <none>        20001/TCP                                                                                                                                    24m
istio-system   prometheus               ClusterIP      10.152.183.158   <none>        9090/TCP                                                                                                                                     24m
istio-system   tracing                  ClusterIP      10.152.183.250   <none>        80/TCP                                                                                                                                       24m
istio-system   zipkin                   ClusterIP      10.152.183.240   <none>        9411/TCP                                                                                                                                     24m
kube-system    kube-dns                 ClusterIP      10.152.183.10    <none>        53/UDP,53/TCP,9153/TCP                                                                                                                       2d15h

Any idea why please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring domain names - Knative
You can customize the domain of an individual Knative Service, or set a global default domain for all Services created on a cluster....
Read more >
knative-docs/using-a-custom-domain.md at master - GitHub
Setting up a custom domain. By default, Knative Serving routes use example.com as the default domain. The fully qualified domain name for a...
Read more >
Set a custom domain name for Knative Serving - Alibaba Cloud
This topic describes how to set a custom domain name for Knative Serving. Prerequisites. A domain name is registered. For more information, see ......
Read more >
Configuring a custom domain for a Knative service - Security
You can customize the domain for your Knative service by mapping a custom domain name that you own to a Knative service. You...
Read more >
Human-friendly Domains with Knative
Well, not this time. There were some discussions on how to make custom domain names easier to set: https://github.com/knative/serving/issues/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found