
---
# eventing-core.yaml
# Copyright 2018 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: v1
kind: Namespace
metadata:
  name: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"

---
# Copyright 2018 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: v1
kind: ServiceAccount
metadata:
  name: eventing-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-controller
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-controller-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: addressable-resolver
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-controller-source-observer
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: source-observer
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-controller-sources-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
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:
  name: eventing-controller-manipulator
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: channelable-manipulator
  apiGroup: rbac.authorization.k8s.io

---
# 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: v1
kind: ServiceAccount
metadata:
  name: pingsource-mt-adapter
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: knative-eventing-pingsource-mt-adapter
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: pingsource-mt-adapter
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-pingsource-mt-adapter
  apiGroup: rbac.authorization.k8s.io

---
# Copyright 2018 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: v1
kind: ServiceAccount
metadata:
  name: eventing-webhook
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-webhook
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-webhook
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-webhook
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-webhook-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-webhook
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: addressable-resolver
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eventing-webhook-podspecable-binding
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-webhook
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: podspecable-binding
  apiGroup: rbac.authorization.k8s.io

---
# 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-br-default-channel
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
data:
  channelTemplateSpec: |
    apiVersion: messaging.knative.dev/v1beta1
    kind: InMemoryChannel

---
# 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-br-defaults
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
data:
  # Configuration for defaulting channels that do not specify CRD implementations.
  default-br-config: |
    clusterDefault:
      brokerClass: MTChannelBasedBroker
      apiVersion: v1
      kind: ConfigMap
      name: config-br-default-channel
      namespace: knative-eventing

---
# Copyright 2018 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: default-ch-webhook
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
data:
  # Configuration for defaulting channels that do not specify CRD implementations.
  default-ch-config: |
    clusterDefault:
      apiVersion: messaging.knative.dev/v1beta1
      kind: InMemoryChannel
    namespaceDefaults:
      some-namespace:
        apiVersion: messaging.knative.dev/v1beta1
        kind: InMemoryChannel

---
# Copyright 2018 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-leader-election
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/example-checksum: "43edfe90"
  annotations:
    knative.dev/example-checksum: f7320456
data:
  _example: |
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################

    # This block is not actually functional configuration,
    # but serves to illustrate the available configuration
    # options and document them in a way that is accessible
    # to users that `kubectl edit` this config map.
    #
    # These sample configuration options may be copied out of
    # this example block and unindented to be in the data block
    # to actually change the configuration.

    # leaseDuration is how long non-leaders will wait to try to acquire the
    # lock; 15 seconds is the value used by core kubernetes controllers.
    leaseDuration: "15s"

    # renewDeadline is how long a leader will try to renew the lease before
    # giving up; 10 seconds is the value used by core kubernetes controllers.
    renewDeadline: "10s"

    # retryPeriod is how long the leader election client waits between tries of
    # actions; 2 seconds is the value used by core kuberntes controllers.
    retryPeriod: "2s"

    # enabledComponents is a comma-delimited list of component names for which
    # leader election is enabled. Valid values are:
    #
    # - controller
    # - broker-controller
    # - inmemorychannel-dispatcher
    # - inmemorychannel-controller
    # - pingsource-mt-adapter
    enabledComponents: "controller,broker-controller,inmemorychannel-dispatcher,inmemorychannel-controller,webhook,pingsource-mt-adapter"

---
# Copyright 2018 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-logging
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/config-propagation: original
    knative.dev/config-category: eventing
data:
  # Common configuration for all Knative codebase
  zap-logger-config: |
    {
      "level": "info",
      "development": false,
      "outputPaths": ["stdout"],
      "errorOutputPaths": ["stderr"],
      "encoding": "json",
      "encoderConfig": {
        "timeKey": "ts",
        "levelKey": "level",
        "nameKey": "logger",
        "callerKey": "caller",
        "messageKey": "msg",
        "stacktraceKey": "stacktrace",
        "lineEnding": "",
        "levelEncoder": "",
        "timeEncoder": "iso8601",
        "durationEncoder": "",
        "callerEncoder": ""
      }
    }
  # Log level overrides
  # For all components changes are be picked up immediately.
  loglevel.controller: "info"
  loglevel.webhook: "info"

---
# Copyright 2019 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-observability
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/config-propagation: original
    knative.dev/config-category: eventing
    knative.dev/example-checksum: "7f61d62e"
  annotations:
    knative.dev/example-checksum: 429d16f7
data:
  _example: |
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################

    # This block is not actually functional configuration,
    # but serves to illustrate the available configuration
    # options and document them in a way that is accessible
    # to users that `kubectl edit` this config map.
    #
    # These sample configuration options may be copied out of
    # this example block and unindented to be in the data block
    # to actually change the configuration.

    # metrics.backend-destination field specifies the system metrics destination.
    # It supports either prometheus (the default) or stackdriver.
    # Note: Using stackdriver will incur additional charges
    metrics.backend-destination: prometheus

    # metrics.request-metrics-backend-destination specifies the request metrics
    # destination. If non-empty, it enables queue proxy to send request metrics.
    # Currently supported values: prometheus, stackdriver.
    metrics.request-metrics-backend-destination: prometheus

    # metrics.stackdriver-project-id field specifies the stackdriver project ID. This
    # field is optional. When running on GCE, application default credentials will be
    # used if this field is not provided.
    metrics.stackdriver-project-id: "<your stackdriver project id>"

    # metrics.allow-stackdriver-custom-metrics indicates whether it is allowed to send metrics to
    # Stackdriver using "global" resource type and custom metric type if the
    # metrics are not supported by "knative_broker", "knative_trigger", and "knative_source" resource types.
    # Setting this flag to "true" could cause extra Stackdriver charge.
    # If metrics.backend-destination is not Stackdriver, this is ignored.
    metrics.allow-stackdriver-custom-metrics: "false"

    # profiling.enable indicates whether it is allowed to retrieve runtime profiling data from
    # the pods via an HTTP server in the format expected by the pprof visualization tool. When
    # enabled, the Knative Eventing pods expose the profiling data on an alternate HTTP port 8008.
    # The HTTP context root for profiling is then /debug/pprof/.
    profiling.enable: "false"

