Serving a knative function on the root
root to services
- tags
- kubernetes
- knative
- kourier
Contents
I want to deploy everything as a knative service, including the root of the domain.
Update: I found an easyier way.
Easy way
Turn on auto-tls
and autocreate-cluster-domain-claims
:
|
|
Then
|
|
That's it.
Hardway
Left here for the record.
Add ingress-nginx
|
|
Configure letsencrypt
Make sure to change your email address
nginx-certs.yml:
|
|
|
|
DNS
Find the ip
|
|
"137.184.240.185"
Create DNS entry
|
|
ID Type Name Data Priority Port TTL Weight 280663245 A @ 137.184.240.185 0 0 1800 0
Add a simple knative service
We are setting the min scale to 1 so there's no startup time for this service.
|
|
Which will result in this being deployed internally as http://homepage.default.svc.cluster.local
Simple reverse proxy service
Code
This is available on https://github.com/wschenk/proxy
|
|
I'm packaging this up at ghcr.io/wschenk/proxy
Setup the proxy service
|
|
|
|
deployment.apps/homepage-proxy configured service/homepage-proxy unchanged
Create ingress.yaml
ingress.yaml
:
|
|
|
|
ingress.networking.k8s.io/gitgratitude-root configured
Testing
|
|
|
|
Hello World!
|
|
|
|
Hello from knative!
Conclusion
The reverse proxy is a little bit weird, since we are proxying through a couple of different layers, but this allows us to deploy everything as a knative service.
Previously
Next