Skip to content

Commit

Permalink
Merge branch 'master' of github.com:knative/eventing into broker-rede…
Browse files Browse the repository at this point in the history
…livery
  • Loading branch information
pierDipi committed Apr 7, 2020
2 parents 1ab7eee + 10b4acb commit 382ed6c
Show file tree
Hide file tree
Showing 64 changed files with 2,344 additions and 736 deletions.
40 changes: 28 additions & 12 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ Also take a look at:

## Getting started

1. Setup [Knative Serving](http://github.com/knative/serving)
1. [Create and checkout a repo fork](#checkout-your-fork)
1. [Install a channel implementation](#install-channels)

Once you meet these requirements, you can
[start the eventing-controller](#starting-eventing-controller).

> :information_source: If you intend to use event sinks based on Knative
> Services as described in some of our examples, consider installing
> [Knative Serving](http://github.com/knative/serving). A few
> [contrib](http://github.com/knative/eventing-contrib) projects also have a
> dependency on Serving.
Before submitting a PR, see also [contribution guidelines](./CONTRIBUTING.md).

### Requirements

You must have the core of [Knative](http://github.com/knative/serving) running
on your cluster.

You must have [`ko`](https://github.com/google/ko) installed.

### Create a cluster and a repo
Expand All @@ -40,9 +42,10 @@ You must have [`ko`](https://github.com/google/ko) installed.
- [Google Container Registry quickstart](https://cloud.google.com/container-registry/docs/pushing-and-pulling)
- [Docker Hub quickstart](https://docs.docker.com/docker-hub/)

**Note**: You'll need to be authenticated with your `KO_DOCKER_REPO` before
pushing images. Run `gcloud auth configure-docker` if you are using Google
Container Registry or `docker login` if you are using Docker Hub.
> :information_source: You'll need to be authenticated with your
> `KO_DOCKER_REPO` before pushing images. Run `gcloud auth configure-docker` if
> you are using Google Container Registry or `docker login` if you are using
> Docker Hub.
### Setup your environment

Expand All @@ -56,10 +59,10 @@ recommend adding them to your `.bashrc`):
1. `KO_DOCKER_REPO`: The docker repository to which developer images should be
pushed (e.g. `gcr.io/[gcloud-project]`).

- **Note**: if you are using docker hub to store your images your
`KO_DOCKER_REPO` variable should be `docker.io/<username>`.
- **Note**: Currently Docker Hub doesn't let you create subdirs under your
username.
> :information_source: If you are using Docker Hub to store your images, your
> `KO_DOCKER_REPO` variable should have the format `docker.io/<username>`.
> Currently, Docker Hub doesn't let you create subdirs under your username (e.g.
> `<username>/knative`).
`.bashrc` example:

Expand All @@ -86,7 +89,7 @@ mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
git clone [email protected]:${YOUR_GITHUB_USERNAME}/eventing.git
cd eventing
git remote add upstream git@github.com:knative/eventing.git
git remote add upstream https://github.com/knative/eventing.git
git remote set-url --push upstream no_push
```

Expand Down Expand Up @@ -133,6 +136,19 @@ ko apply -f config/channels/in-memory-channel/
Depending on your needs you might want to install other
[channel implementations](https://github.com/knative/docs/blob/master/docs/eventing/channels/channels-crds.md).

## Install Brokers

Install the
[Channel Broker](https://github.com/knative/eventing/tree/master/config/brokers/channel-broker)
or any of the other Brokers available inside the `config/brokers/` directory.

```shell
ko apply -f config/brokers/channel-broker/
```

Depending on your needs you might want to install other
[Broker implementations](https://github.com/knative/eventing/tree/master/docs/broker).

## Iterating

As you make changes to the code-base, there are two special cases to be aware
Expand Down
19 changes: 14 additions & 5 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ required = [
# Our master branch tracks knative/pkg master or a release.
[[override]]
name = "knative.dev/pkg"
branch = "master"
branch = "release-0.14"

# TODO why is this overridden?
[[override]]
Expand Down
46 changes: 46 additions & 0 deletions cmd/upgrade/v0.14.0/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2020 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"

"context"
"fmt"
"os"

"k8s.io/client-go/kubernetes"
kubeclient "knative.dev/pkg/client/injection/kube/client"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/signals"

versioned "knative.dev/eventing/pkg/client/clientset/versioned"
eventingclient "knative.dev/eventing/pkg/client/injection/client"
broker "knative.dev/eventing/pkg/upgrader/broker/v0.14.0"
)

func main() {
ctx := signals.NewContext()
cfg := sharedmain.ParseAndGetConfigOrDie()
ctx = context.WithValue(ctx, kubeclient.Key{}, kubernetes.NewForConfigOrDie(cfg))
ctx = context.WithValue(ctx, eventingclient.Key{}, versioned.NewForConfigOrDie(cfg))
if err := broker.Upgrade(ctx); err != nil {
fmt.Printf("Broker Upgrade failed with: %v\n", err)
os.Exit(1)
}
}
52 changes: 0 additions & 52 deletions config/200-jobrunner-clusterrole.yaml

This file was deleted.

1 change: 1 addition & 0 deletions config/200-jobrunner-clusterrole.yaml
37 changes: 0 additions & 37 deletions config/201-jobrunner-serviceaccount.yaml

This file was deleted.

1 change: 1 addition & 0 deletions config/201-jobrunner-serviceaccount.yaml
39 changes: 39 additions & 0 deletions config/brokers/mt-channel-broker/roles/controller-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: knative-eventing-mt-channel-broker-controller
labels:
eventing.knative.dev/release: devel
rules:
# Configs resources and status we care about.
- apiGroups:
- ""
resources:
- "namespaces/finalizers"
verbs:
- "update"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- "get"
- "list"
- "create"
- "update"
- "delete"
- "patch"
- "watch"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: eventing-channel-broker-controller
name: eventing-mt-channel-broker-controller
labels:
eventing.knative.dev/release: devel
subjects:
Expand All @@ -24,5 +24,5 @@ subjects:
namespace: knative-eventing
roleRef:
kind: ClusterRole
name: knative-eventing-channel-broker-controller
name: knative-eventing-mt-channel-broker-controller
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
# Updates the status to reflect subscribable status.
- apiGroups:
- messaging.knative.dev
Expand Down
Loading

0 comments on commit 382ed6c

Please sign in to comment.