|
| 1 | +# Strimzi Access Operator |
| 2 | + |
| 3 | +Strimzi Access Operator provides a Kubernetes operator to help applications bind to an [Apache Kafka®](https://kafka.apache.org) cluster that is managed by the [Strimzi](https://strimzi.io) cluster operator. |
| 4 | + |
| 5 | +The operator creates a single Kubernetes `Secret` resource containing all the connection details for the Kafka cluster. |
| 6 | +The removes the need for applications to query multiple Kubernetes resources to get connection information. |
| 7 | +The `Secret` follows the conventions laid out in the [Service Binding Specification for Kubernetes v1.0.0](https://servicebinding.io/spec/core/1.0.0/). |
| 8 | + |
| 9 | +The operator is built using the [Java Operator SDK](https://github.com/java-operator-sdk/java-operator-sdk). |
| 10 | + |
| 11 | +## Running the Access Operator |
| 12 | + |
| 13 | +For the operator to start successfully you need the Strimzi `Kafka` and `KafkaUser` custom resource definitions installed in your Kubernetes cluster. |
| 14 | +You can get these from the Strimzi [GitHub repository](https://github.com/strimzi/strimzi-kafka-operator/tree/main/install/cluster-operator), |
| 15 | +or use the [Strimzi quickstart guide](https://strimzi.io/quickstarts/) to also deploy the Strimzi cluster operator and a Kafka instance at the same time. |
| 16 | + |
| 17 | +### Installing the Chart |
| 18 | + |
| 19 | +To install the chart with the release name `my-strimzi-access-operator`: |
| 20 | + |
| 21 | +```bash |
| 22 | +$ helm install my-strimzi-access-operator oci://quay.io/strimzi-helm/strimzi-access-operator |
| 23 | +``` |
| 24 | + |
| 25 | +The command deploys the Strimzi Access Operator on the Kubernetes cluster with the default configuration. |
| 26 | + |
| 27 | +### Uninstalling the Chart |
| 28 | + |
| 29 | +To uninstall/delete the `my-strimzi-access-operator` deployment: |
| 30 | + |
| 31 | +```bash |
| 32 | +$ helm delete my-strimzi-access-operator |
| 33 | +``` |
| 34 | + |
| 35 | +The command removes all the Kubernetes components associated with the Strimzi Access Operator utility and deletes the release. |
| 36 | + |
| 37 | +### Configuration |
| 38 | + |
| 39 | +The following table lists some available configurable parameters of the Strimzi chart and their default values. |
| 40 | +For a full list of supported options, check the [`values.yaml` file](./values.yaml). |
| 41 | + |
| 42 | +| Parameter | Description | Default | |
| 43 | +|--------------------------------------|-----------------------------------------------------------|----------| |
| 44 | +| `image.tag` | Override default Drain Cleaner image tag | `0.1.1` | |
| 45 | +| `image.imagePullPolicy` | Image pull policy for all pods deployed by Drain Cleaner | `nil` | |
| 46 | +| `resources.limits.cpu` | Configures the CPU limit for the Access Operator Pod | `256Mi` | |
| 47 | +| `resources.limits.memory` | Configures the memory limit for the Access Operator Pod | `500m` | |
| 48 | +| `resources.requests.cpu` | Configures the CPU request for the Access Operator Pod | `256Mi` | |
| 49 | +| `resources.requests.memory` | Configures the memory request for the Access Operator Pod | `100m` | |
| 50 | +| `livenessProbe.initialDelaySeconds` | Liveness probe initial delay (in seconds) | `10` | |
| 51 | +| `livenessProbe.periodSeconds` | Liveness probe period (in seconds) | `30` | |
| 52 | +| `readinessProbe.initialDelaySeconds` | Readiness probe initial delay (in seconds) | `10` | |
| 53 | +| `readinessProbe.periodSeconds` | Readiness probe period (in seconds) | `30` | |
| 54 | + |
| 55 | +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, |
| 56 | + |
| 57 | +```bash |
| 58 | +$ helm install my-strimzi-access-operator --set replicaCount=2 oci://quay.io/strimzi-helm/strimzi-access-operator |
| 59 | +``` |
| 60 | + |
| 61 | +## Using the Access Operator |
| 62 | + |
| 63 | +To make use of the Access Operator, create a `KafkaAccess` custom resource (CR). |
| 64 | +You must specify the name of the `Kafka` CR you want to connect to. |
| 65 | +You can optionally also specify the name of the listener in the `Kafka` CR and a `KafkaUser`. |
| 66 | +See the [examples folder](https://github.com/strimzi/kafka-access-operator/tree/main/examples) for some valid `KafkaAccess` specifications. |
| 67 | + |
| 68 | +If you do not specify which listener you want to connect to, the operator uses the following rules to choose a listener: |
| 69 | +1. If there is only one listener configured in the `Kafka` CR, that listener is chosen. |
| 70 | +2. If there are multiple listeners listed in the `Kafka` CR, the operator filters the list by comparing the `tls` and `authentication` properties in the `Kafka` and `KafkaUser` CRs to select a listener with the appropriate security. |
| 71 | +3. If there are multiple listeners with appropriate security, the operator chooses the one that is of type `internal`. |
| 72 | +4. If there are multiple internal listeners with appropriate security, the operator sorts the listeners alphabetically by name, and chooses the first one. |
| 73 | + |
| 74 | +Once the Access Operator has created the binding `Secret`, it updates the `KafkaAccess` custom resource to put the name of the secret in the status, for example: |
| 75 | + |
| 76 | +```yaml |
| 77 | +... |
| 78 | +status: |
| 79 | + binding: |
| 80 | + name: kafka-binding |
| 81 | +``` |
| 82 | +
|
| 83 | +The `Secret` created by the Access Operator has the following structure: |
| 84 | + |
| 85 | +```yaml |
| 86 | +apiVersion: v1 |
| 87 | +kind: Secret |
| 88 | +metadata: |
| 89 | + name: kafka-binding |
| 90 | +type: servicebinding.io/kafka |
| 91 | +data: |
| 92 | + type: kafka |
| 93 | + provider: strimzi |
| 94 | +
|
| 95 | + bootstrap.servers: # comma separated list of host:port for Kafka |
| 96 | + bootstrap-servers: # comma separated list of host:port for Kafka |
| 97 | + bootstrapServers: # comma separated list of host:port for Kafka |
| 98 | +
|
| 99 | + security.protocol: # one of PLAINTEXT, SASL_PLAINTEXT, SASL_SSL or SSL |
| 100 | + securityProtocol: # one of PLAINTEXT, SASL_PLAINTEXT, SASL_SSL or SSL |
| 101 | +
|
| 102 | + # Provided if TLS enabled: |
| 103 | + ssl.truststore.crt: # Strimzi cluster CA certificate |
| 104 | +
|
| 105 | + # Provided if selected user is SCRAM auth: |
| 106 | + username: # SCRAM username |
| 107 | + password: # SCRAM password |
| 108 | + sasl.jaas.config: # sasl jaas config string for use by Java applications |
| 109 | + sasl.mechanism: SCRAM-SHA-512 |
| 110 | + saslMechanism: SCRAM-SHA-512 |
| 111 | +
|
| 112 | + # Provided if selected user is mTLS: |
| 113 | + ssl.keystore.crt: # certificate for the consuming client signed by the clients' CA |
| 114 | + ssl.keystore.key: # private key for the consuming client |
| 115 | +``` |
| 116 | + |
| 117 | +Developers can make this `Secret` available to their applications themselves, or use an operator that implements the [Service Binding specification](https://servicebinding.io/spec/core/1.0.0/) to do it. |
| 118 | + |
| 119 | +## Getting help |
| 120 | + |
| 121 | +If you encounter any issues while using the Access Operator, you can get help through the following methods: |
| 122 | + |
| 123 | +- [Strimzi Users mailing list](https://lists.cncf.io/g/cncf-strimzi-users/topics) |
| 124 | +- [#strimzi channel on CNCF Slack](https://slack.cncf.io/) |
| 125 | +- [GitHub Discussions](https://github.com/orgs/strimzi/discussions) |
| 126 | + |
| 127 | +## Contributing |
| 128 | + |
| 129 | +You can contribute by: |
| 130 | +- Raising any issues you find using the Access Operator |
| 131 | +- Fixing issues by opening Pull Requests |
| 132 | +- Improving documentation |
| 133 | +- Talking about the Strimzi Access Operator |
| 134 | + |
| 135 | +All bugs, tasks or enhancements are tracked as [GitHub issues](https://github.com/strimzi/kafka-access-operator/issues). |
| 136 | + |
| 137 | +The [dev guide](https://github.com/strimzi/kafka-access-operator/blob/main/development-docs/DEV_GUIDE.md) describes how to build the operator and how to test your changes before submitting a patch or opening a PR. |
| 138 | + |
| 139 | +If you want to get in touch with us first before contributing, you can use: |
| 140 | + |
| 141 | +- [Strimzi Dev mailing list](https://lists.cncf.io/g/cncf-strimzi-dev/topics) |
| 142 | +- [#strimzi channel on CNCF Slack](https://slack.cncf.io/) |
| 143 | + |
| 144 | +Learn more on how you can contribute on our [Join Us](https://strimzi.io/join-us/) page. |
| 145 | + |
| 146 | +## License |
| 147 | + |
| 148 | +Strimzi Access Operator is licensed under the [Apache License](./LICENSE), Version 2.0 |
0 commit comments