Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into subscribable-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Harwayne committed May 6, 2020
2 parents 4468c1f + 9782b1b commit 14bddba
Show file tree
Hide file tree
Showing 228 changed files with 14,957 additions and 3,848 deletions.
9 changes: 7 additions & 2 deletions cmd/broker/ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ func main() {
}
logger.Desugar().Info("Starting ingress handler", zap.Any("envConfig", env), zap.Any("Project ID", projectID))

statsReporter := ingress.NewStatsReporter(env.PodName, containerName)
ingress, err := ingress.NewHandler(ctx, statsReporter, ingress.WithPort(env.Port), ingress.WithProjectID(projectID))
ingress, err := InitializeHandler(
ctx,
ingress.Port(env.Port),
ingress.ProjectID(projectID),
ingress.PodName(env.PodName),
ingress.ContainerName(containerName),
)
if err != nil {
logger.Desugar().Fatal("Unable to create ingress handler: ", zap.Error(err))
}
Expand Down
41 changes: 41 additions & 0 deletions cmd/broker/ingress/wire.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// +build wireinject

/*
Copyright 2020 Google LLC.
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 (
"context"

"github.com/google/knative-gcp/pkg/broker/config/volume"
"github.com/google/knative-gcp/pkg/broker/ingress"
"github.com/google/wire"
)

func InitializeHandler(
ctx context.Context,
port ingress.Port,
projectID ingress.ProjectID,
podName ingress.PodName,
containerName ingress.ContainerName,
) (*ingress.Handler, error) {
panic(wire.Build(
ingress.HandlerSet,
wire.Value([]volume.Option(nil)),
volume.NewTargetsFromFile,
))
}
39 changes: 39 additions & 0 deletions cmd/broker/ingress/wire_gen.go

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

4 changes: 2 additions & 2 deletions docs/examples/channel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Data,
}
```

These events are generated from the `hello-world` `PingSource`, sent through
the `demo` `Channel` and delivered to the `event-display` via the `demo`
These events are generated from the `hello-world` `PingSource`, sent through the
`demo` `Channel` and delivered to the `event-display` via the `demo`
`Subscription`.

## What's Next
Expand Down
14 changes: 11 additions & 3 deletions docs/examples/cloudschedulersource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ scheduled events from

## Prerequisites

1. [Install Knative-GCP](../../install/install-knative-gcp.md). Note that your
project needs to be created with an App Engine application. Refer to this
1. [Install Knative-GCP](../../install/install-knative-gcp.md).

1. Create with an App Engine application in your project. Refer to this
[guide](https://cloud.google.com/scheduler/docs/quickstart#create_a_project_with_an_app_engine_app)
for more details.
for more details. You can change the APP_ENGINE_LOCATION, but please make
sure you also update the spec.location in
[`CloudSchedulerSource`](cloudschedulersource.yaml)

```shell
export APP_ENGINE_LOCATION=us-central1
gcloud app create --region=$APP_ENGINE_LOCATION
```

1. [Create a Pub/Sub enabled Service Account](../../install/pubsub-service-account.md)

Expand Down
10 changes: 8 additions & 2 deletions docs/install/install-knative-gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ko apply -f ./config
kubectl apply --filename https://github.com/google/knative-gcp/releases/download/${KGCP_VERSION}/cloud-run-events.yaml
```

## Configure the Authentication Mechanism for GCP
## Configure the Authentication Mechanism for GCP (the Control Plane)

Currently, we support two methods: Workload Identity and Kubernetes Secret.
Workload Identity is the recommended way to access Google Cloud services from
Expand All @@ -82,7 +82,13 @@ error message.
wish to configure the auth manually, refer to
[manually configure authentication for GCP](./authentication-mechanisms-gcp.md),

- Option 1 (Recommended): Use Workload Identity. Apply
- Option 1 (Recommended): Use Workload Identity. **_Note:_** Now, Workload
Identity for the Control Plane only works if you install the Knative-GCP
Constructs from the master. If you install the Knative-GCP Constructs with our
latest release (v0.14.0) or older releases, please use option 2.

Apply

[init_control_plane_gke.sh](../../hack/init_control_plane_gke.sh):

```shell
Expand Down
18 changes: 18 additions & 0 deletions docs/install/patch-config-tracing-configmap-with-zipkin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2020 Google LLC
#
# 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.

data:
# Configuration for tracing to use the Zipkin backend
backend: "zipkin"
zipkin-endpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans"
5 changes: 4 additions & 1 deletion docs/install/pubsub-service-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ also need the ability to publish messages (`roles/pubsub.publisher`).
--role roles/pubsub.editor
```

## Configure the Authentication Mechanism for GCP
## Configure the Authentication Mechanism for GCP (the Data Plane)

### Option 1: Use Workload Identity

It is the recommended way to access Google Cloud services from within GKE due to
its improved security properties and manageability. For more information about
Workload Identity see
[here](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity).
**_Note:_** Installing Knative-GCP Constructs from the master and installing it
with our latest release (v0.14.0) both support Workload Identity for the Data
Plane. Older releases don't support this.
1. Enable Workload Identity. Check
[Manually Configure Authentication Mechanism for GCP](authentication-mechanisms-gcp.md)
Expand Down
19 changes: 5 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ require (
github.com/golang/protobuf v1.4.0
github.com/google/go-cmp v0.4.0
github.com/google/uuid v1.1.1
github.com/google/wire v0.4.0
github.com/googleapis/gax-go/v2 v2.0.5
github.com/googleapis/gnostic v0.4.0 // indirect
github.com/gorilla/mux v1.7.3 // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/pkg/errors v0.9.1
go.opencensus.io v0.22.3
go.opentelemetry.io/otel v0.3.0 // indirect
go.uber.org/multierr v1.2.0
go.uber.org/zap v1.10.0
go.uber.org/multierr v1.5.0
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6 // indirect
google.golang.org/api v0.22.1-0.20200430202532-ac9be1f8f530
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84
Expand All @@ -31,13 +30,11 @@ require (
istio.io/api v0.0.0-20200227213531-891bf31f3c32
istio.io/client-go v0.0.0-20200227214646-23b87b42e49b
istio.io/gogo-genproto v0.0.0-20200130224810-a0338448499a // indirect
k8s.io/api v0.17.0
k8s.io/api v0.17.3
k8s.io/apimachinery v0.18.1
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d // indirect
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f // indirect
knative.dev/eventing v0.14.1-0.20200501170243-0bb51bb8d62b
knative.dev/pkg v0.0.0-20200501164043-2e4e82aa49f1
knative.dev/pkg v0.0.0-20200506001744-478962f05e2b
knative.dev/serving v0.14.1-0.20200424135249-b16b68297056
)

Expand Down Expand Up @@ -70,12 +67,6 @@ replace github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v0.0.0-20

replace github.com/pkg/errors => github.com/pkg/errors v0.8.1

replace github.com/prometheus/client_model => github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4

replace github.com/prometheus/common => github.com/prometheus/common v0.7.0

replace github.com/prometheus/procfs => github.com/prometheus/procfs v0.0.5

replace github.com/robfig/cron/v3 => github.com/robfig/cron/v3 v3.0.0

replace go.uber.org/zap => go.uber.org/zap v1.9.2-0.20180814183419-67bc79d13d15
Expand Down
Loading

0 comments on commit 14bddba

Please sign in to comment.