So I've started to play around with knative. Installed it locally, just on my laptop. Just the bare minimum hello world project: k3s, knative-serving with kourier.
curl -sfL | sh -s - --disable traefik
export KUBECONFIG="$XDG_CONFIG_HOME/kube/config"
sudo k3s kubectl config view --raw > "$KUBECONFIG"
export KNATIVE_VERSION=v1.16.0
kubectl apply -f $KNATIVE_VERSION/serving-crds.yaml
kubectl apply -f $KNATIVE_VERSION/serving-core.yaml
kubectl apply -f $KNATIVE_VERSION/kourier.yaml
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress-class":"kourier.ingressworking.knative.dev"}}'
Registry is just in a docker: docker run -d -p 5000:5000 --restart always --name my-registry registry:2
Then created a hello world function, deployed it and I can invoke it with func invoke
.
I'm new to the k8s things. These networking things are hard. Also I can't setup the DNS on my router at home. Although the cluster has an external IP and port, I can't even call it locally with curl -H "Host: hello-world.default.svc.cluster.local" http://localhost:32198
.
But skipping this and I would like to go straight to serving the functions on endpoints like /hello-world
would go straight to the hello-world function.
The ideal state would be just curl http://localhost:32198/hello-world
(even better would be curl https://localhost/api/v1/hello-world
, but let's keep things simple)