diff --git a/config/broker/200-rbac.yaml b/config/broker/200-rbac.yaml deleted file mode 120000 index b3e417c976..0000000000 --- a/config/broker/200-rbac.yaml +++ /dev/null @@ -1 +0,0 @@ -rbac/broker.yaml \ No newline at end of file diff --git a/config/broker/400-broker-service.yaml b/config/broker/400-broker-service.yaml deleted file mode 120000 index 95052d3331..0000000000 --- a/config/broker/400-broker-service.yaml +++ /dev/null @@ -1 +0,0 @@ -services/broker.yaml \ No newline at end of file diff --git a/config/broker/500-broker.yaml b/config/broker/500-broker.yaml deleted file mode 120000 index 5932d3c011..0000000000 --- a/config/broker/500-broker.yaml +++ /dev/null @@ -1 +0,0 @@ -deployments/broker.yaml \ No newline at end of file diff --git a/config/broker/500-hpa.yaml b/config/broker/500-hpa.yaml deleted file mode 120000 index f8eaccc143..0000000000 --- a/config/broker/500-hpa.yaml +++ /dev/null @@ -1 +0,0 @@ -deployments/hpa.yaml \ No newline at end of file diff --git a/config/broker/deployments/broker.yaml b/config/broker/deployments/broker.yaml deleted file mode 100644 index cd227d51c6..0000000000 --- a/config/broker/deployments/broker.yaml +++ /dev/null @@ -1,205 +0,0 @@ -# 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. - -# TODO(https://github.com/google/knative-gcp/issues/882) Support readiness/liveness probes. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: broker-ingress - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -spec: - replicas: 1 - selector: - matchLabels: &labels - app: cloud-run-events - role: broker-ingress - template: - metadata: - labels: *labels - spec: - # Only needed if running with workload identity. - serviceAccountName: broker - containers: - - name: broker-ingress - image: ko://github.com/google/knative-gcp/cmd/broker/ingress - env: - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /var/secrets/google/key.json - - name: PORT - value: "8080" - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: CONFIG_LOGGING_NAME - value: config-logging - - name: CONFIG_OBSERVABILITY_NAME - value: config-observability - - name: METRICS_DOMAIN - value: knative.dev/internal/eventing - volumeMounts: - - name: broker-config - mountPath: /var/run/cloud-run-events/broker - - name: google-broker-key - mountPath: /var/secrets/google - resources: - limits: - memory: 500Mi - requests: - cpu: 1000m - memory: 500Mi - ports: - - name: http - containerPort: 8080 - volumes: - - name: broker-config - configMap: - name: broker-targets - - name: google-broker-key - secret: - secretName: google-broker-key - optional: true - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: broker-fanout - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -spec: - replicas: 1 - selector: - matchLabels: &labels - app: cloud-run-events - role: broker-fanout - template: - metadata: - labels: *labels - spec: - # Needed to access K8s resources and pubsub when using workload identity. - serviceAccountName: broker - containers: - - name: broker-fanout - image: ko://github.com/google/knative-gcp/cmd/broker/fanout - env: - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /var/secrets/google/key.json - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: MAX_CONCURRENCY_PER_EVENT - value: "1000" - - name: HANDLER_CONCURRENCY - value: "10" - - name: CONFIG_LOGGING_NAME - value: config-logging - - name: CONFIG_OBSERVABILITY_NAME - value: config-observability - - name: METRICS_DOMAIN - value: knative.dev/internal/eventing - volumeMounts: - - name: broker-config - mountPath: /var/run/cloud-run-events/broker - - name: google-broker-key - mountPath: /var/secrets/google - resources: - limits: - memory: 1000Mi - requests: - cpu: 1500m - memory: 1000Mi - volumes: - - name: broker-config - configMap: - name: broker-targets - - name: google-broker-key - secret: - secretName: google-broker-key - optional: true - - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: broker-retry - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -spec: - replicas: 1 - selector: - matchLabels: &labels - app: cloud-run-events - role: broker-retry - template: - metadata: - labels: *labels - spec: - # Needed to access K8s resources and pubsub when using workload identity. - serviceAccountName: broker - containers: - - name: broker-retry - image: ko://github.com/google/knative-gcp/cmd/broker/retry - env: - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /var/secrets/google/key.json - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: CONFIG_LOGGING_NAME - value: config-logging - - name: CONFIG_OBSERVABILITY_NAME - value: config-observability - - name: METRICS_DOMAIN - value: knative.dev/internal/eventing - volumeMounts: - - name: broker-config - mountPath: /var/run/cloud-run-events/broker - - name: google-broker-key - mountPath: /var/secrets/google - resources: - limits: - memory: 1500Mi - requests: - cpu: 1000m - memory: 1500Mi - volumes: - - name: broker-config - configMap: - name: broker-targets - - name: google-broker-key - secret: - secretName: google-broker-key - optional: true diff --git a/config/broker/deployments/dummy.go b/config/broker/deployments/dummy.go deleted file mode 100644 index 1273978163..0000000000 --- a/config/broker/deployments/dummy.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 - - https://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 core is a placeholder that allows us to pull in config files -// via go mod vendor. -package deployments diff --git a/config/broker/deployments/hpa.yaml b/config/broker/deployments/hpa.yaml deleted file mode 100644 index b036701b1e..0000000000 --- a/config/broker/deployments/hpa.yaml +++ /dev/null @@ -1,77 +0,0 @@ -apiVersion: autoscaling/v2beta2 -kind: HorizontalPodAutoscaler -metadata: - name: broker-ingress-hpa - namespace: cloud-run-events -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: broker-ingress - minReplicas: 1 - maxReplicas: 10 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 95 - - type: Resource - resource: - name: memory - target: - type: AverageValue - averageValue: 450Mi ---- -apiVersion: autoscaling/v2beta2 -kind: HorizontalPodAutoscaler -metadata: - name: broker-fanout-hpa - namespace: cloud-run-events -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: broker-fanout - minReplicas: 1 - maxReplicas: 20 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 95 - - type: Resource - resource: - name: memory - target: - type: AverageValue - averageValue: 900Mi ---- -apiVersion: autoscaling/v2beta2 -kind: HorizontalPodAutoscaler -metadata: - name: broker-retry-hpa - namespace: cloud-run-events -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: broker-retry - minReplicas: 1 - maxReplicas: 20 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 95 - - type: Resource - resource: - name: memory - target: - type: AverageValue - averageValue: 1400Mi \ No newline at end of file diff --git a/config/broker/dummy.go b/config/broker/dummy.go deleted file mode 100644 index acb6d9d8c2..0000000000 --- a/config/broker/dummy.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 - - https://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 core is a placeholder that allows us to pull in config files -// via go mod vendor. -package broker diff --git a/config/broker/rbac/broker.yaml b/config/broker/rbac/broker.yaml deleted file mode 100644 index 8dced3a746..0000000000 --- a/config/broker/rbac/broker.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# 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. - -# Service account used by GCP broker data plane. -apiVersion: v1 -kind: ServiceAccount -metadata: - name: broker - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel - ---- - -# Role for GCP broker data plane. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: cloud-run-events-broker - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: cloud-run-events-broker - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -subjects: -- kind: ServiceAccount - name: broker - namespace: cloud-run-events -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: cloud-run-events-broker \ No newline at end of file diff --git a/config/broker/rbac/dummy.go b/config/broker/rbac/dummy.go deleted file mode 100644 index 2f8e209717..0000000000 --- a/config/broker/rbac/dummy.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 - - https://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 core is a placeholder that allows us to pull in config files -// via go mod vendor. -package rbac diff --git a/config/broker/services/broker.yaml b/config/broker/services/broker.yaml deleted file mode 100644 index 4d55e988b9..0000000000 --- a/config/broker/services/broker.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - -apiVersion: v1 -kind: Service -metadata: - name: broker-ingress - namespace: cloud-run-events - labels: - events.cloud.google.com/release: devel -spec: - selector: - app: cloud-run-events - role: broker-ingress - ports: - - name: http - port: 80 - protocol: TCP - targetPort: 8080 \ No newline at end of file diff --git a/config/broker/services/dummy.go b/config/broker/services/dummy.go deleted file mode 100644 index 38b82572e3..0000000000 --- a/config/broker/services/dummy.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 - - https://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 core is a placeholder that allows us to pull in config files -// via go mod vendor. -package services diff --git a/config/core/roles/role.yaml b/config/core/roles/role.yaml index 70a860074f..c753cd6f41 100644 --- a/config/core/roles/role.yaml +++ b/config/core/roles/role.yaml @@ -34,3 +34,22 @@ rules: - patch - delete +--- + +# Role for GCP broker data plane. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: cloud-run-events-broker + namespace: cloud-run-events + labels: + events.cloud.google.com/release: devel +rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch \ No newline at end of file diff --git a/config/core/roles/rolebinding.yaml b/config/core/roles/rolebinding.yaml index baf1bae01c..cfc25cb8c8 100644 --- a/config/core/roles/rolebinding.yaml +++ b/config/core/roles/rolebinding.yaml @@ -27,3 +27,21 @@ roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: cloud-run-events-controller + +--- +# RoleBinding for GCP broker data plane. +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cloud-run-events-broker + namespace: cloud-run-events + labels: + events.cloud.google.com/release: devel +subjects: + - kind: ServiceAccount + name: broker + namespace: cloud-run-events +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: cloud-run-events-broker \ No newline at end of file diff --git a/config/core/serviceaccount.yaml b/config/core/serviceaccount.yaml index 3624189cff..084c83b1dd 100644 --- a/config/core/serviceaccount.yaml +++ b/config/core/serviceaccount.yaml @@ -29,3 +29,14 @@ metadata: namespace: cloud-run-events labels: events.cloud.google.com/release: devel + +--- + +# Service account used by GCP broker data plane. +apiVersion: v1 +kind: ServiceAccount +metadata: + name: broker + namespace: cloud-run-events + labels: + events.cloud.google.com/release: devel \ No newline at end of file diff --git a/test/lib.sh b/test/lib.sh index 8faa232218..bed6c971a0 100644 --- a/test/lib.sh +++ b/test/lib.sh @@ -17,7 +17,6 @@ # Include after test-infra/scripts/library.sh readonly CLOUD_RUN_EVENTS_CONFIG="config/" -readonly CLOUD_RUN_EVENTS_GCP_BROKER_CONFIG="config/broker" readonly CLOUD_RUN_EVENTS_ISTIO_CONFIG="config/istio" # Install all required components for running knative-gcp. @@ -35,7 +34,6 @@ function cloud_run_events_setup() { header "Starting Cloud Run Events" subheader "Installing Cloud Run Events" ko apply --strict -f ${CLOUD_RUN_EVENTS_CONFIG} || return 1 - ko apply --strict -f ${CLOUD_RUN_EVENTS_GCP_BROKER_CONFIG} || return 1 ko apply --strict -f ${CLOUD_RUN_EVENTS_ISTIO_CONFIG} || return 1 wait_until_pods_running cloud-run-events || return 1 }