---
# Copyright 2019 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-tracing
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/config-propagation: original
    knative.dev/config-category: eventing
    knative.dev/example-checksum: "9745a8c5"
  annotations:
    knative.dev/example-checksum: 4002b4c2
data:
  _example: |
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################
    # This block is not actually functional configuration,
    # but serves to illustrate the available configuration
    # options and document them in a way that is accessible
    # to users that `kubectl edit` this config map.
    #
    # These sample configuration options may be copied out of
    # this example block and unindented to be in the data block
    # to actually change the configuration.
    #
    # This may be "zipkin" or "stackdriver", the default is "none"
    backend: "none"

    # URL to zipkin collector where traces are sent.
    # This must be specified when backend is "zipkin"
    zipkin-endpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans"

    # The GCP project into which stackdriver metrics will be written
    # when backend is "stackdriver".  If unspecified, the project-id
    # is read from GCP metadata when running on GCP.
    stackdriver-project-id: "my-project"

    # Enable zipkin debug mode. This allows all spans to be sent to the server
    # bypassing sampling.
    debug: "false"

    # Percentage (0-1) of requests to trace
    sample-rate: "0.1"

---
# Copyright 2018 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: apps/v1
kind: Deployment
metadata:
  name: eventing-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/high-availability: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: eventing-controller
  template:
    metadata:
      labels:
        app: eventing-controller
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: eventing-controller
      containers:
      - name: eventing-controller
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/controller@sha256:7fa646456d0a867341b283d59078703fadb4480432d99276a75868997c69db19
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/eventing
        - # PingSource
          name: PING_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/ping@sha256:d1c2b997691805f312e1060fda4369c2314b2d682349c81cfc36ab4b6b9c1303
        - name: MT_PING_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/mtping@sha256:18a322a7e78f97144b3520262d7680293a99b97918bc212c9b93b6c9801b3c11
        - # APIServerSource
          name: APISERVER_RA_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/apiserver_receive_adapter@sha256:55c28fe67479c66f5ddd641a0dcf450b85869b33eadb0ff6743994e8382f5373
        securityContext:
          allowPrivilegeEscalation: false
        ports:
        - name: metrics
          containerPort: 9090
        - name: profiling
          containerPort: 8008

---
# Copyright 2018 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: eventing-webhook
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  replicas: 1
  selector:
    matchLabels: &labels
      app: eventing-webhook
      role: eventing-webhook
  template:
    metadata:
      labels: *labels
    spec:
      serviceAccountName: eventing-webhook
      containers:
      - name: eventing-webhook
        terminationMessagePolicy: FallbackToLogsOnError
        # This is the Go import path for the binary that is containerized
        # and substituted here.
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/webhook@sha256:7d839aff3c564981b534922f5a20ab89ccca58533b56b4c6d0f5246eee4a7497
        resources:
          requests:
            # taken from serving.
            cpu: 20m
            memory: 20Mi
          limits:
            # taken from serving.
            cpu: 200m
            memory: 200Mi
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: METRICS_DOMAIN
          value: knative.dev/eventing
        - name: WEBHOOK_NAME
          value: eventing-webhook
        - name: WEBHOOK_PORT
          value: "8443"
          # SINK_BINDING_SELECTION_MODE specifies the NamespaceSelector and ObjectSelector
          # for the sinkbinding webhook.
          # If `inclusion` is selected, namespaces/objects labled as `bindings.knative.dev/include:true`
          # will be considered by the sinkbinding webhook;
          # If `exclusion` is selected, namespaces/objects labled as `bindings.knative.dev/exclude:true`
          # will NOT be considered by the sinkbinding webhook.
          # The default is `exclusion`.
        - name: SINK_BINDING_SELECTION_MODE
          value: "inclusion"
        securityContext:
          allowPrivilegeEscalation: false
        ports:
        - name: https-webhook
          containerPort: 8443
        - name: metrics
          containerPort: 9090
        - name: profiling
          containerPort: 8008
        readinessProbe: &probe
          periodSeconds: 1
          httpGet:
            scheme: HTTPS
            port: 8443
            httpHeaders:
            - name: k-kubelet-probe
              value: "webhook"
        livenessProbe: *probe
---
apiVersion: v1
kind: Service
metadata:
  labels:
    eventing.knative.dev/release: "v0.16.1"
    role: eventing-webhook
  name: eventing-webhook
  namespace: knative-eventing
spec:
  ports:
  - name: https-webhook
    port: 443
    targetPort: 8443
  selector:
    role: eventing-webhook

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  creationTimestamp: null
  labels:
    eventing.knative.dev/release: "v0.16.1"
    eventing.knative.dev/source: "true"
    duck.knative.dev/source: "true"
    knative.dev/crd-install: "true"
  annotations:
    # TODO add schemas and descriptions
    registry.knative.dev/eventTypes: |
      [
        { "type": "dev.knative.apiserver.resource.add" },
        { "type": "dev.knative.apiserver.resource.delete" },
        { "type": "dev.knative.apiserver.resource.update" },
        { "type": "dev.knative.apiserver.ref.add" },
        { "type": "dev.knative.apiserver.ref.delete" },
        { "type": "dev.knative.apiserver.ref.update" }
      ]
  name: apiserversources.sources.knative.dev
