Repository: knative-sandbox/eventing-kafka-broker (go)

Issue:
Release cert-manager certificates in eventing-kafka-tls-networking
**Problem**

In https://github.com/knative-sandbox/eventing-kafka-broker/commit/9e322471ca6ae985fe68380b4609f97f055ca456, we added server certificates Cert-manager resources.

We need to create an artifact (maybe `eventing-kafka-tls-networking.yaml`) that will be released in our release assets (done by script https://github.com/knative-sandbox/eventing-kafka-broker/blob/main/hack/release.sh).

In addition to be released, we need to install Cert-manager with `kubectl apply -f third_party/cert-manager` and apply the new file `eventing-kafka-tls-networking.yaml` during development as part of `hack/run.sh deploy` (before installing our components) https://github.com/knative-sandbox/eventing-kafka-broker/blob/34946a83f98dfab53c81618814e3c4107858148c/test/e2e-common.sh#L207-L228)

**[Persona:](https://github.com/knative/eventing/blob/master/docs/personas.md)** 
Which persona is this feature for?
System operator, Contributor

**Exit Criteria**
- `hack/run.sh deploy` creates a file `eventing-kafka-tls-networking.yaml` in the root of the repository and applies it
- `hack/release.sh` publishes `eventing-kafka-tls-networking.yaml`

**Time Estimate (optional):** 
How many developer-days do you think this may take to resolve?
1

**Additional context (optional)**

- This is similar to https://github.com/knative/eventing/commit/825a2b595b0ce93026b4bed94526759a17bf2fa2
- https://github.com/knative-sandbox/eventing-kafka-broker/blob/34946a83f98dfab53c81618814e3c4107858148c/hack/release.sh#L70-L84
- https://github.com/knative-sandbox/eventing-kafka-broker/blob/34946a83f98dfab53c81618814e3c4107858148c/test/e2e-common.sh#L207-L228


Pull request:
Update scripts to deploy/release cert manager resources
Fixes #3155 

<!-- Please include the 'why' behind your changes if no issue exists -->

## Proposed Changes

- Update `hack/data-plane.sh` to create cert-manager yaml file
- Update `hack/release.sh` to publish the `eventing-kafka-tls-networking.yaml` file
- Update the `hack/run.sh deploy` to deploy the certificates.

<!--
If this change has user-visible impact, follow the instructions below.
Examples include:

- :gift: Add new feature
- :bug: Fix bug
- :broom: Update or clean up current behavior
- :wastebasket: Remove feature or internal logic

Otherwise delete the rest of this template.
-->

**Release Note**

<!--
:page_facing_up: If this change has user-visible impact, write a release note in the block
below. Include the string "action required" if additional action is required of
users switching to the new release, for example in case of a breaking change.

Write as if you are speaking to users, not other Knative contributors. If this
change has no user-visible impact, no release-note is needed.
-->

```release-note
TLS Cert-Manger resources are now included in KNative Eventing Releases.
```

**Docs**

<!--
:book: If this change has user-visible impact, link to an issue or PR in
https://github.com/knative/docs.
-->
https://github.com/knative/docs/issues/5606


Patch:
diff --git a/.gitignore b/.gitignore
index cceff0830..2d4d7d9de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,5 @@ data-plane/**/build/
 /eventing-kafka-sink-prometheus-operator.yaml
 
 /eventing-kafka-source-bundle.yaml
+
+/eventing-kafka-tls-networking.yaml
diff --git a/control-plane/config/eventing-kafka-broker/200-controller/100-config-kafka-features.yaml b/control-plane/config/eventing-kafka-broker/200-controller/100-config-kafka-features.yaml
index 7a260ab78..df8780a26 100644
--- a/control-plane/config/eventing-kafka-broker/200-controller/100-config-kafka-features.yaml
+++ b/control-plane/config/eventing-kafka-broker/200-controller/100-config-kafka-features.yaml
@@ -4,7 +4,7 @@ metadata:
   name: config-kafka-features
   namespace: knative-eventing
   annotations:
-    knative.dev/example-checksum: "330d9f60"
+    knative.dev/example-checksum: "1192895d"
 data:
   _example: |-
     ################################
@@ -36,7 +36,15 @@ data:
     # The Go text/template used to generate consumergroup ID for triggers.
     # The template can reference the trigger Kubernetes metadata only.
     triggers.consumergroup.template: "knative-trigger-{{ .Namespace }}-{{ .Name }}"
+    # The Go text/template used to generate topics for Brokers.
+    # The template can reference the broker Kubernetes metadata only.
+    brokers.topic.template: "knative-broker-{{ .Namespace }}-{{ .Name }}"
+    # The Go text/template used to generate topics for Channels.
+    # The template can reference the channel Kubernetes metadata only.
+    channels.topic.template: "knative-channel-{{ .Namespace }}-{{ .Name }}"
   dispatcher.rate-limiter: "disabled"
   dispatcher.ordered-executor-metrics: "disabled"
   controller.autoscaler: "disabled"
   triggers.consumergroup.template: "knative-trigger-{{ .Namespace }}-{{ .Name }}"
+  brokers.topic.template: "knative-broker-{{ .Namespace }}-{{ .Name }}"
+  channels.topic.template: "knative-channel-{{ .Namespace }}-{{ .Name }}"
diff --git a/control-plane/pkg/apis/config/features.go b/control-plane/pkg/apis/config/features.go
index b416b75e1..34032d6fc 100644
--- a/control-plane/pkg/apis/config/features.go
+++ b/control-plane/pkg/apis/config/features.go
@@ -40,6 +40,8 @@ type features struct {
 	DispatcherOrderedExecutorMetrics feature.Flag
 	ControllerAutoscaler             feature.Flag
 	TriggersConsumerGroupTemplate    *template.Template
+	BrokersTopicTemplate             *template.Template
+	ChannelsTopicTemplate            *template.Template
 }
 
 type KafkaFeatureFlags struct {
@@ -47,10 +49,16 @@ type KafkaFeatureFlags struct {
 	m        sync.RWMutex
 }
 
-var DefaultTriggersConsumerGroupTemplate *template.Template
+var (
+	DefaultTriggersConsumerGroupTemplate *template.Template
+	DefaultBrokersTopicTemplate          *template.Template
+	DefaultChannelsTopicTemplate         *template.Template
+)
 
 func init() {
 	DefaultTriggersConsumerGroupTemplate, _ = template.New("triggers.consumergroup.template").Parse("knative-trigger-{{ .Namespace }}-{{ .Name }}")
+	DefaultBrokersTopicTemplate, _ = template.New("brokers.topic.template").Parse("knative-broker-{{ .Namespace }}-{{ .Name }}")
+	DefaultChannelsTopicTemplate, _ = template.New("channels.topic.template").Parse("knative-channel-{{ .Namespace }}-{{ .Name }}")
 }
 
 func DefaultFeaturesConfig() *KafkaFeatureFlags {
@@ -60,6 +68,8 @@ func DefaultFeaturesConfig() *KafkaFeatureFlags {
 			DispatcherOrderedExecutorMetrics: feature.Disabled,
 			ControllerAutoscaler:             feature.Disabled,
 			TriggersConsumerGroupTemplate:    DefaultTriggersConsumerGroupTemplate,
+			BrokersTopicTemplate:             DefaultBrokersTopicTemplate,
+			ChannelsTopicTemplate:            DefaultChannelsTopicTemplate,
 		},
 	}
 }
@@ -72,6 +82,8 @@ func newFeaturesConfigFromMap(cm *corev1.ConfigMap) (*KafkaFeatureFlags, error)
 		asFlag("dispatcher.ordered-executor-metrics", &nc.features.DispatcherOrderedExecutorMetrics),
 		asFlag("controller.autoscaler", &nc.features.ControllerAutoscaler),
 		asTemplate("triggers.consumergroup.template", nc.features.TriggersConsumerGroupTemplate),
+		asTemplate("brokers.topic.template", nc.features.BrokersTopicTemplate),
+		asTemplate("channels.topic.template", nc.features.ChannelsTopicTemplate),
 	)
 	return nc, err
 }
