README

Knative + Google Cloud Platform = 🚀

GoDoc Go Report Card LICENSE

Knative-GCP builds on Kubernetes to enable easy configuration and consumption of Google Cloud Platform events and services. It can be useful independently, but is best mixed with Knative.

Installing Knative-GCP

Follow this guide to install Knative-GCP components on a platform of your choice.

  1. Installing Knative-GCP
  2. Installing Pub/Sub Enabled Service Account
  3. Installing Broker with PubSub Channel
  4. Managing Multiple Projects

Knative-GCP Sources

In order to consume events from different GCP services, Knative-GCP provides different Sources. A Source is a Kubernetes object that generate or import events into the cluster and sends them downstream in CloudEvents format. Use the examples below to learn how to configure and consume events from different GCP services.

  1. CloudPubSubSource
  2. CloudStorageSource
  3. CloudSchedulerSource
  4. CloudAuditLogsSource

All of the above Sources are Pull-based, i.e., they poll messages from Pub/Sub subscriptions. Different mechanisms can be used to scale them out. Roughly speaking, all such mechanisms need metrics to understand how "congested" the Pub/Sub subscription is and inform their scaling decision subsystem. We currently support the following scaling mechanisms:

  1. Keda-based Scaling

Pub/Sub Channel

A Channel is a Knative Eventing logical construct that provides an event delivery mechanism which can fan-out received events to multiple destinations via Subscriptions. A Channel has a single inbound HTTP-addressable interface, which may accept events delivered directly or forwarded from multiple Subscriptions. Use the example below if you want to use our Channel backed by Cloud Pub/Sub, which offers at-least-once message delivery and best-effort ordering to existing subscribers.

  1. Channel

Pub/Sub Core Resources

In Cloud Pub/Sub, a publisher application creates and sends messages to a topic, while subscriber applications create a subscription to a topic in order to receive messages from it. If you want to interact directly with Cloud Pub/Sub topics and subscriptions within your Kubernetes cluster, use our custom Kubernetes resources below.

  1. Topic
  2. PullSubscription

Note: This repo is still in development, APIs and resource names are subject to change in the future.

Expand ▾ Collapse ▴

Directories