spec:
  group: sources.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: Sink
      type: string
      jsonPath: ".status.sinkUri"
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1alpha2
    served: true
    storage: false
  names:
    categories:
    - all
    - knative
    - eventing
    - sources
    kind: ApiServerSource
    plural: apiserversources
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: brokers.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
    duck.knative.dev/addressable: "true"
spec:
  group: eventing.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: URL
      type: string
      jsonPath: .status.address.url
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
  names:
    kind: Broker
    plural: brokers
    singular: broker
    categories:
    - all
    - knative
    - eventing
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: channels.messaging.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
    messaging.knative.dev/subscribable: "true"
    duck.knative.dev/addressable: "true"
spec:
  group: messaging.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              channelTemplate:
                description: "Channel implementation which dictates the durability
                  guarantees of events. If not specified then the default channel
                  is used. More information: https://knative.dev/docs/eventing/channels/default-channels."
                type: object
                properties:
                  apiVersion:
                    type: string
                    description: "API version of the channel implementation."
                    minLength: 1
                  kind:
                    type: string
                    description: "Kind of the channel implementation to use (InMemoryChannel,
                      KafkaChannel, etc.)."
                    minLength: 1
                  spec:
                    type: object
                    description: "Spec defines the Spec to use for each channel created.
                      Passed in verbatim to the Channel CRD as Spec section."
                required:
                - apiVersion
                - kind
              subscribable:
                type: object
                properties:
                  subscribers:
                    type: array
                    description: "Events received on the channel are forwarded to
                      its subscribers."
                    items:
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                      required:
                      - uid
                      properties:
                        ref:
                          type: object
                          description: "a reference to a Kubernetes object from which
                            to retrieve the target URI."
                          x-kubernetes-preserve-unknown-fields: true
                          required:
                          - namespace
                          - name
                          - uid
                          properties:
                            apiVersion:
                              type: string
                            kind:
                              type: string
                            name:
                              type: string
                              minLength: 1
                            namespace:
                              type: string
                              minLength: 1
                            uid:
                              type: string
                              minLength: 1
                        uid:
                          type: string
                          description: "Used to understand the origin of the subscriber."
                          minLength: 1
                        subscriberURI:
                          type: string
                          description: "Endpoint for the subscriber."
                          minLength: 1
                        replyURI:
                          type: string
                          description: "Endpoint for the reply."
                          minLength: 1
          status:
            type: object
            x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: URL
      type: string
      jsonPath: .status.address.url
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            type: object
            x-kubernetes-preserve-unknown-fields: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            type: object
            x-kubernetes-preserve-unknown-fields: true
  names:
    kind: Channel
    plural: channels
    singular: channel
    categories:
    - all
    - knative
    - messaging
    - channel
    shortNames:
    - ch
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    eventing.knative.dev/release: "v0.16.1"
    eventing.knative.dev/source: "true"
    duck.knative.dev/source: "true"
    knative.dev/crd-install: "true"
  name: containersources.sources.knative.dev
spec:
  group: sources.knative.dev
  versions:
  - &version
    name: v1alpha2
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type=='Ready')].reason"
    - name: Sink
      type: string
      jsonPath: ".status.sinkUri"
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  names:
    categories:
    - all
    - knative
    - eventing
    - sources
    kind: ContainerSource
    plural: containersources
  scope: Namespaced

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: eventtypes.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
spec:
  group: eventing.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Type
      type: string
      jsonPath: ".spec.type"
    - name: Source
      type: string
      jsonPath: ".spec.source"
    - name: Schema
      type: string
      jsonPath: ".spec.schema"
    - name: Broker
      type: string
      jsonPath: ".spec.broker"
    - name: Description
      type: string
      jsonPath: ".spec.description"
    - # TODO remove Status https://github.com/knative/eventing/issues/2750
      name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  names:
    kind: EventType
    plural: eventtypes
    singular: eventtype
    categories:
    - all
    - knative
    - eventing
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: parallels.flows.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
    duck.knative.dev/addressable: "true"
spec:
  group: flows.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: URL
      type: string
      jsonPath: .status.address.url
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
  names:
    kind: Parallel
    plural: parallels
    singular: parallel
    categories:
    - all
    - knative
    - eventing
    - flows
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    eventing.knative.dev/release: "v0.16.1"
    eventing.knative.dev/source: "true"
    duck.knative.dev/source: "true"
    knative.dev/crd-install: "true"
  annotations:
    # TODO add schemas and descriptions
    registry.knative.dev/eventTypes: |
      [
        { "type": "dev.knative.sources.ping" }
      ]
  name: pingsources.sources.knative.dev
spec:
  group: sources.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type=='Ready')].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type=='Ready')].reason"
    - name: Sink
      type: string
      jsonPath: .status.sinkUri
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1alpha2
    served: true
    storage: true
  names:
    categories:
    - all
    - knative
    - eventing
    - sources
    kind: PingSource
    plural: pingsources
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: sequences.flows.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
    duck.knative.dev/addressable: "true"
spec:
  group: flows.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: URL
      type: string
      jsonPath: .status.address.url
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
  names:
    kind: Sequence
    plural: sequences
    singular: sequence
    categories:
    - all
    - knative
    - eventing
    - flows
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    eventing.knative.dev/release: "v0.16.1"
    eventing.knative.dev/source: "true"
    duck.knative.dev/source: "true"
    duck.knative.dev/binding: "true"
    knative.dev/crd-install: "true"
  name: sinkbindings.sources.knative.dev
