Git Product home page Git Product logo

knative-gcp's Introduction

status: inactive

This project is no longer actively developed or maintained.

For new work related to this project see Knative accepted as a CNCF incubating project

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.

If you are interested in contributing, see DEVELOPMENT.md.

Installing Knative-GCP

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

  1. Installing Knative-GCP
  2. Installing a Service Account for the Data Plane
  3. Installing GCP Broker
  4. Installing Broker with PubSub Channel
  5. Managing Multiple Projects

Operating Knative-GCP

The following guides pertain to operating an existing Knative-GCP installation.

  1. Accessing Event Traces in Cloud Trace

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.

knative-gcp's People

Contributors

adrcunha avatar alexandraroatis avatar bharattkukreja avatar bskaplan avatar capri-xiyue avatar cathyzhyi avatar chizhg avatar danyinggu avatar eclipselu avatar ectelion avatar ericlem avatar grac3gao avatar grac3gao-zz avatar grantr avatar harwayne avatar ian-mi avatar knative-automation avatar knative-prow-robot avatar liu-cong avatar mattmoor avatar mattmoor-sockpuppet avatar mohamedelhawaty avatar n3wscott avatar nachocano avatar nlopezgi avatar stuart-xyz avatar tayarani avatar tommyreddad avatar yolocs avatar zargarpur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knative-gcp's Issues

Event Display shows errors in its output for Extensions

When using Event Display (which uses Cloud SDK), both Storage and Scehduler examples show errors in the output:
For example:
โ˜๏ธ cloudevents.Event
Validation: valid
Context Attributes,
specversion: 0.3
type: google.storage.object.finalize
source: //storage.googleapis.com/buckets/vaikasvaikas-notification-test
subject: testfilehere
id: 710717795564381
time: 2019-08-27T16:35:03.742Z
schemaurl: https://raw.githubusercontent.com/google/knative-gcp/master/schemas/storage/schema.json
datacontenttype: application/json
Extensions,
error: unexpected end of JSON input

E2E test for the storage source/importer

We need an E2E for the storage source/importer. It will have to do the proper cluster setup (e.g., creating secrets, a bucket, etc.), then upload a file, and see that a notification is received on the sink.

There is a working example with PullSubscription, where we might be able to reuse some of the code. Need to sync with @n3wscott

Jobs: Use well defined name and not list them using label selectors.

Is there a reason why we can't use a well defined name and not have to list them using label selectors. I think there might be a race here. We had this same discussion with Channels and decided to use predictable naming and that also has been what serving has been doing.

Originally posted by @vaikas-google in #24

Refactor sync code for channel subscribers.

#26 (comment)

This is where I found some confusion, coupled with the lines below where we actually create it. They seem very similar to just create. Or put another way, why do you need subCreates and don't just throw everything into subUpdates. I think this is where the comments would help. It was difficult to visually diff what really was different about these two loops for the create case.

Originally posted by @vaikas-google in #26

Storage creates multiple Notifications

Occasionally I see that Storage creates two GCS notifications. Then, when the Storage CO is deleted, only the more recent notifications is deleted. This caused me to hit the limit of 10 notifications on a bucket.

$ gsutil notification list gs://eventing-demo
# Nothing

$ kn importers create storage desjani --parameters bucket=eventing-demo
# Finishes when the importer is ready.

$ gsutil notification list gs://eventing-demo
projects/_/buckets/eventing-demo/notificationConfigs/67
        Cloud Pub/Sub topic: projects/harwayne2/topics/storage-e711b0c4-f647-4723-be61-99ce59801287
        Custom attributes:
                knative-gcp: google.storage

projects/_/buckets/eventing-demo/notificationConfigs/68
        Cloud Pub/Sub topic: projects/harwayne2/topics/storage-b7cbfa63-a7ba-4f8f-8306-efc574daa7e4
        Custom attributes:
                knative-gcp: google.storage

$ ./kn importers generic delete storage desjani  
# Finishes successfully.

$ gsutil notification list gs://eventing-demo
projects/_/buckets/eventing-demo/notificationConfigs/67
        Cloud Pub/Sub topic: projects/harwayne2/topics/storage-e711b0c4-f647-4723-be61-99ce59801287
        Custom attributes:
                knative-gcp: google.storage

Distinct ServiceAccounts

The current ServiceAccount name for the controller is controller. This works well while in the cloud-run-events namespace. But we saw in knative/eventing that people wanted to install the controllers and webhooks into user defined namespaces, at which point the name controller is likely to collide.

I recommend cloud-run-events-controller.

Scheduler needs instructions to enable Schedule API

followed the instructions but job fails with

{"level":"info","ts":1567617015.9008741,"logger":"fallback-logger","caller":"scheduler/job.go:217","msg":"Failed to create Job \"projects/fooo/locations/us-central1/jobs/XXX\": rpc error: code = PermissionDenied desc = Cloud Scheduler API has not been used in project XXX before or it is disabled. Enable it by visiting https://console.cloud.google.com/apis/api/cloudscheduler.googleapis.com/overview?project=XXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","action":"create","project":"fooo","jobName":"projects/fooo/locations/us-central1/jobs/XXX"}

#Bug Updating the event types of an GCS importer doesn't work and is not immutable

Create a GCS importer with just the "finalize" event type.
Then edit it to add "metadataupdate". Webhook accepts it and the object is ready.
However, gsutil notification list doesn't show the new type. (also old ones stay forever, but I believe there is another bug tracking it).

I haven't tested for other fields.

Expected behavior:
Either make the field immutable, or reconcile (ideal) it.

This leaves the finalizer hanging around -- should we give up on the finalizer at some point (for example, if we don't have permissions to delete the subscription, or if it is already deleted)?

This leaves the finalizer hanging around -- should we give up on the finalizer at some point (for example, if we don't have permissions to delete the subscription, or if it is already deleted)?

I seem to recall that the GitHub source had issues where it would stick around forever if (for example) you created a source but it hadn't had a chance to register the webhook yet.

Originally posted by @evankanderson in https://github.com/GoogleCloudPlatform/cloud-run-events/diffs

updateFinalizers should use update

This code seems unnecessary. updateFinalizers is only called if we changed the finalizers during reconcile. IIUC the only thing this is protecting against is if something else changes the object while we reconciled, but we can let the patch fail and try again, right?

Originally posted by @grantr in #35 (comment)

Tracing through Channel

Problem
A request made to the Channel should generate traces that link the request to the subscribers. It should either use an existing Trace if present, or create a new Trace if one isn't.

The trace from the Channel to any subscribers MUST be annotated with the subscription's name.

Persona:
System Integrator

Exit Criteria
Each of the following generate a trace that includes both the incoming request and the request to any subscribers. The trace from the Channel to any subscribers MUST be annotated with the subscription's name:

  • A request sent to an Channel without any trace information.
  • A request sent to an Channel with trace information in the HTTP headers (B3 format).
  • A request sent to an Channel with trace information in the Cloud Event's traceparent attribute, but not in the HTTP headers.

Note that this is very similar to knative/eventing#1757

This assumes you have actually downloaded the files (or cloned the git repo). It would be nice if we could have a 'curl' way to get these files so that we don't raise the bar unnecessarily for just kicking the tires.

bit of a nit here. This assumes you have actually downloaded the files (or cloned the git repo). It would be nice if we could have a 'curl' way to get these files so that we don't raise the bar unnecessarily for just kicking the tires.

Originally posted by @vaikas-google in https://github.com/_render_node/MDExOlB1bGxSZXF1ZXN0Mjg2Nzk0NTgz/pull_requests/unread_timeline

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.