@@ -95,13 +107,15 @@ func (f *KafkaFeatureFlags) IsControllerAutoscalerEnabled() bool {
 }
 
 func (f *KafkaFeatureFlags) ExecuteTriggersConsumerGroupTemplate(triggerMetadata v1.ObjectMeta) (string, error) {
-	var result bytes.Buffer
-	err := f.features.TriggersConsumerGroupTemplate.Execute(&result, triggerMetadata)
-	if err != nil {
-		return "", fmt.Errorf("unable to execute triggers consumergroup template: %w", err)
-	}
+	return executeTemplateToString(f.features.TriggersConsumerGroupTemplate, triggerMetadata, "unable to execute triggers consumergroup template: %w")
+}
 
-	return result.String(), nil
+func (f *KafkaFeatureFlags) ExecuteBrokersTopicTemplate(brokerMetadata v1.ObjectMeta) (string, error) {
+	return executeTemplateToString(f.features.BrokersTopicTemplate, brokerMetadata, "unable to execute brokers topic template: %w")
+}
+
+func (f *KafkaFeatureFlags) ExecuteChannelsTopicTemplate(channelMetadata v1.ObjectMeta) (string, error) {
+	return executeTemplateToString(f.features.ChannelsTopicTemplate, channelMetadata, "unable to execute channels topic template: %w")
 }
 
 // Store is a typed wrapper around configmap.Untyped store to handle our configmaps.
