Skip to content

Commit

Permalink
eventing-controller helm chart (kyma-project#9750)
Browse files Browse the repository at this point in the history
* initial draft

* add controller chart

* change controller 'name' in cluster to avoid name collision with
knative-eventing resources

* Reverting back the change in Dockerfile as it is done in components PR

* Update Helm charts for eventing

* Fixed RBAC

* Fixed RBAC

* Fixed CRD spec

* Bump images and change imagepullpolicy

* Fix as per PR review

* Fix as per PR review

* Clean up

* Clean up

* Changed based on the PR review comments

* Fix governance job

* Update resources/eventing/README.md

Co-authored-by: Aleksandra Simeonova <[email protected]>

* Update resources/eventing/README.md

Co-authored-by: Aleksandra Simeonova <[email protected]>

* Add eventing chart in installation CR

* Fix merge conflicts

* Bumped image and added fixes as per PR review

Co-authored-by: Sayan Hazra <[email protected]>
Co-authored-by: Sayan Hazra <[email protected]>
Co-authored-by: Aleksandra Simeonova <[email protected]>
  • Loading branch information
4 people authored Nov 20, 2020
1 parent d874a36 commit 7f0ffaf
Show file tree
Hide file tree
Showing 23 changed files with 599 additions and 52 deletions.
2 changes: 2 additions & 0 deletions installation/resources/installer-cr-cluster-runtime.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
namespace: "kyma-system"
- name: "helm-broker"
namespace: "kyma-system"
# - name: "eventing"
# namespace: kyma-system
- name: "nats-streaming"
namespace: "natss"
- name: "core"
Expand Down
8 changes: 4 additions & 4 deletions installation/resources/installer-cr-cluster.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ spec:
namespace: "istio-system"
- name: "xip-patch"
namespace: "kyma-installer"
# - name: "eventing"
# namespace: kyma-system
- name: "knative-eventing"
namespace: "knative-eventing"
# - name: "knative-eventing-kafka"
# namespace: knative-eventing
# namespace: knative-eventing
- name: "dex"
namespace: "kyma-system"
- name: "ory"
namespace: "kyma-system"
- name: "api-gateway"
namespace: "kyma-system"
namespace: "kyma-system"
- name: "rafter"
namespace: "kyma-system"
- name: "service-catalog"
Expand All @@ -39,6 +37,8 @@ spec:
namespace: "kyma-system"
- name: "helm-broker"
namespace: "kyma-system"
# - name: "eventing"
# namespace: kyma-system
- name: "nats-streaming"
namespace: "natss"
- name: "core"
Expand Down
2 changes: 2 additions & 0 deletions installation/resources/installer-cr.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
namespace: "kyma-system"
- name: "helm-broker"
namespace: "kyma-system"
# - name: "eventing"
# namespace: kyma-system
- name: "nats-streaming"
namespace: "natss"
- name: "core"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: subscriptions.eventing.kyma-project.io
spec:
group: eventing.kyma-project.io
names:
kind: Subscription
listKind: SubscriptionList
plural: subscriptions
singular: subscription
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Subscription is the Schema for the subscriptions API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: SubscriptionSpec defines the desired state of Subscription
properties:
filter:
description: BebFilters defines the list of BEB filters
properties:
dialect:
type: string
filters:
items:
description: BebFilter defines the BEB filter element as a combination
of two CE filter elements
properties:
eventSource:
description: Filter defines the CE filter element
properties:
property:
type: string
type:
type: string
value:
type: string
required:
- property
- value
type: object
eventType:
description: Filter defines the CE filter element
properties:
property:
type: string
type:
type: string
value:
type: string
required:
- property
- value
type: object
required:
- eventSource
- eventType
type: object
type: array
required:
- filters
type: object
id:
description: ID is the unique identifier of Subscription, read-only.
type: string
protocol:
type: string
protocolsettings:
description: ProtocolSettings defines the CE protocol setting specification
implementation
properties:
contentMode:
type: string
exemptHandshake:
type: boolean
qos:
type: string
webhookAuth:
description: Webhook defines the Webhook called by an active subscription
in BEB
properties:
clientId:
type: string
clientSecret:
type: string
grantType:
type: string
scope:
items:
type: string
type: array
tokenUrl:
type: string
type:
type: string
required:
- clientId
- clientSecret
- grantType
- tokenUrl
type: object
type: object
sink:
type: string
required:
- filter
- protocol
- protocolsettings
- sink
type: object
status:
description: SubscriptionStatus defines the observed state of Subscription
properties:
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
required:
- status
type: object
type: array
emsSubscriptionStatus:
properties:
lastFailedDelivery:
type: string
lastFailedDeliveryReason:
type: string
lastSuccessfulDelivery:
type: string
subscriptionStatus:
type: string
subscriptionStatusReason:
type: string
type: object
emshash:
format: int64
type: integer
ev2hash:
format: int64
type: integer
failedActivation:
type: string
ready:
type: boolean
externalSink:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 1 addition & 1 deletion resources/eventing/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: eventing
description: Kyma Component 'eventing'
version: 1.0.0
version: 0.1.0
home: https://kyma-project.io
icon: https://github.com/kyma-project/kyma/blob/master/logo.png?raw=true
37 changes: 24 additions & 13 deletions resources/eventing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,36 @@ This Helm chart contains all components required for eventing in Kyma:

Components:
- event-publisher-proxy
- controller

## Event Publisher Proxy

This component receives Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. Click [here](https://github.com/kyma-project/kyma/tree/master/components/event-publisher-proxy) for more details.
This component receives Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. Click [here](../../components/event-publisher-proxy) for more details.

## Install
## Controller

This component manages the internal infrastructure in order to receive an event for all subscriptions.

## Installation

You can install this Helm chart using either Helm or Kyma CLI. In both cases, the secret details for BEB have to be configured using the `beb` prefixed variables:

### Using Helm 3:


```bash
# Install subscriptions.eventing.kyma-project.io CRD
kubectl apply -f resources/cluster-essentials/files/subscriptions.eventing.kyma-project.io.crd.yaml

# Set values for chart
$ cat << EOF > helm-values.yaml
event-publisher-proxy:
upstreamAuthentication:
oauthClientId: "$bebOauthClientId"
oauthClientSecret: "$bebOauthClientSecret"
oauthTokenEndpoint: "$bebOauthTokenEndpoint"
publishUrl: "$bebPublishUrl"
global:
domainName: "$domainName"
authentication:
oauthClientId: "$bebOauthClientId"
oauthClientSecret: "$bebOauthClientSecret"
oauthTokenEndpoint: "$bebOauthTokenEndpoint"
publishUrl: "$bebPublishUrl"
EOF

$ helm install \
Expand All @@ -39,17 +50,17 @@ apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: eventing-epp-overrides
name: eventing-beb-auth-overrides
namespace: kyma-installer
labels:
installer: overrides
component: eventing
kyma-project.io/installation: ""
stringData:
event-publisher-proxy.upstreamAuthentication.oauthClientId: "$bebOauthClientId"
event-publisher-proxy.upstreamAuthentication.oauthClientSecret: "$bebOauthClientSecret"
event-publisher-proxy.upstreamAuthentication.oauthTokenEndpoint: "$bebOauthTokenEndpoint"
event-publisher-proxy.upstreamAuthentication.publishUrl: "$bebPublishUrl"
authentication.oauthClientId: "$bebOauthClientId"
authentication.oauthClientSecret: "$bebOauthClientSecret"
authentication.oauthTokenEndpoint: "$bebOauthTokenEndpoint"
authentication.publishUrl: "$bebPublishUrl"
EOF

$ kyma install -s <source-image> -o installation-overrides-epp.yaml
Expand Down
23 changes: 23 additions & 0 deletions resources/eventing/charts/controller/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions resources/eventing/charts/controller/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: controller
description: A Helm chart for eventing-controller
type: application
version: 0.1.0
51 changes: 51 additions & 0 deletions resources/eventing/charts/controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "controller.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "controller.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "controller.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "controller.labels" -}}
helm.sh/chart: {{ include "controller.chart" . }}
{{ include "controller.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "controller.selectorLabels" -}}
app.kubernetes.io/name: {{ include "controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Loading

0 comments on commit 7f0ffaf

Please sign in to comment.