spec:
  group: sources.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type=='Ready')].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type=='Ready')].reason"
    - name: Sink
      type: string
      jsonPath: ".status.sinkUri"
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1alpha2
    storage: false
  names:
    categories:
    - all
    - knative
    - eventing
    - sources
    - bindings
    kind: SinkBinding
    plural: sinkbindings
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: subscriptions.messaging.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
spec:
  group: messaging.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
  names:
    kind: Subscription
    plural: subscriptions
    singular: subscription
    categories:
    - all
    - knative
    - eventing
    shortNames:
    - sub
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: triggers.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
spec:
  group: eventing.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: Broker
      type: string
      jsonPath: .spec.broker
    - name: Subscriber_URI
      type: string
      jsonPath: .status.subscriberUri
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            required:
            - subscriber
            type: object
            properties:
              broker:
                type: string
                description: "Broker that this trigger receives events from. If not
                  specified, will default to 'default'."
              filter:
                type: object
                properties:
                  attributes:
                    type: object
                    description: "Map of CloudEvents attributes used for filtering
                      events. If not specified, will default to all events"
                    additionalProperties:
                      type: string
              subscriber:
                type: object
                description: "the destination that should receive events."
                properties:
                  ref:
                    type: object
                    description: "a reference to a Kubernetes object from which to
                      retrieve the target URI."
                    required:
                    - apiVersion
                    - kind
                    - name
                    properties:
                      apiVersion:
                        type: string
                        minLength: 1
                      kind:
                        type: string
                        minLength: 1
                      namespace:
                        type: string
                        minLength: 1
                      name:
                        type: string
                        minLength: 1
                  uri:
                    type: string
                    description: "the target URI or, if ref is provided, a relative
                      URI reference that will be combined with ref to produce a target
                      URI."
          status:
            type: object
            x-kubernetes-preserve-unknown-fields: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            required:
            - subscriber
            - broker
            type: object
            properties:
              broker:
                type: string
                description: "Broker that this trigger receives events from."
              filter:
                type: object
                properties:
                  attributes:
                    type: object
                    description: "Map of CloudEvents attributes used for filtering
                      events. If not specified, will default to all events"
                    additionalProperties:
                      type: string
              subscriber:
                type: object
                description: "the destination that should receive events."
                properties:
                  ref:
                    type: object
                    description: "a reference to a Kubernetes object from which to
                      retrieve the target URI."
                    required:
                    - apiVersion
                    - kind
                    - name
                    properties:
                      apiVersion:
                        type: string
                        minLength: 1
                      kind:
                        type: string
                        minLength: 1
                      namespace:
                        type: string
                        minLength: 1
                      name:
                        type: string
                        minLength: 1
                  uri:
                    type: string
                    description: "the target URI or, if ref is provided, a relative
                      URI reference that will be combined with ref to produce a target
                      URI."
          status:
            type: object
            x-kubernetes-preserve-unknown-fields: true
  names:
    kind: Trigger
    plural: triggers
    singular: trigger
    categories:
    - all
    - knative
    - eventing
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# Copyright 2019 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.

# Use this aggregated ClusterRole when you need readonly access to "Addressables"
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
      duck.knative.dev/addressable: "true"
rules: [] # Rules are automatically filled in by the controller manager.
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: service-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - get
  - list
  - watch
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: serving-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - serving.knative.dev
  resources:
  - routes
  - routes/status
  - services
  - services/status
  verbs:
  - get
  - list
  - watch
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: channel-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - channels
  - channels/status
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - messaging.knative.dev
  resources:
  - channels/finalizers
  verbs:
  - update
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: broker-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - eventing.knative.dev
  resources:
  - brokers
  - brokers/status
  verbs:
  - get
  - list
  - watch
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: messaging-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - sequences
  - sequences/status
  - parallels
  - parallels/status
  verbs:
  - get
  - list
  - watch
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: flows-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - flows.knative.dev
  resources:
  - sequences
  - sequences/status
  - parallels
  - parallels/status
  verbs:
  - get
  - list
  - watch

---
# Copyright 2019 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: eventing-broker-filter
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - "get"
  - "list"
  - "watch"
- apiGroups:
  - "eventing.knative.dev"
  resources:
  - "triggers"
  - "triggers/status"
  verbs:
  - "get"
  - "list"
  - "watch"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: eventing-broker-ingress
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - "get"
  - "list"
  - "watch"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: eventing-config-reader
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - "get"
  - "list"
  - "watch"

---
# Copyright 2019 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.

# Use this aggregated ClusterRole when you need read and update permissions on "Channelables".
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: channelable-manipulator
  labels:
    eventing.knative.dev/release: "v0.16.1"
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
      duck.knative.dev/channelable: "true"
rules: [] # Rules are automatically filled in by the controller manager.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: meta-channelable-manipulator
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/channelable: "true"
# Do not use this role directly. These rules will be added to the "channelable-manipulator" role.
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - channels
  - channels/status
  verbs:
  - create
  - get
  - list
  - watch
  - update
  - patch

