Skip to content

Commit 8b763d9

Browse files
k-wallPaulRMellor
andauthored
docs(filters): illustrate and describe the filterRef array in the VKC resource (kroxylicious#3219)
* docs(filters): illustrate and describe the filterRef array in the VKC resource. Signed-off-by: Keith Wall <kwall@apache.org> * Apply suggestions from code review Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Keith Wall <kwall@apache.org> * word smithing Signed-off-by: Keith Wall <kwall@apache.org> --------- Signed-off-by: Keith Wall <kwall@apache.org> Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com>
1 parent 6707bc1 commit 8b763d9

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

kroxylicious-docs/docs/_modules/configuring/con-virtualkafkacluster-overview.adoc

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ The virtual cluster references the following resources, which must be in the sam
1515
* A `KafkaProxy` resource that the proxy is part of.
1616
* One or more `KafkaProxyIngress` resources that expose the virtual cluster to Kafka clients and provide virtual-cluster-specific configuration to the ingress (such as TLS certificates and other parameters).
1717
* A `KafkaService` resource that defines the backend Kafka cluster.
18-
* Zero or more `KafkaProtocolFilter` resources that apply filters to the Kafka protocol traffic passing between clients and the backend Kafka cluster.
18+
* One or more `KafkaProtocolFilter` resources that filter the Kafka protocol traffic between clients and the backend Kafka cluster.
19+
The order of the filters in the `filterRefs` array defines the order that the filters are applied.
20+
Client requests pass through the filters starting at index `0`, then `1`, and continuing to index `n`.
21+
Broker responses pass through the same filters in the reverse order.
22+
If the `filterRefs` array is empty (or null), the traffic will pass through the cluster unchanged.
1923

20-
This example shows a `VirtualKafkaCluster`, exposing it to Kafka clients running on the same Kubernetes cluster.
21-
It uses plain TCP (as opposed to TLS) as the transport protocol.
24+
The following example shows configuration for a `VirtualKafkaCluster` that is exposed it to Kafka clients running on the same Kubernetes cluster.
25+
Protocol traffic is filtered by the `my-filter` filter.
2226

23-
.Example `VirtualKafkaCluster` configuration with single `clusterIP` ingress
27+
.Example `VirtualKafkaCluster` configuration with a single ingress and filter.
2428
[source,yaml]
2529
----
2630
kind: VirtualKafkaCluster
@@ -36,16 +40,21 @@ spec:
3640
ingresses:
3741
- ingressRef: # <3>
3842
name: cluster-ip
43+
filterRefs: # <4>
44+
- name: my-filter
45+
3946
----
4047
<1> Identifies the `KafkaProxy` resource that this virtual cluster is part of.
41-
<2> The `KafkaService` that defines the Kafka cluster proxied by the virtual cluster.
42-
<3> Ingresses that expose the virtual cluster.
48+
<2> Specifies the `KafkaService` that defines the Kafka cluster proxied by the virtual cluster.
49+
<3> Defines the ingresses that expose the virtual cluster.
4350
Each ingress references a `KafkaProxyIngress` by name.
51+
<4> Specifies the list of filters applied to Kafka protocol traffic.
4452

45-
This example shows a `VirtualKafkaCluster`, exposing it to Kafka clients running both on and off-cluster, both using TLS.
53+
The following example shows configuration for a `VirtualKafkaCluster` that is exposed to Kafka clients running both on and off the cluster, using TLS.
4654
Because TLS is used, the ingress configuration must reference a TLS server certificate.
55+
This example has two filters.
4756

48-
.Example `VirtualKafkaCluster` configuration with two ingresses using TLS
57+
.Example `VirtualKafkaCluster` configuration with two TLS-enabled ingresses
4958
[source,yaml]
5059
----
5160
kind: VirtualKafkaCluster
@@ -69,9 +78,12 @@ spec:
6978
certificateRef:
7079
name: 'external-server-cert' # <2>
7180
kind: Secret
81+
filterRefs:
82+
- name: my-filter-1
83+
- name: my-filter-2
7284
----
73-
<1> Reference to a secret containing the server certificate for the `clusterIP` ingress.
74-
<2> Reference to a secret containing the server certificate for the `loadBalancer` ingress.
85+
<1> References a secret containing the server certificate for the `clusterIP` ingress.
86+
<2> References a secret containing the server certificate for the `loadBalancer` ingress.
7587

7688
include::./con-virtualkafkacluster-clusterip-generate-tls-certificates.adoc[leveloffset=+1]
7789
include::./con-virtualkafkacluster-loadbalancer-generate-tls-certificates.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)