Path Synopsis
cmd/controller
cmd/pubsub/publisher
cmd/pubsub/receive_adapter
cmd/webhook
pkg/apis +k8s:deepcopy-gen=package
pkg/apis/configs/validation
pkg/apis/duck Package duck contains Cloud Run Events API versions for duck components
pkg/apis/duck/v1alpha1 +k8s:deepcopy-gen=package +groupName=duck.cloud.google.com
pkg/apis/events Package events contains Cloud Run Events API versions for eventing components
pkg/apis/events/v1alpha1 Package v1alpha1 contains API Schema definitions for the events v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/events +k8s:defaulter-gen=TypeMeta +groupName=events.cloud.google.com
pkg/apis/messaging Package messaging contains Cloud Run Events API versions for messaging components
pkg/apis/messaging/v1alpha1 Package v1alpha1 contains API Schema definitions for the eventing v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/messaging +k8s:defaulter-gen=TypeMeta +groupName=messaging.cloud.google.com
pkg/apis/pubsub Package pubsub contains Cloud Run Events API versions for pubsub components
pkg/apis/pubsub/v1alpha1 Package v1alpha1 contains API Schema definitions for the eventing v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/pubsub +k8s:defaulter-gen=TypeMeta +groupName=pubsub.cloud.google.com
pkg/client/clientset/versioned This package has the automatically generated clientset.
pkg/client/clientset/versioned/fake This package has the automatically generated fake clientset.
pkg/client/clientset/versioned/scheme This package contains the scheme of the automatically generated clientset.
pkg/client/clientset/versioned/typed/events/v1alpha1 This package has the automatically generated typed clients.
pkg/client/clientset/versioned/typed/events/v1alpha1/fake Package fake has the automatically generated clients.
pkg/client/clientset/versioned/typed/messaging/v1alpha1 This package has the automatically generated typed clients.
pkg/client/clientset/versioned/typed/messaging/v1alpha1/fake Package fake has the automatically generated clients.
pkg/client/clientset/versioned/typed/pubsub/v1alpha1 This package has the automatically generated typed clients.
pkg/client/clientset/versioned/typed/pubsub/v1alpha1/fake Package fake has the automatically generated clients.
pkg/client/informers/externalversions
pkg/client/informers/externalversions/events
pkg/client/informers/externalversions/events/v1alpha1
pkg/client/informers/externalversions/internalinterfaces
pkg/client/informers/externalversions/messaging
pkg/client/informers/externalversions/messaging/v1alpha1
pkg/client/informers/externalversions/pubsub
pkg/client/informers/externalversions/pubsub/v1alpha1
pkg/client/injection/client
pkg/client/injection/client/fake
pkg/client/injection/ducks/duck/v1alpha1/pubsub
pkg/client/injection/ducks/duck/v1alpha1/pubsub/fake
pkg/client/injection/ducks/duck/v1alpha1/resource
pkg/client/injection/ducks/duck/v1alpha1/resource/fake
pkg/client/injection/informers/events/v1alpha1/cloudauditlogssource
pkg/client/injection/informers/events/v1alpha1/cloudauditlogssource/fake
pkg/client/injection/informers/events/v1alpha1/cloudpubsubsource
pkg/client/injection/informers/events/v1alpha1/cloudpubsubsource/fake
pkg/client/injection/informers/events/v1alpha1/cloudschedulersource
pkg/client/injection/informers/events/v1alpha1/cloudschedulersource/fake
pkg/client/injection/informers/events/v1alpha1/cloudstoragesource
pkg/client/injection/informers/events/v1alpha1/cloudstoragesource/fake
pkg/client/injection/informers/factory
pkg/client/injection/informers/factory/fake
pkg/client/injection/informers/messaging/v1alpha1/channel
pkg/client/injection/informers/messaging/v1alpha1/channel/fake
pkg/client/injection/informers/pubsub/v1alpha1/pullsubscription
pkg/client/injection/informers/pubsub/v1alpha1/pullsubscription/fake
pkg/client/injection/informers/pubsub/v1alpha1/topic
pkg/client/injection/informers/pubsub/v1alpha1/topic/fake
pkg/client/listers/events/v1alpha1
pkg/client/listers/messaging/v1alpha1
pkg/client/listers/pubsub/v1alpha1
pkg/duck
pkg/gclient/iam Package iam provides interfaces and wrappers around the google iam client.
pkg/gclient/iam/testing
pkg/gclient/logging/logadmin Package logadmin contains mockable logadmin client wrappers.
pkg/gclient/logging/logadmin/testing Package testing provides a fake logadmin client for test purposes.
pkg/gclient/pubsub Package pubsub contains Pub/Sub client wrappers to be able to UT things.
pkg/gclient/pubsub/testing
pkg/gclient/scheduler Package scheduler contains Scheduler client wrappers to be able to UT things.
pkg/gclient/scheduler/testing
pkg/gclient/storage Package storage contains Storage client wrappers to be able to UT things.
pkg/gclient/storage/testing
pkg/kncloudevents
pkg/pubsub/adapter
pkg/pubsub/adapter/converters Package converters contains pubsub message to cloudevent converters used by pubsub-based source.
pkg/pubsub/publisher
pkg/reconciler Package reconciler defines implementations of the Reconciler interface defined at knative.dev/pkg/controller.Reconciler.
pkg/reconciler/deployment
pkg/reconciler/events/auditlogs Package auditlogs implements the CloudAuditLogsSource controller.
pkg/reconciler/events/auditlogs/resources Package resources contains helpers for audit log source resources.
pkg/reconciler/events/pubsub Package channel implements the CloudPubSubSource controller.
pkg/reconciler/events/scheduler Package channel implements the Scheduler Source controller.
pkg/reconciler/events/scheduler/resources
pkg/reconciler/events/storage Package channel implements the CloudStorageSource controller.
pkg/reconciler/events/storage/resources
pkg/reconciler/messaging/channel Package channel implements the Pub/Sub Channel controller.
pkg/reconciler/messaging/channel/resources
pkg/reconciler/pubsub
pkg/reconciler/pubsub/pullsubscription Package pullsubscription implements the Pub/Sub PullSubscription controllers.
pkg/reconciler/pubsub/pullsubscription/keda Package keda implements the Pub/Sub PullSubscription controller for Keda-based PullSubscriptions.
pkg/reconciler/pubsub/pullsubscription/keda/resources
pkg/reconciler/pubsub/pullsubscription/resources
pkg/reconciler/pubsub/pullsubscription/static Package static implements the Pub/Sub PullSubscription controller for non-scalable PullSubscriptions.
pkg/reconciler/pubsub/resources
pkg/reconciler/pubsub/topic Package topic implements the Pub/Sub Topic controller.
pkg/reconciler/pubsub/topic/resources
pkg/reconciler/testing
pkg/tracing TODO Move this to knative/pkg's tracing package.
pkg/utils
test/cmd/randstr
test/e2e
test/e2e/lib
test/e2e/lib/metrics
test/e2e/lib/operations
test/e2e/lib/resources
test/test_images/auditlogs_target
test/test_images/receiver
test/test_images/scheduler_target
test/test_images/sender
test/test_images/storage_target
test/test_images/target