首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁Install knative”︁的源代码
←
Install knative
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
=Knative Serving= == Install serving == <syntaxhighlight lang="bash"> kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.18.0/serving-crds.yaml kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.18.0/serving-core.yaml kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.18.0/kourier.yaml kubectl patch configmap/config-network \ --namespace knative-serving \ --type merge \ --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}' </syntaxhighlight> Verify: <syntaxhighlight lang="bash"> $ kubectl get pods -n knative-serving NAME READY STATUS RESTARTS AGE activator-cbf5b6b55-wbmf2 1/1 Running 0 3m7s autoscaler-c5d454c88-5zncq 1/1 Running 0 3m7s controller-84f96b7676-p26gh 1/1 Running 0 3m7s net-kourier-controller-5bf7f49cc8-5dc9r 1/1 Running 0 2m44s webhook-75d4fb6db5-cmvjl 1/1 Running 0 3m7s </syntaxhighlight> verify kourier: <syntaxhighlight lang="bash"> $ kubectl --namespace kourier-system get service kourier NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kourier LoadBalancer 10.106.110.17 <pending> 80:30288/TCP,443:32450/TCP 3m53s </syntaxhighlight> == Configure DNS == <syntaxhighlight lang="bash"> kubectl patch configmap/config-domain \ --namespace knative-serving \ --type merge \ --patch '{"data":{"api.quillgen.com":""}}' </syntaxhighlight> = Install eventing = <syntaxhighlight lang="bash"> kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.18.0/eventing-crds.yaml kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.18.0/eventing-core.yaml </syntaxhighlight> <syntaxhighlight lang="bash"> $ kubectl get pods -n knative-eventing NAME READY STATUS RESTARTS AGE eventing-controller-674c57ddb7-wrt4h 1/1 Running 0 9m25s eventing-webhook-6d86554d4d-v5r5t 1/1 Running 0 9m25s job-sink-5fdf4b8c5c-gjlts 1/1 Running 0 9m25s </syntaxhighlight> = CLI = <syntaxhighlight lang="bash"> wget https://github.com/knative/client/releases/download/knative-v1.18.0/kn-linux-amd64 wget https://github.com/knative/func/releases/download/knative-v1.18.1/func_linux_amd64 sudo install kn-linux-amd64 /usr/local/bin/kn sudo install func_linux_amd64 /usr/local/bin/func </syntaxhighlight> = Test hello world= <syntaxhighlight lang="bash"> $ func create -l node helloworld $ cd helloworld $ func build A registry for function images is required. For example, 'docker.io/tigerteam'. ? Registry for function images: docker.io/yai42 Note: building a function the first time will take longer than subsequent builds Building function image Still building Still building 🙌 Function built: index.docker.io/yai42/helloworld:latest </syntaxhighlight> // https://hub.docker.com/repository/docker/yai42/helloworld <syntaxhighlight lang="bash"> $ func deploy function up-to-date. Force rebuild with --build Please provide credentials for image repository 'index.docker.io/yai42/helloworld'. ? Username: yai42 ? Password: ************************************ Credentials will not be saved. .. </syntaxhighlight> trouble shotting: <syntaxhighlight lang="bash"> $ kubectl get ksvc helloworld NAME URL LATESTCREATED LATESTREADY READY REASON helloworld http://helloworld.default.api.quillgen.com helloworld-00001 helloworld-00001 Unknown IngressNotConfigured </syntaxhighlight> must set ingress to kourier: kubectl get configmap/config-network -n knative-serving -o yaml | grep ingress Install metallb if external ip not configured, or change it to NodePort: <syntaxhighlight lang="bash"> $ kubectl --namespace kourier-system get service kouriervice kourier NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kourier LoadBalancer 10.106.110.17 172.20.0.0 80:30288/TCP,443:32450/TCP 118m </syntaxhighlight> Expected: <syntaxhighlight lang="bash"> $ kubectl --namespace kourier-system get service kouriervice kourier NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kourier LoadBalancer 10.106.110.17 172.20.0.0 80:30288/TCP,443:32450/TCP 118m $ kubectl get ksvc helloworld NAME URL LATESTCREATED LATESTREADY READY REASON helloworld http://helloworld.default.api.quillgen.com helloworld-00001 helloworld-00001 True $ func list NAME NAMESPACE RUNTIME URL READY helloworld default http://helloworld.default.api.quillgen.com True $ curl -H "Host: helloworld.default.api.quillgen.com" http://172.20.0.0 {"query":{}} </syntaxhighlight> [[Category:Kubernetes]] [[Category:Linux/Unix]]
返回
Install knative
。