@@ -186,3 +200,13 @@ func asTemplate(key string, target *template.Template) configmap.ParseFunc {
 		return nil
 	}
 }
+
+func executeTemplateToString(template *template.Template, metadata v1.ObjectMeta, errorMessage string) (string, error) {
+	var result bytes.Buffer
+	err := template.Execute(&result, metadata)
+	if err != nil {
+		return "", fmt.Errorf(errorMessage, err)
+	}
+
+	return result.String(), nil
+}
diff --git a/hack/artifacts-env.sh b/hack/artifacts-env.sh
index 5b1efc83e..0136feb9e 100755
--- a/hack/artifacts-env.sh
+++ b/hack/artifacts-env.sh
@@ -20,3 +20,5 @@ export EVENTING_KAFKA_POST_INSTALL_ARTIFACT="eventing-kafka-post-install.yaml"
 export EVENTING_KAFKA_ARTIFACT="eventing-kafka.yaml"
 
 export EVENTING_KAFKA_SOURCE_BUNDLE_ARTIFACT="eventing-kafka-source-bundle.yaml"
+
+export EVENTING_KAFKA_TLS_NETWORK_ARTIFACT="eventing-kafka-tls-networking.yaml"
diff --git a/hack/data-plane.sh b/hack/data-plane.sh
index 3b567a3a0..2290504fe 100755
--- a/hack/data-plane.sh
+++ b/hack/data-plane.sh
@@ -25,8 +25,11 @@ readonly DATA_PLANE_CONFIG_DIR=${DATA_PLANE_DIR}/config
 readonly SOURCE_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/source
 # Broker config
 readonly BROKER_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/broker
+readonly BROKER_TLS_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/broker-tls
 readonly SINK_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/sink
+readonly SINK_TLS_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/sink-tls
 readonly CHANNEL_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/channel
+readonly CHANNEL_TLS_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/channel-tls
 
 readonly RECEIVER_DIRECTORY=receiver-vertx
 readonly DISPATCHER_DIRECTORY=dispatcher
@@ -98,6 +101,10 @@ function k8s() {
   ko resolve ${KO_FLAGS} -Rf ${BROKER_DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_BROKER_ARTIFACT}"
   ko resolve ${KO_FLAGS} -Rf ${SINK_DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_SINK_ARTIFACT}"
   ko resolve ${KO_FLAGS} -Rf ${CHANNEL_DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_CHANNEL_ARTIFACT}"
+  ko resolve ${KO_FLAGS} -Rf ${BROKER_TLS_CONFIG_DIR} \
+    -Rf ${SINK_TLS_CONFIG_DIR} \
+    -Rf ${CHANNEL_TLS_CONFIG_DIR} \
+    | "${LABEL_YAML_CMD[@]}" >"${EVENTING_KAFKA_TLS_NETWORK_ARTIFACT}"
 
   replace_images "${EVENTING_KAFKA_SOURCE_ARTIFACT}" &&
     replace_images "${EVENTING_KAFKA_BROKER_ARTIFACT}" &&
diff --git a/hack/release.sh b/hack/release.sh
index 941c05f9a..ca33f5a4c 100755
--- a/hack/release.sh
+++ b/hack/release.sh
@@ -81,6 +81,7 @@ function build_release() {
     "${EVENTING_KAFKA_CHANNEL_PROMETHEUS_OPERATOR_ARTIFACT}"
     "${EVENTING_KAFKA_POST_INSTALL_ARTIFACT}"
     "${EVENTING_KAFKA_SOURCE_BUNDLE_ARTIFACT}"
+    "${EVENTING_KAFKA_TLS_NETWORK_ARTIFACT}"
   )
 
   # ARTIFACTS_TO_PUBLISH has to be a string, not an array.


Test patch:
diff --git a/control-plane/pkg/apis/config/features_test.go b/control-plane/pkg/apis/config/features_test.go
index 37a5514b5..dc0860013 100644
--- a/control-plane/pkg/apis/config/features_test.go
+++ b/control-plane/pkg/apis/config/features_test.go
@@ -60,6 +60,11 @@ func TestGetFlags(t *testing.T) {
 	require.True(t, flags.IsControllerAutoscalerEnabled())
 	require.Len(t, flags.features.TriggersConsumerGroupTemplate.Tree.Root.Nodes, 4)
 	require.Equal(t, flags.features.TriggersConsumerGroupTemplate.Name(), "triggers.consumergroup.template")
+	require.Len(t, flags.features.BrokersTopicTemplate.Tree.Root.Nodes, 4)
+	require.Equal(t, flags.features.BrokersTopicTemplate.Name(), "brokers.topic.template")
+	require.Len(t, flags.features.ChannelsTopicTemplate.Tree.Root.Nodes, 4)
+	require.Equal(t, flags.features.ChannelsTopicTemplate.Name(), "channels.topic.template")
+
 }
 
 func TestStoreLoadWithConfigMap(t *testing.T) {
@@ -75,6 +80,8 @@ func TestStoreLoadWithConfigMap(t *testing.T) {
 	require.Equal(t, expected.IsDispatcherOrderedExecutorMetricsEnabled(), have.IsDispatcherOrderedExecutorMetricsEnabled())
 	require.Equal(t, expected.IsControllerAutoscalerEnabled(), have.IsControllerAutoscalerEnabled())
 	require.Equal(t, expected.features.TriggersConsumerGroupTemplate.Name(), have.features.TriggersConsumerGroupTemplate.Name())
+	require.Equal(t, expected.features.BrokersTopicTemplate.Name(), have.features.BrokersTopicTemplate.Name())
+	require.Equal(t, expected.features.ChannelsTopicTemplate.Name(), have.features.ChannelsTopicTemplate.Name())
 }
 
 func TestStoreLoadWithContext(t *testing.T) {
@@ -84,6 +91,8 @@ func TestStoreLoadWithContext(t *testing.T) {
 	require.False(t, have.IsDispatcherOrderedExecutorMetricsEnabled())
 	require.False(t, have.IsControllerAutoscalerEnabled())
 	require.Equal(t, have.features.TriggersConsumerGroupTemplate.Name(), "triggers.consumergroup.template")
+	require.Equal(t, have.features.BrokersTopicTemplate.Name(), "brokers.topic.template")
+	require.Equal(t, have.features.ChannelsTopicTemplate.Name(), "channels.topic.template")
 }
 
 func TestExecuteTriggersConsumerGroupTemplateDefault(t *testing.T) {
@@ -115,3 +124,63 @@ func TestExecuteTriggersConsumerGroupTemplateOverride(t *testing.T) {
 
 	require.Equal(t, result, "knative-trigger-namespace-trigger-138ac0ec-2694-4747-900d-45be3da5c9a9")
 }
+
+func TestExecuteBrokersTopicTemplateDefault(t *testing.T) {
+	nc := DefaultFeaturesConfig()
+	result, err := nc.ExecuteBrokersTopicTemplate(v1.ObjectMeta{
+		Name:      "topic",
+		Namespace: "namespace",
+		UID:       "138ac0ec-2694-4747-900d-45be3da5c9a9",
+	})
+	if err != nil {
+		require.NoError(t, err)
+	}
+
+	require.Equal(t, result, "knative-broker-namespace-topic")
+}
+
+func TestExecuteBrokersTopicTemplateOverride(t *testing.T) {
+	nc := DefaultFeaturesConfig()
+	nc.features.BrokersTopicTemplate, _ = template.New("custom-template").Parse("knative-broker-{{ .Namespace }}-{{ .Name }}-{{ .UID }}")
+
+	result, err := nc.ExecuteBrokersTopicTemplate(v1.ObjectMeta{
+		Name:      "topic",
+		Namespace: "namespace",
+		UID:       "138ac0ec-2694-4747-900d-45be3da5c9a9",
+	})
+	if err != nil {
+		require.NoError(t, err)
+	}
+
+	require.Equal(t, result, "knative-broker-namespace-topic-138ac0ec-2694-4747-900d-45be3da5c9a9")
+}
+
+func TestExecuteChannelsTopicTemplateDefault(t *testing.T) {
+	nc := DefaultFeaturesConfig()
+	result, err := nc.ExecuteChannelsTopicTemplate(v1.ObjectMeta{
+		Name:      "topic",
+		Namespace: "namespace",
+		UID:       "138ac0ec-2694-4747-900d-45be3da5c9a9",
+	})
+	if err != nil {
+		require.NoError(t, err)
+	}
+
+	require.Equal(t, result, "knative-channel-namespace-topic")
+}
+
+func TestExecuteChannelsTopicTemplateOverride(t *testing.T) {
+	nc := DefaultFeaturesConfig()
+	nc.features.ChannelsTopicTemplate, _ = template.New("custom-template").Parse("knative-channel-{{ .Namespace }}-{{ .Name }}-{{ .UID }}")
+
+	result, err := nc.ExecuteChannelsTopicTemplate(v1.ObjectMeta{
+		Name:      "topic",
+		Namespace: "namespace",
+		UID:       "138ac0ec-2694-4747-900d-45be3da5c9a9",
+	})
+	if err != nil {
+		require.NoError(t, err)
+	}
+
+	require.Equal(t, result, "knative-channel-namespace-topic-138ac0ec-2694-4747-900d-45be3da5c9a9")
+}
diff --git a/control-plane/pkg/apis/config/testdata/config-kafka-features.yaml b/control-plane/pkg/apis/config/testdata/config-kafka-features.yaml
index d0495bc4c..5f99736b6 100644
--- a/control-plane/pkg/apis/config/testdata/config-kafka-features.yaml
+++ b/control-plane/pkg/apis/config/testdata/config-kafka-features.yaml
@@ -9,3 +9,5 @@ data:
     dispatcher.ordered-executor-metrics: "enabled"
     controller.autoscaler: "enabled"
     triggers.consumergroup.template: "knative-trigger-{{ .Namespace }}-{{ .Name }}"
+    brokers.topic.template: "knative-broker-{{ .Namespace }}-{{ .Name }}"
+    channels.topic.template: "knative-channel-{{ .Namespace }}-{{ .Name }}"
diff --git a/control-plane/pkg/prober/async_prober_test.go b/control-plane/pkg/prober/async_prober_test.go
index ed8b77256..f0486edf1 100644
--- a/control-plane/pkg/prober/async_prober_test.go
+++ b/control-plane/pkg/prober/async_prober_test.go
@@ -214,9 +214,9 @@ func TestAsyncProber(t *testing.T) {
 				return status == tc.wantStatus
 			}
 
-			require.Eventuallyf(t, probeFunc, 5*time.Second, 100*time.Millisecond, "")
-			require.Eventuallyf(t, func() bool { return wantRequestCountMin.Load() == 0 }, 5*time.Second, 100*time.Millisecond, "got %d, want 0", wantRequestCountMin.Load())
-			require.Eventuallyf(t, func() bool { return wantRequeueCountMin.Load() == 0 }, 5*time.Second, 100*time.Millisecond, "got %d, want 0", wantRequeueCountMin.Load())
+			require.Eventuallyf(t, probeFunc, 5*time.Second, 250*time.Millisecond, "")
+			require.Eventuallyf(t, func() bool { return wantRequestCountMin.Load() == 0 }, 5*time.Second, 250*time.Millisecond, "got %d, want 0", wantRequestCountMin.Load())
+			require.Eventuallyf(t, func() bool { return wantRequeueCountMin.Load() == 0 }, 5*time.Second, 250*time.Millisecond, "got %d, want 0", wantRequeueCountMin.Load())
 		})
 	}
 }
