2. KNative Installation¶
Overview¶
We install:
- KNative Serving (v1.22.1) — serverless workloads with scale-to-zero
- Kourier — lightweight ingress for Serving
- KNative Eventing (v1.22.1) — event routing with brokers and triggers
- Kafka components — Kafka Broker, Source, and Channel for Event Hubs integration
Install KNative Serving + Eventing¶
This script:
- Installs KNative Serving CRDs and core components
- Installs Kourier as the networking/ingress layer
- Configures Kourier as the default ingress class
- Installs KNative Eventing CRDs and core components
- Installs the Kafka controller, broker, and source components
Installation Time
Takes ~2-3 minutes. The script waits for all deployments to be ready.
Fix Kafka Components (v1.22.1 Bug)¶
KNative v1.22.1 has a bug where the kafka-broker-dispatcher StatefulSet references a volume (contract-resources) that doesn't exist in the manifest. Additionally, the kafka-source-dispatcher and kafka-channel-dispatcher need to be installed separately.
This script:
- Downloads the
eventing-kafka-broker.yamlmanifest - Patches the missing
contract-resourcesvolume definition (v1.22.1 bug) - Applies the patched manifest
- Waits for the
kafka-broker-dispatcherStatefulSet to be ready
Verify¶
# All pods should be Running
kubectl get pods -n knative-serving
kubectl get pods -n knative-eventing
Expected pods in knative-serving:
activator-xxx Running
autoscaler-xxx Running
controller-xxx Running
net-kourier-controller-xxx Running
webhook-xxx Running
Expected pods in knative-eventing:
eventing-controller-xxx Running
eventing-webhook-xxx Running
kafka-broker-dispatcher-0 Running
kafka-broker-receiver-xxx Running
kafka-controller-xxx Running
Configure Domain (Optional)¶
By default, KNative uses svc.cluster.local which makes services cluster-local only. To expose services externally through Kourier:
kubectl patch configmap config-domain -n knative-serving \
--type merge -p '{"data":{"example.com":""}}'
After this, services will be accessible via the Kourier LoadBalancer IP with the appropriate Host header: