knative-gcp

module
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: Apache-2.0

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
  5. CloudBuildSource

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.

Directories

Path Synopsis
cmd
pkg
apis
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package
apis/duck
Package duck contains Cloud Run Events API versions for duck components
Package duck contains Cloud Run Events API versions for duck components
apis/duck/v1alpha1
+k8s:deepcopy-gen=package +groupName=duck.cloud.google.com
+k8s:deepcopy-gen=package +groupName=duck.cloud.google.com
apis/duck/v1beta1
+k8s:deepcopy-gen=package +groupName=duck.cloud.google.com
+k8s:deepcopy-gen=package +groupName=duck.cloud.google.com
apis/events
Package events contains Cloud Run Events API versions for eventing components
Package events contains Cloud Run Events API versions for eventing components
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
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
apis/messaging
Package messaging contains Cloud Run Events API versions for messaging components
Package messaging contains Cloud Run Events API versions for messaging components
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
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
apis/policy
Package policy contains experimental policy API definitions.
Package policy contains experimental policy API definitions.
apis/policy/v1alpha1
Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.run.cloud.google.com
Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.run.cloud.google.com
apis/pubsub
Package pubsub contains Cloud Run Events API versions for pubsub components
Package pubsub contains Cloud Run Events API versions for pubsub components
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
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
apis/pubsub/v1beta1
Package v1beta1 contains API Schema definitions for the eventing v1beta1 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
Package v1beta1 contains API Schema definitions for the eventing v1beta1 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
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/events/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/events/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/messaging/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/messaging/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/policy/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/policy/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/pubsub/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/pubsub/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/pubsub/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/pubsub/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/istio/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/istio/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/istio/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/istio/clientset/versioned/typed/security/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/istio/clientset/versioned/typed/security/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
gclient/iam
Package iam provides interfaces and wrappers around the google iam client.
Package iam provides interfaces and wrappers around the google iam client.
gclient/logging/logadmin
Package logadmin contains mockable logadmin client wrappers.
Package logadmin contains mockable logadmin client wrappers.
gclient/logging/logadmin/testing
Package testing provides a fake logadmin client for test purposes.
Package testing provides a fake logadmin client for test purposes.
gclient/pubsub
Package pubsub contains Pub/Sub client wrappers to be able to UT things.
Package pubsub contains Pub/Sub client wrappers to be able to UT things.
gclient/scheduler
Package scheduler contains Scheduler client wrappers to be able to UT things.
Package scheduler contains Scheduler client wrappers to be able to UT things.
gclient/storage
Package storage contains Storage client wrappers to be able to UT things.
Package storage contains Storage client wrappers to be able to UT things.
pubsub/adapter/converters
Package converters contains pubsub message to cloudevent converters used by pubsub-based source.
Package converters contains pubsub message to cloudevent converters used by pubsub-based source.
reconciler
Package reconciler defines implementations of the Reconciler interface defined at knative.dev/pkg/controller.Reconciler.
Package reconciler defines implementations of the Reconciler interface defined at knative.dev/pkg/controller.Reconciler.
reconciler/events/auditlogs
Package auditlogs implements the CloudAuditLogsSource controller.
Package auditlogs implements the CloudAuditLogsSource controller.
reconciler/events/auditlogs/resources
Package resources contains helpers for audit log source resources.
Package resources contains helpers for audit log source resources.
reconciler/events/build
Package channel implements the CloudBuildSource controller.
Package channel implements the CloudBuildSource controller.
reconciler/events/pubsub
Package channel implements the CloudPubSubSource controller.
Package channel implements the CloudPubSubSource controller.
reconciler/events/scheduler
Package channel implements the Scheduler Source controller.
Package channel implements the Scheduler Source controller.
reconciler/events/storage
Package channel implements the CloudStorageSource controller.
Package channel implements the CloudStorageSource controller.
reconciler/messaging/channel
Package channel implements the Pub/Sub Channel controller.
Package channel implements the Pub/Sub Channel controller.
reconciler/pubsub/pullsubscription
Package pullsubscription implements the Pub/Sub PullSubscription controllers.
Package pullsubscription implements the Pub/Sub PullSubscription controllers.
reconciler/pubsub/pullsubscription/keda
Package keda implements the Pub/Sub PullSubscription controller for Keda-based PullSubscriptions.
Package keda implements the Pub/Sub PullSubscription controller for Keda-based PullSubscriptions.
reconciler/pubsub/pullsubscription/static
Package static implements the Pub/Sub PullSubscription controller for non-scalable PullSubscriptions.
Package static implements the Pub/Sub PullSubscription controller for non-scalable PullSubscriptions.
reconciler/pubsub/topic
Package topic implements the Pub/Sub Topic controller.
Package topic implements the Pub/Sub Topic controller.
tracing
TODO Move this to knative/pkg's tracing package.
TODO Move this to knative/pkg's tracing package.
e2e

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL