Knative Event 安装

发布时间: 更新时间: 总字数:571 阅读时间:2m 作者: IP上海 分享 网址

Knative Event 安装

部署 Eventing

参考

安装 CRDs

curl -Lfs -o eventing-crds.yaml https://github.com/knative/eventing/releases/download/knative-v1.7.1/eventing-crds.yaml

kubectl apply -f eventing-crds.yaml

安装 Eventing 核心

curl -Lfs -o eventing-core.yaml https://github.com/knative/eventing/releases/download/knative-v1.7.1/eventing-core.yaml

sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/controller#gcrioknative/eventing-controller#g' -i *.yaml
sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/mtping#gcrioknative/eventing-mtping#g' -i *.yaml
sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/webhook#gcrioknative/eventing-webhook#g' -i *.yaml
sed "s#@sha256:.*#:v1.7.0#g" -i eventing-core.yaml

kubectl apply -f eventing-core.yaml
  • 安装检查,如下表示安装成功:
root@k8s-master:~/knative# kubectl get pods -n knative-eventing
NAME                                   READY   STATUS    RESTARTS   AGE
eventing-controller-7bffbb949f-499rv   1/1     Running   0          18m
eventing-webhook-6ffff5474f-hr6mn      1/1     Running   0          18m
  • 安装日志
install-knative-eventing-log
root@k8s-master:~/knative# kubectl apply -f eventing-crds.yaml
customresourcedefinition.apiextensions.k8s.io/apiserversources.sources.knative.dev created
customresourcedefinition.apiextensions.k8s.io/brokers.eventing.knative.dev created
customresourcedefinition.apiextensions.k8s.io/channels.messaging.knative.dev created
customresourcedefinition.apiextensions.k8s.io/containersources.sources.knative.dev created
customresourcedefinition.apiextensions.k8s.io/eventtypes.eventing.knative.dev created
customresourcedefinition.apiextensions.k8s.io/parallels.flows.knative.dev created
customresourcedefinition.apiextensions.k8s.io/pingsources.sources.knative.dev created
customresourcedefinition.apiextensions.k8s.io/sequences.flows.knative.dev created
customresourcedefinition.apiextensions.k8s.io/sinkbindings.sources.knative.dev created
customresourcedefinition.apiextensions.k8s.io/subscriptions.messaging.knative.dev created
customresourcedefinition.apiextensions.k8s.io/triggers.eventing.knative.dev created
root@k8s-master:~/knative# kubectl apply -f eventing-core.yaml
namespace/knative-eventing created
serviceaccount/eventing-controller created
clusterrolebinding.rbac.authorization.k8s.io/eventing-controller created
clusterrolebinding.rbac.authorization.k8s.io/eventing-controller-resolver created
clusterrolebinding.rbac.authorization.k8s.io/eventing-controller-source-observer created
clusterrolebinding.rbac.authorization.k8s.io/eventing-controller-sources-controller created
clusterrolebinding.rbac.authorization.k8s.io/eventing-controller-manipulator created
serviceaccount/pingsource-mt-adapter created
clusterrolebinding.rbac.authorization.k8s.io/knative-eventing-pingsource-mt-adapter created
serviceaccount/eventing-webhook created
clusterrolebinding.rbac.authorization.k8s.io/eventing-webhook created
rolebinding.rbac.authorization.k8s.io/eventing-webhook created
clusterrolebinding.rbac.authorization.k8s.io/eventing-webhook-resolver created
clusterrolebinding.rbac.authorization.k8s.io/eventing-webhook-podspecable-binding created
configmap/config-br-default-channel created
configmap/config-br-defaults created
configmap/default-ch-webhook created
configmap/config-ping-defaults created
configmap/config-features created
configmap/config-kreference-mapping created
configmap/config-leader-election created
configmap/config-logging created
configmap/config-observability created
configmap/config-sugar created
configmap/config-tracing created
deployment.apps/eventing-controller created
deployment.apps/pingsource-mt-adapter created
Warning: autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler
horizontalpodautoscaler.autoscaling/eventing-webhook created
poddisruptionbudget.policy/eventing-webhook created
deployment.apps/eventing-webhook created
service/eventing-webhook created
customresourcedefinition.apiextensions.k8s.io/apiserversources.sources.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/brokers.eventing.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/channels.messaging.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/containersources.sources.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/eventtypes.eventing.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/parallels.flows.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/pingsources.sources.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/sequences.flows.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/sinkbindings.sources.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/subscriptions.messaging.knative.dev unchanged
customresourcedefinition.apiextensions.k8s.io/triggers.eventing.knative.dev unchanged
clusterrole.rbac.authorization.k8s.io/addressable-resolver created
clusterrole.rbac.authorization.k8s.io/service-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/serving-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/channel-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/broker-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/flows-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/eventing-broker-filter created
clusterrole.rbac.authorization.k8s.io/eventing-broker-ingress created
clusterrole.rbac.authorization.k8s.io/eventing-config-reader created
clusterrole.rbac.authorization.k8s.io/channelable-manipulator created
clusterrole.rbac.authorization.k8s.io/meta-channelable-manipulator created
clusterrole.rbac.authorization.k8s.io/knative-eventing-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-messaging-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-flows-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-sources-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-bindings-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-eventing-namespaced-edit created
clusterrole.rbac.authorization.k8s.io/knative-eventing-namespaced-view created
clusterrole.rbac.authorization.k8s.io/knative-eventing-controller created
clusterrole.rbac.authorization.k8s.io/knative-eventing-pingsource-mt-adapter created
clusterrole.rbac.authorization.k8s.io/podspecable-binding created
clusterrole.rbac.authorization.k8s.io/builtin-podspecable-binding created
clusterrole.rbac.authorization.k8s.io/source-observer created
clusterrole.rbac.authorization.k8s.io/eventing-sources-source-observer created
clusterrole.rbac.authorization.k8s.io/knative-eventing-sources-controller created
clusterrole.rbac.authorization.k8s.io/knative-eventing-webhook created
role.rbac.authorization.k8s.io/knative-eventing-webhook created
validatingwebhookconfiguration.admissionregistration.k8s.io/config.webhook.eventing.knative.dev created
mutatingwebhookconfiguration.admissionregistration.k8s.io/webhook.eventing.knative.dev created
validatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.eventing.knative.dev created
secret/eventing-webhook-certs created
mutatingwebhookconfiguration.admissionregistration.k8s.io/sinkbindings.webhook.sources.knative.dev created
root@k8s-master:~/knative# kubectl -n knative-eventing get all
NAME                                       READY   STATUS    RESTARTS   AGE
pod/eventing-controller-7bffbb949f-499rv   1/1     Running   0          11m
pod/eventing-webhook-6ffff5474f-hr6mn      1/1     Running   0          11m