@@ -297,9 +297,9 @@ func TestAsyncProberRotateCACerts(t *testing.T) {
 	}
 
 	t.Run("one pod - TLS certs before rotation", func(tt *testing.T) {
-		require.Eventuallyf(t, probeFunc, 5*time.Second, 100*time.Millisecond, "")
-		require.Eventuallyf(t, func() bool { return wantRequestCountMin.Load() == 1 }, 5*time.Second, 100*time.Millisecond, "got %d, want 1", wantRequestCountMin.Load())
-		require.Eventuallyf(t, func() bool { return wantRequeueCountMin.Load() == 1 }, 5*time.Second, 100*time.Millisecond, "got %d, want 1", wantRequeueCountMin.Load())
+		require.Eventuallyf(tt, probeFunc, 5*time.Second, 250*time.Millisecond, "")
+		require.Eventuallyf(tt, func() bool { return wantRequestCountMin.Load() == 1 }, 5*time.Second, 250*time.Millisecond, "got %d, want 1", wantRequestCountMin.Load())
+		require.Eventuallyf(tt, func() bool { return wantRequeueCountMin.Load() == 1 }, 5*time.Second, 250*time.Millisecond, "got %d, want 1", wantRequeueCountMin.Load())
 	})
 	t.Run("one pod - TLS certs after rotation", func(tt *testing.T) {
 		prober.RotateRootCaCerts(pointer.String(string(CA2)))
@@ -308,9 +308,9 @@ func TestAsyncProberRotateCACerts(t *testing.T) {
 			return &cert, err
 		}
 		time.Sleep(time.Second * 10)
-		require.Eventuallyf(t, probeFunc, 5*time.Second, 100*time.Millisecond, "")
-		require.Eventuallyf(t, func() bool { return wantRequestCountMin.Load() == 0 }, 5*time.Second, 100*time.Millisecond, "got %d, want 0", wantRequestCountMin.Load())
-		require.Eventuallyf(t, func() bool { return wantRequeueCountMin.Load() == 0 }, 5*time.Second, 100*time.Millisecond, "got %d, want 0", wantRequeueCountMin.Load())
+		require.Eventuallyf(tt, probeFunc, 5*time.Second, 250*time.Millisecond, "")
+		require.Eventuallyf(tt, func() bool { return wantRequestCountMin.Load() == 0 }, 5*time.Second, 250*time.Millisecond, "got %d, want 0", wantRequestCountMin.Load())
+		require.Eventuallyf(tt, func() bool { return wantRequeueCountMin.Load() == 0 }, 5*time.Second, 250*time.Millisecond, "got %d, want 0", wantRequeueCountMin.Load())
 	})
 }
 
diff --git a/test/config/100-config-kafka-features.yaml b/test/config/100-config-kafka-features.yaml
index 83765063a..57365e5f9 100644
--- a/test/config/100-config-kafka-features.yaml
+++ b/test/config/100-config-kafka-features.yaml
@@ -8,3 +8,5 @@ data:
   dispatcher.ordered-executor-metrics: "enabled"
   controller.autoscaler: "enabled"
   triggers.consumergroup.template: "knative-trigger-{{ .Namespace }}-{{ .Name }}"
+  brokers.topic.template: "knative-broker-{{ .Namespace }}-{{ .Name }}"
+  channels.topic.template: "knative-channel-{{ .Namespace }}-{{ .Name }}"
diff --git a/test/e2e-common.sh b/test/e2e-common.sh
index e4946080b..d5f6992c4 100644
--- a/test/e2e-common.sh
+++ b/test/e2e-common.sh
@@ -40,6 +40,7 @@ readonly LATEST_RELEASE_VERSION=$(latest_version)
 readonly PREVIOUS_RELEASE_URL="${PREVIOUS_RELEASE_URL:-"https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/${LATEST_RELEASE_VERSION}"}"
 
 readonly EVENTING_CONFIG=${EVENTING_CONFIG:-"./third_party/eventing-latest/"}