---
# Copyright 2019 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.

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-admin
  labels:
    eventing.knative.dev/release: "v0.16.1"
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["eventing.knative.dev"]
  resources: ["*"]
  verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-messaging-namespaced-admin
  labels:
    eventing.knative.dev/release: "v0.16.1"
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["messaging.knative.dev"]
  resources: ["*"]
  verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-flows-namespaced-admin
  labels:
    eventing.knative.dev/release: "v0.16.1"
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["flows.knative.dev"]
  resources: ["*"]
  verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-sources-namespaced-admin
  labels:
    eventing.knative.dev/release: "v0.16.1"
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["sources.knative.dev"]
  resources: ["*"]
  verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-bindings-namespaced-admin
  labels:
    eventing.knative.dev/release: "v0.16.1"
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["bindings.knative.dev"]
  resources: ["*"]
  verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-edit
  labels:
    rbac.authorization.k8s.io/aggregate-to-edit: "true"
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.knative.dev", "flows.knative.dev", "bindings.knative.dev"]
  resources: ["*"]
  verbs: ["create", "update", "patch", "delete"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-view
  labels:
    rbac.authorization.k8s.io/aggregate-to-view: "true"
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.knative.dev", "flows.knative.dev", "bindings.knative.dev"]
  resources: ["*"]
  verbs: ["get", "list", "watch"]

---
# Copyright 2019 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-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "namespaces"
  - "secrets"
  - "configmaps"
  - "services"
  - "endpoints"
  - "events"
  - "serviceaccounts"
  verbs: &everything
  - "get"
  - "list"
  - "create"
  - "update"
  - "delete"
  - "patch"
  - "watch"
- # Brokers and the namespace annotation controllers manipulate Deployments.
  apiGroups:
  - "apps"
  resources:
  - "deployments"
  verbs: *everything
- # PingSource controller manipulates Deployment owner reference
  apiGroups:
  - "apps"
  resources:
  - "deployments/finalizers"
  verbs:
  - "update"
- # The namespace annotation controller needs to manipulate RoleBindings.
  apiGroups:
  - "rbac.authorization.k8s.io"
  resources:
  - "rolebindings"
  verbs: *everything
- # Our own resources and statuses we care about.
  apiGroups:
  - "eventing.knative.dev"
  resources:
  - "brokers"
  - "brokers/status"
  - "triggers"
  - "triggers/status"
  - "eventtypes"
  - "eventtypes/status"
  verbs: *everything
- # Eventing resources and finalizers we care about.
  apiGroups:
  - "eventing.knative.dev"
  resources:
  - "brokers/finalizers"
  - "triggers/finalizers"
  verbs:
  - "update"
- # Our own resources and statuses we care about.
  apiGroups:
  - "messaging.knative.dev"
  resources:
  - "sequences"
  - "sequences/status"
  - "channels"
  - "channels/status"
  - "parallels"
  - "parallels/status"
  - "subscriptions"
  - "subscriptions/status"
  verbs: *everything
- # Flow resources and statuses we care about.
  apiGroups:
  - "flows.knative.dev"
  resources:
  - "sequences"
  - "sequences/status"
  - "parallels"
  - "parallels/status"
  verbs: *everything
- # Messaging resources and finalizers we care about.
  apiGroups:
  - "messaging.knative.dev"
  resources:
  - "sequences/finalizers"
  - "parallels/finalizers"
  - "channels/finalizers"
  verbs:
  - "update"
- # Flows resources and finalizers we care about.
  apiGroups:
  - "flows.knative.dev"
  resources:
  - "sequences/finalizers"
  - "parallels/finalizers"
  verbs:
  - "update"
- # The subscription controller needs to retrieve and watch CustomResourceDefinitions.
  apiGroups:
  - "apiextensions.k8s.io"
  resources:
  - "customresourcedefinitions"
  verbs:
  - "get"
  - "list"
  - "watch"

---
# 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-pingsource-adapter
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules: []

---
# 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-pingsource-mt-adapter
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - "get"
  - "list"
  - "watch"
- apiGroups:
  - sources.knative.dev
  resources:
  - pingsources
  - pingsources/status
  verbs:
  - get
  - list
  - watch
  - patch
- apiGroups:
  - sources.knative.dev
  resources:
  - pingsources/finalizers
  verbs:
  - "patch"
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - "create"
  - "patch"
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch

---
# Copyright 2019 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.

# Use this aggregated ClusterRole when you need readonly access to "Addressables"
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: podspecable-binding
  labels:
    eventing.knative.dev/release: "v0.16.1"
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
      duck.knative.dev/podspecable: "true"
rules: [] # Rules are automatically filled in by the controller manager.
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: builtin-podspecable-binding
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/podspecable: "true"
# Do not use this role directly. These rules will be added to the "podspecable-binding role.
rules:
- # To patch the subjects of our bindings
  apiGroups:
  - "apps"
  resources:
  - "deployments"
  - "daemonsets"
  - "statefulsets"
  - "replicasets"
  verbs:
  - "list"
  - "watch"
  - "patch"
- apiGroups:
  - "batch"
  resources:
  - "jobs"
  verbs:
  - "list"
  - "watch"
  - "patch"

---
# Copyright 2019 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.

# Use this aggregated ClusterRole when you need to read "Sources".
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: source-observer
  labels:
    eventing.knative.dev/release: "v0.16.1"
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
      duck.knative.dev/source: "true"
rules: [] # Rules are automatically filled in by the controller manager.
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: eventing-sources-source-observer
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/source: "true"
# Do not use this role directly. These rules will be added to the "source-observer" role.
rules:
- apiGroups:
  - sources.knative.dev
  resources:
  - apiserversources
  - pingsources
  - sinkbindings
  - containersources
  verbs:
  - get
  - list
  - watch

---
# Copyright 2019 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-sources-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "secrets"
  - "configmaps"
  - "services"
  verbs: &everything
  - "get"
  - "list"
  - "create"
  - "update"
  - "delete"
  - "patch"
  - "watch"
- # Deployments admin
  apiGroups:
  - "apps"
  resources:
  - "deployments"
  verbs: *everything
- # Source resources and statuses we care about.
  apiGroups:
  - "sources.knative.dev"
  resources:
  - "sinkbindings"
  - "sinkbindings/status"
  - "sinkbindings/finalizers"
  - "apiserversources"
  - "apiserversources/status"
  - "apiserversources/finalizers"
  - "pingsources"
  - "pingsources/status"
  - "pingsources/finalizers"
  - "containersources"
  - "containersources/status"
  - "containersources/finalizers"
  verbs: *everything
- # Knative Services admin
  apiGroups:
  - serving.knative.dev
  resources:
  - services
  verbs: *everything
- # EventTypes admin
  apiGroups:
  - eventing.knative.dev
  resources:
  - eventtypes
  verbs: *everything
- # Events admin
  apiGroups:
  - ""
  resources:
  - events
  verbs: *everything
- # Authorization checker
  apiGroups:
  - authorization.k8s.io
  resources:
  - subjectaccessreviews
  verbs:
  - create

---
# Copyright 2019 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-webhook
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- # For watching logging configuration and getting certs.
  apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - "get"
  - "list"
  - "watch"
- # For manipulating certs into secrets.
  apiGroups:
  - ""
  resources:
  - "secrets"
  - "namespaces"
  verbs:
  - "get"
  - "create"
  - "update"
  - "list"
  - "watch"
  - "patch"
- # For getting our Deployment so we can decorate with ownerref.
  apiGroups:
  - "apps"
  resources:
  - "deployments"
  verbs:
  - "get"
- apiGroups:
  - "apps"
  resources:
  - "deployments/finalizers"
  verbs:
  - update
- # For actually registering our webhook.
  apiGroups:
  - "admissionregistration.k8s.io"
  resources:
  - "mutatingwebhookconfigurations"
  - "validatingwebhookconfigurations"
  verbs: &everything
  - "get"
  - "list"
  - "create"
  - "update"
  - "delete"
  - "patch"
  - "watch"
- # For running the SinkBinding reconciler.
  apiGroups:
  - "sources.knative.dev"
  resources:
  - "sinkbindings"
  - "sinkbindings/status"
  - "sinkbindings/finalizers"
  verbs: *everything
- # Necessary for conversion webhook. These are copied from the serving
  # TODO: Do we really need all these permissions?
  apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]

---
# Copyright 2018 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.

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: config.webhook.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
webhooks:
- admissionReviewVersions: ["v1", "v1beta1"]
  clientConfig:
    service:
      name: eventing-webhook
      namespace: knative-eventing
  sideEffects: None
  failurePolicy: Fail
  name: config.webhook.eventing.knative.dev
  namespaceSelector:
    matchExpressions:
    - key: eventing.knative.dev/release
      operator: Exists
  timeoutSeconds: 2

---
# Copyright 2018 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.

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: webhook.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
webhooks:
- admissionReviewVersions: ["v1", "v1beta1"]
  clientConfig:
    service:
      name: eventing-webhook
      namespace: knative-eventing
  sideEffects: None
  failurePolicy: Fail
  name: webhook.eventing.knative.dev
  timeoutSeconds: 2

---
# Copyright 2018 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.

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: validation.webhook.eventing.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
webhooks:
- admissionReviewVersions: ["v1", "v1beta1"]
  clientConfig:
    service:
      name: eventing-webhook
      namespace: knative-eventing
  sideEffects: None
  failurePolicy: Fail
  name: validation.webhook.eventing.knative.dev
  timeoutSeconds: 2

---
# Copyright 2018 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.

apiVersion: v1
kind: Secret
metadata:
  name: eventing-webhook-certs
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
# The data is populated at install time.

---
# Copyright 2018 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.

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: sinkbindings.webhook.sources.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
webhooks:
- admissionReviewVersions: ["v1", "v1beta1"]
  clientConfig:
    service:
      name: eventing-webhook
      namespace: knative-eventing
  failurePolicy: Fail
  sideEffects: None
  name: sinkbindings.webhook.sources.knative.dev
  timeoutSeconds: 2

---
---
# deprecated-channel-broker.yaml
# Copyright 2018 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: apps/v1
kind: Deployment
metadata:
  name: broker-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/high-availability: "true"
spec:
  replicas: 0
  selector:
    matchLabels:
      app: broker-controller
  template:
    metadata:
      labels:
        app: broker-controller
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: eventing-controller
      containers:
      - name: broker-controller
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/channel_broker@sha256:7d3ae9a7139a846490869e58d9f4ddbe31b8a60df306c3636962609fbcca523d
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/eventing
        - # Broker
          name: BROKER_INGRESS_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/broker/ingress@sha256:a7a9dba94024ba961604f08be1bc49eddb40941dee4f291ed609149d899e7afa
        - name: BROKER_INGRESS_SERVICE_ACCOUNT
          value: eventing-broker-ingress
        - name: BROKER_FILTER_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/broker/filter@sha256:fa50a25fd2db5ab09cc604d2b3d4ad36da3687882352c68ca11cb273e65111f7
        - name: BROKER_FILTER_SERVICE_ACCOUNT
          value: eventing-broker-filter
        - name: BROKER_IMAGE_PULL_SECRET_NAME
          value:
        securityContext:
          allowPrivilegeEscalation: false
        ports:
        - name: metrics
          containerPort: 9090
        - name: profiling
          containerPort: 8008

---
---
# mt-channel-broker.yaml
# 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: "v0.16.1"
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"

---
# 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-broker-filter
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - eventing.knative.dev
  resources:
  - triggers
  - triggers/status
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - get
  - list
  - watch

---
# 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: v1
kind: ServiceAccount
metadata:
  name: mt-broker-filter
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"

---
# 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-broker-ingress
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - ""
  resources:
  - "configmaps"
  verbs:
  - get
  - list
  - watch

---
# 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: v1
kind: ServiceAccount
metadata:
  name: mt-broker-ingress
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"

---
# 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: ClusterRoleBinding
metadata:
  name: eventing-mt-channel-broker-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: eventing-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-mt-channel-broker-controller
  apiGroup: rbac.authorization.k8s.io

