I have been getting my hands dirty by setting up a webhook receiver with flux on GKE I followed the insructions of this guide . According to it I need to deploy Git repository receiver as shown below :
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
name: webapp
namespace: flux-system
spec:
type: github
events:
- "ping"
- "push"
secretRef:
name: webhook-token
resources:
- kind: GitRepository
name: webapp
When i apply the same on gke cluster with k8s version 1.18.12, i get the following error
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"
I tried to check if the CRD’s are present but I couldn’t find anything :
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)$
Pods
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
Any help or advice is most welcome.
-Prashanth
2
Answers
The issue was with the flux tool kit which was not installed. Following the documentation from the below link helped me to resolve the issue. https://github.com/fluxcd/kustomize-controller
Acording to the documentation, your manifest seems to be wrong.
To deploy a Git repository with Webhook Receivers you have to bear in mind:
What the flux documentation suggest you to do is:
You can follow step by step the confugartion of your files in this link of the documentation.