+readonly CERTMANAGER_CONFIG=${CERTMANAGER_CONFIG:-"./third_party/cert-manager/"}
 
 # Vendored eventing test images.
 readonly VENDOR_EVENTING_TEST_IMAGES="vendor/knative.dev/eventing/test/test_images/"
@@ -85,10 +86,13 @@ function knative_teardown() {
 }
 
 function knative_eventing() {
+  # we need cert-manager installed to be able to create the issuers
+  kubectl apply -Rf "${CERTMANAGER_CONFIG}"
   if ! is_release_branch; then
     echo ">> Install Knative Eventing from latest - ${EVENTING_CONFIG}"
     kubectl apply -f "${EVENTING_CONFIG}/eventing-crds.yaml"
     kubectl apply -f "${EVENTING_CONFIG}/eventing-core.yaml"
+    kubectl apply -f "${EVENTING_CONFIG}/eventing-tls-networking.yaml"
   else
     echo ">> Install Knative Eventing from ${KNATIVE_EVENTING_RELEASE}"
     kubectl apply -f "${KNATIVE_EVENTING_RELEASE}"
@@ -174,6 +178,7 @@ function install_head() {
   kubectl apply -f "${EVENTING_KAFKA_BROKER_ARTIFACT}" || return $?
   kubectl apply -f "${EVENTING_KAFKA_SINK_ARTIFACT}" || return $?
   kubectl apply -f "${EVENTING_KAFKA_CHANNEL_ARTIFACT}" || return $?
+  kubectl apply -f "${EVENTING_KAFKA_TLS_NETWORK_ARTIFACT}" || return $?
   kubectl apply -f "${EVENTING_KAFKA_POST_INSTALL_ARTIFACT}" || return $?
 
   # Restore test config.