---
# 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: ClusterRoleBinding
metadata:
  name: knative-eventing-mt-broker-filter
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: mt-broker-filter
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-mt-broker-filter
  apiGroup: rbac.authorization.k8s.io

---
# 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: ClusterRoleBinding
metadata:
  name: knative-eventing-mt-broker-ingress
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: mt-broker-ingress
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: knative-eventing-mt-broker-ingress
  apiGroup: rbac.authorization.k8s.io

---
# 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.

# This one is a placeholder to bring the replicas down to zero.
# Remove this after .16 ships.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: broker-filter
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  replicas: 0
  selector:
    matchLabels:
      eventing.knative.dev/brokerRole: filter
  template:
    metadata:
      labels:
        eventing.knative.dev/brokerRole: filter
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: mt-broker-filter
      containers:
      - name: filter
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtbroker/filter@sha256:d2422d39e463c99cd21af3c51ee2947613e2418f88a8403ed4af52d9864e5fa1
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 9092
          name: metrics
          protocol: TCP
        terminationMessagePath: /dev/termination-log
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CONTAINER_NAME
          value: filter
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/internal/eventing
        - name: FILTER_PORT
          value: "8080"
        securityContext:
          allowPrivilegeEscalation: false
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mt-broker-filter
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  selector:
    matchLabels:
      eventing.knative.dev/brokerRole: filter
  template:
    metadata:
      labels:
        eventing.knative.dev/brokerRole: filter
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: mt-broker-filter
      containers:
      - name: filter
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtbroker/filter@sha256:d2422d39e463c99cd21af3c51ee2947613e2418f88a8403ed4af52d9864e5fa1
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 9090
          name: metrics
          protocol: TCP
        terminationMessagePath: /dev/termination-log
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CONTAINER_NAME
          value: filter
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/internal/eventing
        - name: FILTER_PORT
          value: "8080"
        securityContext:
          allowPrivilegeEscalation: false
---
apiVersion: v1
kind: Service
metadata:
  labels:
    eventing.knative.dev/brokerRole: filter
    eventing.knative.dev/release: "v0.16.1"
  name: broker-filter
  namespace: knative-eventing
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 8080
  - name: http-metrics
    port: 9092
    protocol: TCP
    targetPort: 9092
  selector:
    eventing.knative.dev/brokerRole: filter

---
# 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.

# This one is a placeholder to bring the replicas down to zero.
# Remove this after .16 ships.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: broker-ingress
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  replicas: 0
  selector:
    matchLabels:
      eventing.knative.dev/brokerRole: ingress
  template:
    metadata:
      labels:
        eventing.knative.dev/brokerRole: ingress
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: mt-broker-ingress
      containers:
      - name: ingress
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtbroker/ingress@sha256:cb240de03ef3a63ce1a67d56c4ac6f06a50dfa90f2f0d50416366770c2ffcd2d
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 9092
          name: metrics
          protocol: TCP
        terminationMessagePath: /dev/termination-log
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CONTAINER_NAME
          value: ingress
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/internal/eventing
        - name: INGRESS_PORT
          value: "8080"
        securityContext:
          allowPrivilegeEscalation: false
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mt-broker-ingress
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  selector:
    matchLabels:
      eventing.knative.dev/brokerRole: ingress
  template:
    metadata:
      labels:
        eventing.knative.dev/brokerRole: ingress
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: mt-broker-ingress
      containers:
      - name: ingress
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtbroker/ingress@sha256:cb240de03ef3a63ce1a67d56c4ac6f06a50dfa90f2f0d50416366770c2ffcd2d
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 9090
          name: metrics
          protocol: TCP
        terminationMessagePath: /dev/termination-log
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CONTAINER_NAME
          value: ingress
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/internal/eventing
        - name: INGRESS_PORT
          value: "8080"
        securityContext:
          allowPrivilegeEscalation: false
---
apiVersion: v1
kind: Service
metadata:
  labels:
    eventing.knative.dev/brokerRole: ingress
    eventing.knative.dev/release: "v0.16.1"
  name: broker-ingress
  namespace: knative-eventing
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 8080
  - name: http-metrics
    port: 9092
    protocol: TCP
    targetPort: 9092
  selector:
    eventing.knative.dev/brokerRole: ingress

---
# 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: apps/v1
kind: Deployment
metadata:
  name: mt-broker-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mt-broker-controller
  template:
    metadata:
      labels:
        app: mt-broker-controller
        eventing.knative.dev/release: "v0.16.1"
    spec:
      serviceAccountName: eventing-controller
      containers:
      - name: mt-broker-controller
        terminationMessagePolicy: FallbackToLogsOnError
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtchannel_broker@sha256:57e85e39f38f20fd96ecef7a326797e074a5bc4fc4a60f5086b9dab771b9eebf
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/eventing
        - # Due to the trivial per-Broker cost, we _can_ inject Brokers into every
          # namespace by default. To change this default simply change this
          # to "true".  To opt namespaces out of Broker injection, label
          # them with:
          #    knative-eventing-injection: disabled
          name: BROKER_INJECTION_DEFAULT
          value: "false"
        securityContext:
          allowPrivilegeEscalation: false
        ports:
        - name: metrics
          containerPort: 9090
        - name: profiling
          containerPort: 8008

---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: broker-ingress-hpa
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mt-broker-ingress
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70
---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: broker-filter-hpa
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mt-broker-filter
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70

---
---
# in-memory-channel.yaml
# 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.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-imc-event-dispatcher
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
data:
  MaxIdleConnections: "1000"
  MaxIdleConnectionsPerHost: "100"