NAME                       TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
service/eventing-webhook   ClusterIP   10.111.187.185   <none>        443/TCP   11m

NAME                                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/eventing-controller     1/1     1            1           11m
deployment.apps/eventing-webhook        1/1     1            1           11m
deployment.apps/pingsource-mt-adapter   0/0     0            0           11m

NAME                                               DESIRED   CURRENT   READY   AGE
replicaset.apps/eventing-controller-7bffbb949f     1         1         1       11m
replicaset.apps/eventing-webhook-6ffff5474f        1         1         1       11m
replicaset.apps/pingsource-mt-adapter-78d9958549   0         0         0       11m

NAME                                                   REFERENCE                     TARGETS          MINPODS   MAXPODS   REPLICAS   AGE
horizontalpodautoscaler.autoscaling/eventing-webhook   Deployment/eventing-webhook   <unknown>/100%   1         5         1          11m

部署 Eventing Channel Layer(可选)

In-Memory

curl -Lfs -o in-memory-channel.yaml https://github.com/knative/eventing/releases/download/knative-v1.7.1/in-memory-channel.yaml

sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/in_memory/channel_controller#gcrioknative/eventing-in_memory-channel_controller#g' -i *.yaml
sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/in_memory/channel_dispatcher#gcrioknative/eventing-in_memory-channel_dispatcher#g' -i *.yaml

sed "s#@sha256:.*#:latest#g" -i in-memory-channel.yaml

kubectl apply -f in-memory-channel.yaml
  • 安装完成
root@k8s-master:~/knative# kubectl -n knative-eventing get pod
NAME                                   READY   STATUS    RESTARTS   AGE
eventing-controller-7bffbb949f-499rv   1/1     Running   0          4h55m
eventing-webhook-6ffff5474f-hr6mn      1/1     Running   0          4h55m
imc-controller-68cc9bcb5f-cjtr2        1/1     Running   0          2m19s
imc-dispatcher-7bc8596bb9-zstjm        1/1     Running   0          2m19s
  • 安装日志
install-in-memory-channel-log
root@k8s-master:~/knative# kubectl apply -f in-memory-channel.yaml
serviceaccount/imc-controller created
clusterrolebinding.rbac.authorization.k8s.io/imc-controller created
rolebinding.rbac.authorization.k8s.io/imc-controller created
clusterrolebinding.rbac.authorization.k8s.io/imc-controller-resolver created
serviceaccount/imc-dispatcher created
clusterrolebinding.rbac.authorization.k8s.io/imc-dispatcher created
configmap/config-imc-event-dispatcher created
configmap/config-observability unchanged
configmap/config-tracing unchanged
deployment.apps/imc-controller created
service/inmemorychannel-webhook created
service/imc-dispatcher created
deployment.apps/imc-dispatcher created
customresourcedefinition.apiextensions.k8s.io/inmemorychannels.messaging.knative.dev created
clusterrole.rbac.authorization.k8s.io/imc-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/imc-channelable-manipulator created
clusterrole.rbac.authorization.k8s.io/imc-controller created
clusterrole.rbac.authorization.k8s.io/imc-dispatcher created
role.rbac.authorization.k8s.io/knative-inmemorychannel-webhook created
mutatingwebhookconfiguration.admissionregistration.k8s.io/inmemorychannel.eventing.knative.dev created
validatingwebhookconfiguration.admissionregistration.k8s.io/validation.inmemorychannel.eventing.knative.dev created
secret/inmemorychannel-webhook-certs created

部署 Eventing Broker Kayer(可选)

MT-Channel-based

curl -Lfs -o mt-channel-broker.yaml https://github.com/knative/eventing/releases/download/knative-v1.7.1/mt-channel-broker.yaml

sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/broker/filter#gcrioknative/eventing-broker-filter#g' -i mt-channel-broker.yaml
sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/broker/ingress#gcrioknative/eventing-broker-ingress#g' -i mt-channel-broker.yaml
sed 's#gcr.io/knative-releases/knative.dev/eventing/cmd/mtchannel_broker#gcrioknative/eventing-mtchannel_broker#g' -i mt-channel-broker.yaml

sed "s#@sha256:.*#:v1.7.1#g" -i in-memory-channel.yaml

kubectl apply -f mt-channel-broker.yaml

部署 Eventing 扩展插件

Github Source

  • To install a single-tenant GitHub source run the command:
kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/knative-v1.7.0/github.yaml
  • To install a multi-tenant GitHub source run the command:
kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/knative-v1.7.0/mt-github.yaml
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数