Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,45 @@ import (

"knative.dev/pkg/injection/sharedmain"

"knative.dev/eventing/pkg/reconciler/apiserversource"
"knative.dev/eventing/pkg/reconciler/broker"
"knative.dev/eventing/pkg/reconciler/channel"
"knative.dev/eventing/pkg/reconciler/eventtype"
"knative.dev/eventing/pkg/reconciler/legacyapiserversource"
"knative.dev/eventing/pkg/reconciler/legacycontainersource"
"knative.dev/eventing/pkg/reconciler/legacycronjobsource"
"knative.dev/eventing/pkg/reconciler/namespace"
parallel "knative.dev/eventing/pkg/reconciler/parallel"
sequence "knative.dev/eventing/pkg/reconciler/sequence"
"knative.dev/eventing/pkg/reconciler/parallel"
"knative.dev/eventing/pkg/reconciler/pingsource"
"knative.dev/eventing/pkg/reconciler/sequence"
"knative.dev/eventing/pkg/reconciler/subscription"
"knative.dev/eventing/pkg/reconciler/trigger"
)

func main() {
sharedmain.Main("controller",
subscription.NewController,
// Messaging
namespace.NewController,
channel.NewController,

// Eventing
subscription.NewController,
trigger.NewController,
broker.NewController,
eventtype.NewController,

// Flows
parallel.NewController,
sequence.NewController,

// Sources
apiserversource.NewController,
pingsource.NewController,

// Legacy Sources
// TODO(#2312): Remove this after v0.13.
legacyapiserversource.NewController,
legacycontainersource.NewController,
legacycronjobsource.NewController,
)
}
1 change: 0 additions & 1 deletion cmd/sources_controller/kodata/HEAD

This file was deleted.

1 change: 0 additions & 1 deletion cmd/sources_controller/kodata/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion cmd/sources_controller/kodata/VENDOR-LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion cmd/sources_controller/kodata/refs

This file was deleted.

40 changes: 0 additions & 40 deletions cmd/sources_controller/main.go

This file was deleted.

1 change: 0 additions & 1 deletion config/200-sourcecontroller-clusterrole.yaml

This file was deleted.

1 change: 1 addition & 0 deletions config/200-sources-controller-clusterrole.yaml
1 change: 0 additions & 1 deletion config/200-sources-serviceaccount.yaml

This file was deleted.

1 change: 0 additions & 1 deletion config/500-sources-controller.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions config/core/200-eventing-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ roleRef:

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: eventing-controller-sources-controller
labels:
eventing.knative.dev/release: devel
subjects:
- kind: ServiceAccount
name: eventing-controller
namespace: knative-eventing
roleRef:
kind: ClusterRole
name: knative-eventing-sources-controller
apiGroup: rbac.authorization.k8s.io

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
55 changes: 0 additions & 55 deletions config/core/200-sources-serviceaccount.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions config/core/deployments/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ spec:
terminationMessagePolicy: FallbackToLogsOnError
image: knative.dev/eventing/cmd/controller

resources:
requests:
cpu: 100m
memory: 100Mi

env:
- name: SYSTEM_NAMESPACE
valueFrom:
Expand All @@ -48,6 +53,7 @@ spec:
value: config-observability
- name: METRICS_DOMAIN
value: knative.dev/eventing
# Broker
- name: BROKER_INGRESS_IMAGE
value: knative.dev/eventing/cmd/broker/ingress
- name: BROKER_INGRESS_SERVICE_ACCOUNT
Expand All @@ -58,6 +64,15 @@ spec:
value: eventing-broker-filter
- name: BROKER_IMAGE_PULL_SECRET_NAME
value:
# Legacy CronJobSource
- name: CRONJOB_RA_IMAGE
value: knative.dev/eventing/cmd/cronjob_receive_adapter
# PingSource
- name: PING_IMAGE
value: knative.dev/eventing/cmd/ping
# APIServerSource
- name: APISERVER_RA_IMAGE
value: knative.dev/eventing/cmd/apiserver_receive_adapter

securityContext:
allowPrivilegeEscalation: false
Expand Down
72 changes: 0 additions & 72 deletions config/core/deployments/sources-controller.yaml

This file was deleted.

17 changes: 14 additions & 3 deletions config/core/roles/clusterrole-namespaced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ rules:
- apiGroups: ["messaging.knative.dev"]
resources: ["*"]
verbs: ["*"]

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -48,6 +47,18 @@ rules:
- apiGroups: ["sources.eventing.knative.dev"]
resources: ["*"]
verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: knative-sources-namespaced-admin
labels:
eventing.knative.dev/release: devel
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["sources.knative.dev"]
resources: ["*"]
verbs: ["*"]

---
kind: ClusterRole
Expand All @@ -58,7 +69,7 @@ metadata:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
eventing.knative.dev/release: devel
rules:
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev"]
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev", "sources.knative.dev"]
resources: ["*"]
verbs: ["create", "update", "patch", "delete"]
---
Expand All @@ -70,6 +81,6 @@ metadata:
rbac.authorization.k8s.io/aggregate-to-view: "true"
eventing.knative.dev/release: devel
rules:
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev"]
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev", "sources.knative.dev"]
resources: ["*"]
verbs: ["get", "list", "watch"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: knative-eventing-source-controller
name: knative-eventing-sources-controller
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should that rename be covered in the release notes ? 👀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a cluster role and internal

labels:
eventing.knative.dev/release: devel
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,6 @@
target_label: pod
- source_labels: [__meta_kubernetes_service_name]
target_label: service
# Sources controller
- job_name: sources-controller
scrape_interval: 3s
scrape_timeout: 3s
kubernetes_sd_configs:
- role: pod
relabel_configs:
# Scrape only the the targets matching the following metadata
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_label_app, __meta_kubernetes_pod_container_port_name]
action: keep
regex: knative-eventing;sources-controller;metrics
# Rename metadata labels to be reader friendly
- source_labels: [__meta_kubernetes_namespace]
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
target_label: pod
- source_labels: [__meta_kubernetes_service_name]
target_label: service

# inmemorychannel-controller
- job_name: inmemorychannel-controller
Expand Down