最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kubernetes - local knative endpoint to function routing - Stack Overflow

programmeradmin4浏览0评论

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)

发布评论

评论列表(0)

  1. 暂无评论