mac 上学习k8s系列(35)knative part II

2022-08-02 19:37:48 浏览数 (1)

在上一讲mac 上学习k8s系列(34)knative part I的介绍中安装完毕后,我们发现pod并没有起来,原因是国内上网原因导致gcr的镜像拉不下来,好在dockerhub 付费版提供了转储功能,在网上找了几个可用的镜像:

代码语言:javascript复制
docker pull shixiongqi/activator-ecd51ca5034883acbe737fde417a3d86
docker pull shixiongqi/autoscaler-hpa-85c0b68178743d74ff7f663a72802ceb
docker pull shixiongqi/controller-f6fdb41c6acbc726e29a3104ff2ef720
docker pull shixiongqi/domain-mapping-webhook-a127ae3e896f4e4bc1179581011b7824
docker pull shixiongqi/domain-mapping-82f8626be89c35bcd6c666fd2fc8ccb7
docker pull shixiongqi/webhook-261c6506fca17bc41be50b3461f98f1c

docker pull xunfeng/knative-net-istio-webhook:v0.25.2
docker pull xunfeng/net-istio-controller:v0.17.3

docker pull shixiongqi/default-domain-dd6f55160290a90018ba318b624be12e:latest
代码语言:javascript复制
docker pull zhku/knative-eventing-webhook
docker pull zhku/knative-eventing-mtping
docker pull zhku/knative-eventing-controller
代码语言:javascript复制
docker pull dyrnq/tektoncd-pipeline-cmd-controller
docker pull dyrnq/tektoncd-pipeline-cmd-webhook

将上面的镜像拉下来后,重新部署下所有的deployment

代码语言:javascript复制
% kubectl -n knative-serving get pod    
NAME                                     READY   STATUS    RESTARTS   AGE
activator-7f97f884b-jq8n8                1/1     Running   0          29m
autoscaler-d959cc464-bgnhw               1/1     Running   0          29m
controller-5658dfcc57-kdbks              1/1     Running   0          28m
domain-mapping-fb9d95795-b9vlq           1/1     Running   0          28m
domainmapping-webhook-759fbd5cdb-2shcs   1/1     Running   0          28m
webhook-5468c9bd74-b66n8                 1/1     Running   0          27m
代码语言:javascript复制
% kubectl -n knative-eventing  get deploy     
NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
eventing-controller     0/1     0            0           30s
eventing-webhook        0/1     0            0           47s
pingsource-mt-adapter   0/0     0            0           4s

调整cpu 内存大小,不行,重新apply 下

代码语言:javascript复制
% kubectl -n knative-eventing  get pod   
NAME                                   READY   STATUS    RESTARTS   AGE
eventing-controller-769868bd99-6frzh   1/1     Running   0          57s
eventing-webhook-65db7fcfb4-7j9dh      1/1     Running   0          44s

至此安装完毕,然后我们参照官网的例子进行学习

https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-go

代码语言:javascript复制
 % docker build -t xiazemin/knative-go/helloworld-go .

然后新建一个ns

代码语言:javascript复制
% kubectl create ns knative-go
namespace/knative-go created
代码语言:javascript复制
% kubectl apply -f  service.yaml 
service.serving.knative.dev/knative-go created

查看下,启动了哪些东西

代码语言:javascript复制
% kubectl -n knative-go  get all
NAME                                      URL   READY   REASON
route.serving.knative.dev/helloworld-go                 

NAME                                        URL   LATESTCREATED   LATESTREADY   READY   REASON
service.serving.knative.dev/helloworld-go                                               

NAME                                               CONFIG NAME     K8S SERVICE NAME   GENERATION   READY   REASON   ACTUAL REPLICAS   DESIRED REPLICAS
revision.serving.knative.dev/helloworld-go-00001   helloworld-go                      1                                               

NAME                                              LATESTCREATED   LATESTREADY   READY   REASON
configuration.serving.knative.dev/helloworld-go  

查看下ksvc

代码语言:javascript复制
%  kubectl  -n knative-go get ksvc
NAME            URL   LATESTCREATED   LATESTREADY   READY   REASON
helloworld-go  

说明我们的例子起来了,但是我们的URL是空的,且听下回分解。

0 人点赞