无法在 gke 集群上部署具有通量的 Git 存储库接收器

问题描述

我一直在通过在 GKE 上设置带有通量的 webhook 接收器来弄脏我的手,我遵循了 guide 的说明。根据它,我需要部署 Git 存储库接收器,如下所示:

prkumar@cloudshell:~ (portworx-eng)$ kubectl apply -f GitRepository.yml
error: unable to recognize "GitRepository.yml": no matches for kind "Receiver" in version "notification.toolkit.fluxcd.io/v1beta1"

当我在 k8s 版本 1.18.12 的 gke 集群上应用相同的内容时,出现以下错误

prkumar@cloudshell:~ (portworx-eng)$ kubectl get customresourcedefinitions --all-namespaces
NAME                                                         CREATED AT
actionapprovals.autopilot.libopenstorage.org                 2021-02-15T16:22:04Z
applicationbackups.stork.libopenstorage.org                  2021-02-15T16:22:32Z
applicationbackupschedules.stork.libopenstorage.org          2021-02-15T16:22:47Z
applicationclones.stork.libopenstorage.org                   2021-02-15T16:22:42Z
applicationregistrations.stork.libopenstorage.org            2021-02-15T16:22:27Z
applicationrestores.stork.libopenstorage.org                 2021-02-15T16:22:37Z
autopilotruleobjects.autopilot.libopenstorage.org            2021-02-15T16:21:59Z
autopilotrules.autopilot.libopenstorage.org                  2021-02-15T16:21:59Z
backendconfigs.cloud.google.com                              2021-02-15T15:35:57Z
backuplocations.stork.libopenstorage.org                     2021-02-15T16:22:22Z
clusterdomainsstatuses.stork.libopenstorage.org              2021-02-15T16:22:12Z
clusterdomainupdates.stork.libopenstorage.org                2021-02-15T16:22:17Z
clusterpairs.stork.libopenstorage.org                        2021-02-15T16:21:57Z
frontendconfigs.networking.gke.io                            2021-02-15T15:35:59Z
groupvolumesnapshots.stork.libopenstorage.org                2021-02-15T16:21:51Z
managedcertificates.networking.gke.io                        2021-02-15T15:35:22Z
migrations.stork.libopenstorage.org                          2021-02-15T16:22:02Z
migrationschedules.stork.libopenstorage.org                  2021-02-15T16:22:07Z
rules.stork.libopenstorage.org                               2021-02-15T16:21:31Z
schedulepolicies.stork.libopenstorage.org                    2021-02-15T16:21:36Z
servicenetworkendpointgroups.networking.gke.io               2021-02-15T15:35:59Z
storagestates.migration.k8s.io                               2021-02-15T15:35:26Z
storageversionmigrations.migration.k8s.io                    2021-02-15T15:35:26Z
updateinfos.nodemanagement.gke.io                            2021-02-15T15:35:27Z
volumeplacementstrategies.portworx.io                        2021-02-15T16:20:24Z
volumesnapshotclasses.snapshot.storage.k8s.io                2021-02-15T15:35:25Z
volumesnapshotcontents.snapshot.storage.k8s.io               2021-02-15T15:35:25Z
volumesnapshotdatas.volumesnapshot.external-storage.k8s.io   2021-02-15T16:21:41Z
volumesnapshotrestores.stork.libopenstorage.org              2021-02-15T16:21:46Z
volumesnapshots.snapshot.storage.k8s.io                      2021-02-15T15:35:25Z
volumesnapshots.volumesnapshot.external-storage.k8s.io       2021-02-15T16:21:41Z
volumesnapshotschedules.stork.libopenstorage.org             2021-02-15T16:21:41Z
prkumar@cloudshell:~ (portworx-eng)$

我试图检查 CRD 是否存在,但我找不到任何东西:

prkumar@cloudshell:~ (portworx-eng)$ kubectl get pods --all-namespaces
NAMESPACE     NAME                                                             READY   STATUS    RESTARTS   AGE
demo          podinfo-58df84dbff-4wcl4                                         1/1     Running   0          9h
demo          podinfo-58df84dbff-54rbg                                         1/1     Running   0          9h
flux          flux-86845fff46-p6bdz                                            1/1     Running   0          9h
flux          memcached-5bd7849b84-k4g2h                                       1/1     Running   0          9h
kube-system   autopilot-859d58c8c4-x59b6                                       1/1     Running   0          10h
kube-system   event-exporter-gke-564fb97f9-2l4fp                               2/2     Running   0          10h
kube-system   fluentbit-gke-j42rm                                              2/2     Running   0          10h
kube-system   fluentbit-gke-ngv2c                                              2/2     Running   0          10h
kube-system   fluentbit-gke-zqjk4                                              2/2     Running   0          10h
kube-system   gke-metrics-agent-n7255                                          1/1     Running   0          10h
kube-system   gke-metrics-agent-rbc2b                                          1/1     Running   1          10h
kube-system   gke-metrics-agent-wmndz                                          1/1     Running   0          10h
kube-system   kube-dns-6bd88c9b66-dtn5c                                        4/4     Running   0          10h
kube-system   kube-dns-6bd88c9b66-jkq6w                                        4/4     Running   0          10h
kube-system   kube-dns-autoscaler-7f89fb6b79-6bbn2                             1/1     Running   0          10h
kube-system   kube-proxy-gke-prashanth-cluster-te-default-pool-28f88aed-0jhg   1/1     Running   0          10h
kube-system   kube-proxy-gke-prashanth-cluster-te-default-pool-28f88aed-3k7t   1/1     Running   0          10h
kube-system   kube-proxy-gke-prashanth-cluster-te-default-pool-28f88aed-hrxd   1/1     Running   0          10h
kube-system   l7-default-backend-7fd66b8b88-7h8jj                              1/1     Running   0          10h

豆荚

'.fZ'

非常欢迎任何帮助或建议。

-普拉尚

解决方法

问题在于未安装的焊剂工具包。按照以下链接中的文档帮助我解决了这个问题。 https://github.com/fluxcd/kustomize-controller

,

根据文档,您的清单似乎有误。

要使用 Webhook Receivers 部署 Git 存储库,您必须牢记:

In order to receive Git push or Helm chart upload events,you'll have to expose the 
webhook receiver endpoint outside of your Kubernetes cluster on a public address.

flux 文档建议您做的是:

  1. 创建 LoadBalancer 服务。
  2. 为其分配公共地址。
  3. 定义 Git 存储库。
  4. 定义 Git 存储库接收器。

您可以在此 link 文档中逐步了解文件的配置。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...