Knative with custom domain
See original GitHub issueHello!
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:
- installed fresh microk8s
- enabled
dns
,istio
andknative
- created service which was exact copy of the on mentioned here: https://knative.dev/docs/serving/samples/hello-world/helloworld-go/index.html
- 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/)
- 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
- 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?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
microk8s enable knative metallb dashboard dns
afterwards the hello-world example wors just as advertised and I can reach my services through the URL returned by knative
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.Any idea why please?