---
# Copyright 2019 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: imc-addressable-resolver
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels
  - inmemorychannels/status
  verbs:
  - get
  - list
  - watch

---
# Copyright 2019 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: imc-channelable-manipulator
  labels:
    eventing.knative.dev/release: "v0.16.1"
    duck.knative.dev/channelable: "true"
# Do not use this role directly. These rules will be added to the "channelable-manipulator" role.
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels
  - inmemorychannels/status
  verbs:
  - create
  - get
  - list
  - watch
  - update
  - patch

---
# Copyright 2019 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: imc-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels
  - inmemorychannels/status
  verbs:
  - get
  - list
  - watch
  - update
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels/finalizers
  verbs:
  - update
- apiGroups:
  - ""
  resources:
  - services
  - serviceaccounts
  verbs: &everything
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - endpoints
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - "rbac.authorization.k8s.io"
  resources:
  - rolebindings
  verbs: *everything
- apiGroups:
  - apps
  resources:
  - deployments
  verbs: *everything
- apiGroups:
  - apps
  resources:
  - deployments/status
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs: *everything

---
# Copyright 2019 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: imc-dispatcher
  labels:
    eventing.knative.dev/release: "v0.16.1"
rules:
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels
  - inmemorychannels/status
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - "" # Core API group.
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
  # Updates the status to reflect subscribable status.
- apiGroups:
  - messaging.knative.dev
  resources:
  - inmemorychannels/status
  verbs:
  - update
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch

---
# Copyright 2019 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: v1
kind: Service
metadata:
  name: imc-dispatcher
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    messaging.knative.dev/channel: in-memory-channel
    messaging.knative.dev/role: dispatcher
spec:
  selector:
    messaging.knative.dev/channel: in-memory-channel
    messaging.knative.dev/role: dispatcher
  ports:
  - name: http-dispatcher
    port: 80
    protocol: TCP
    targetPort: 8080

---
# 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: v1
kind: ServiceAccount
metadata:
  name: imc-dispatcher
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"

---
# Copyright 2019 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: v1
kind: ServiceAccount
metadata:
  name: imc-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"

---
# Copyright 2019 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: ClusterRoleBinding
metadata:
  name: imc-controller
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: imc-controller
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: imc-controller
  apiGroup: rbac.authorization.k8s.io

---
# 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: ClusterRoleBinding
metadata:
  name: imc-dispatcher
  labels:
    eventing.knative.dev/release: "v0.16.1"
subjects:
- kind: ServiceAccount
  name: imc-dispatcher
  namespace: knative-eventing
roleRef:
  kind: ClusterRole
  name: imc-dispatcher
  apiGroup: rbac.authorization.k8s.io

---
# Copyright 2019 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: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: inmemorychannels.messaging.knative.dev
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/crd-install: "true"
    messaging.knative.dev/subscribable: "true"
    duck.knative.dev/addressable: "true"
spec:
  group: messaging.knative.dev
  versions:
  - &version
    name: v1alpha1
    served: false
    storage: false
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        # this is a work around so we don't need to flush out the
        # schema for each version at this time
        #
        # see issue: https://github.com/knative/serving/issues/912
        x-kubernetes-preserve-unknown-fields: true
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
    - name: Reason
      type: string
      jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
    - name: URL
      type: string
      jsonPath: .status.address.url
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  - !!merge <<: *version
    name: v1beta1
    served: true
    storage: true
  - !!merge <<: *version
    name: v1
    served: true
    storage: false
  names:
    kind: InMemoryChannel
    plural: inmemorychannels
    singular: inmemorychannel
    categories:
    - all
    - knative
    - messaging
    - channel
    shortNames:
    - imc
  scope: Namespaced
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1", "v1beta1"]
      clientConfig:
        service:
          name: eventing-webhook
          namespace: knative-eventing

---
# Copyright 2019 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: apps/v1
kind: Deployment
metadata:
  name: imc-controller
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/high-availability: "true"
spec:
  replicas: 1
  selector:
    matchLabels: &labels
      messaging.knative.dev/channel: in-memory-channel
      messaging.knative.dev/role: controller
  template:
    metadata:
      labels: *labels
    spec:
      serviceAccountName: imc-controller
      containers:
      - name: controller
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/in_memory/channel_controller@sha256:3d63a5cf636128837c2f028768271c1fd2359ba353325b64d0d19953cb69ea1f
        env:
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/inmemorychannel-controller
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: DISPATCHER_IMAGE
          value: gcr.io/knative-releases/knative.dev/eventing/cmd/in_memory/channel_dispatcher@sha256:2f3cbaf9ab610de8e937ecd0801c67b5f51f51f8480bd4291a823203bea64c1e
        securityContext:
          allowPrivilegeEscalation: false
        ports:
        - name: metrics
          containerPort: 9090
        - name: profiling
          containerPort: 8008

---
# Copyright 2019 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: apps/v1
kind: Deployment
metadata:
  name: imc-dispatcher
  namespace: knative-eventing
  labels:
    eventing.knative.dev/release: "v0.16.1"
    knative.dev/high-availability: "true"
spec:
  replicas: 1
  selector:
    matchLabels: &labels
      messaging.knative.dev/channel: in-memory-channel
      messaging.knative.dev/role: dispatcher
  template:
    metadata:
      labels: *labels
    spec:
      serviceAccountName: imc-dispatcher
      containers:
      - name: dispatcher
        image: gcr.io/knative-releases/knative.dev/eventing/cmd/in_memory/channel_dispatcher@sha256:2f3cbaf9ab610de8e937ecd0801c67b5f51f51f8480bd4291a823203bea64c1e
        env:
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: knative.dev/inmemorychannel-dispatcher
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        ports:
        - containerPort: 9090
          name: metrics

---
