Skip to content

Commit 7ec1a98

Browse files
authored
Add Access Operator 0.1.1 to the main branch (#72)
Signed-off-by: Jakub Scholz <[email protected]>
1 parent 3c1dcca commit 7ec1a98

13 files changed

+449
-14
lines changed

.azure/scripts/release_files_check.sh

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ SHA1SUM=sha1sum
88
RETURN_CODE=0
99

1010
# Arrays holding the relevant information for each directory
11-
# TODO: after release add here "Helm Charts" HELM_CHART_CHECKSUM checksum_helm "./helm-charts" and "./packaging/helm-charts" in each line
12-
ITEMS=("install" "examples")
13-
CHECKSUM_VARS=("INSTALL_CHECKSUM" "EXAMPLES_CHECKSUM")
14-
MAKE_TARGETS=("checksum_install" "checksum_examples")
15-
DIRECTORIES=("./install" "./examples")
16-
PACKAGING_DIRS=("./packaging/install" "./packaging/examples")
11+
ITEMS=("install" "examples" "helm-charts")
12+
CHECKSUM_VARS=("INSTALL_CHECKSUM" "EXAMPLES_CHECKSUM" "HELM_CHART_CHECKSUM")
13+
MAKE_TARGETS=("checksum_install" "checksum_examples" "checksum_helm")
14+
DIRECTORIES=("./install" "./examples" "./helm-charts")
15+
PACKAGING_DIRS=("./packaging/install" "./packaging/examples" "./packaging/helm-charts")
1716

1817
for i in "${!ITEMS[@]}"; do
1918
NAME="${ITEMS[$i]}"

.checksums

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
# if this checksum has changed as part of any non-release specific changes, please apply your changes to the
77
# development version of the helm charts in ./packaging/helm-charts
88
### IMPORTANT ###
9-
# TODO: after release un-comment this HELM_CHART_CHECKSUM="50e2ee0738ebfd558fa2e35c189b3abb5e3a5663 -"
9+
HELM_CHART_CHECKSUM="23edfc4a6e4bdf8363209448ab754258f2929958 -"
1010

1111
### IMPORTANT ###
1212
# if the below line has changed, this means the ./install directory has changed
1313
# the checksum and ./install directory should only be modified on official releases as part of a release
1414
# if this checksum has changed as part of any non-release specific changes, please apply your changes to the
1515
# development version of the helm charts in ./packaging/install
1616
### IMPORTANT ###
17-
INSTALL_CHECKSUM="14107f5b805ba8ccceb44f0845d535b8732c2e6e -"
17+
INSTALL_CHECKSUM="285387a2e673598b6624805ac200d1e14d17f79d -"
1818

1919
### IMPORTANT ###
2020
# if the below line has changed, this means the ./examples directory has changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
# TODO
3+
appVersion: "0.1.0"
4+
description: "Strimzi Kafka Access Operator"
5+
name: strimzi-access-operator
6+
version: 0.1.0
7+
icon: https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/main/documentation/logo/strimzi_logo.png
8+
keywords:
9+
- kafka
10+
- queue
11+
- stream
12+
- event
13+
- messaging
14+
- datastore
15+
- topic
16+
home: https://strimzi.io/
17+
sources:
18+
- https://github.com/strimzi/kafka-access-operator
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Generated by Fabric8 CRDGenerator, manual edits might get overwritten!
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
name: kafkaaccesses.access.strimzi.io
6+
labels:
7+
servicebinding.io/provisioned-service: "true"
8+
spec:
9+
group: access.strimzi.io
10+
names:
11+
kind: KafkaAccess
12+
plural: kafkaaccesses
13+
shortNames:
14+
- ka
15+
singular: kafkaaccess
16+
scope: Namespaced
17+
versions:
18+
- additionalPrinterColumns:
19+
- jsonPath: .spec.kafka.listener
20+
name: Listener
21+
priority: 0
22+
type: string
23+
- jsonPath: .spec.kafka.name
24+
name: Cluster
25+
priority: 0
26+
type: string
27+
- jsonPath: .spec.user.name
28+
name: User
29+
priority: 0
30+
type: string
31+
name: v1alpha1
32+
schema:
33+
openAPIV3Schema:
34+
properties:
35+
spec:
36+
properties:
37+
kafka:
38+
properties:
39+
listener:
40+
type: string
41+
name:
42+
type: string
43+
namespace:
44+
type: string
45+
required:
46+
- name
47+
type: object
48+
user:
49+
properties:
50+
apiGroup:
51+
type: string
52+
kind:
53+
type: string
54+
name:
55+
type: string
56+
namespace:
57+
type: string
58+
required:
59+
- apiGroup
60+
- kind
61+
- name
62+
type: object
63+
required:
64+
- kafka
65+
type: object
66+
status:
67+
properties:
68+
binding:
69+
properties:
70+
name:
71+
type: string
72+
type: object
73+
conditions:
74+
items:
75+
properties:
76+
additionalProperties:
77+
additionalProperties:
78+
type: object
79+
type: object
80+
lastTransitionTime:
81+
type: string
82+
message:
83+
type: string
84+
reason:
85+
type: string
86+
status:
87+
type: string
88+
type:
89+
type: string
90+
type: object
91+
type: array
92+
observedGeneration:
93+
type: integer
94+
type: object
95+
type: object
96+
served: true
97+
storage: true
98+
subresources:
99+
status: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: strimzi-access-operator
6+
labels:
7+
app: strimzi-access-operator
8+
namespace: {{ .Release.Namespace }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: strimzi-access-operator
6+
labels:
7+
app: strimzi-access-operator
8+
rules:
9+
- apiGroups:
10+
- "access.strimzi.io"
11+
resources:
12+
- kafkaaccesses
13+
- kafkaaccesses/status
14+
verbs:
15+
- get
16+
- list
17+
- watch
18+
- create
19+
- delete
20+
- patch
21+
- update
22+
- apiGroups:
23+
- "kafka.strimzi.io"
24+
resources:
25+
- kafkas
26+
- kafkausers
27+
verbs:
28+
- get
29+
- list
30+
- watch
31+
- apiGroups:
32+
- ""
33+
resources:
34+
- secrets
35+
verbs:
36+
- get
37+
- list
38+
- watch
39+
- create
40+
- delete
41+
- patch
42+
- update
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: strimzi-access-operator
6+
labels:
7+
app: strimzi-access-operator
8+
subjects:
9+
- kind: ServiceAccount
10+
name: strimzi-access-operator
11+
namespace: {{ .Release.Namespace }}
12+
roleRef:
13+
kind: ClusterRole
14+
name: strimzi-access-operator
15+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)