Skip to content

Commit c7a51fe

Browse files
Felix Hennigfhennig
andcommitted
Split off usage guide into individual files and document MyID for multiple role groups (#606)
# Description fixes #557 ## Review Checklist - [ ] Code contains useful comments - [ ] CRD change approved (or not applicable) - [ ] (Integration-)Test cases added (or not applicable) - [ ] Documentation added (or not applicable) - [ ] Changelog updated (or not applicable) - [ ] Cargo.toml only contains references to git tags (not specific commits or branches) - [ ] Helm chart can be installed and deployed operator works (or not applicable) Once the review is done, comment `bors r+` (or `bors merge`) to merge. [Further information](https://bors.tech/documentation/getting-started/#reviewing-pull-requests) Co-authored-by: Felix Hennig <[email protected]>
1 parent 8fd75ef commit c7a51fe

17 files changed

+196
-209
lines changed

docs/antora.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ title: Stackable Operator for Apache ZooKeeper
44
nav:
55
- modules/getting_started/nav.adoc
66
- modules/ROOT/nav.adoc
7+
- modules/usage_guide/nav.adoc
78
prerelease: true

docs/modules/ROOT/nav.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
* xref:configuration.adoc[]
2-
* xref:usage.adoc[]
32
* Concepts
43
** xref:znodes.adoc[]
54
** xref:discovery.adoc[]

docs/modules/ROOT/pages/usage.adoc

Lines changed: 0 additions & 207 deletions
This file was deleted.

docs/modules/getting_started/pages/first_steps.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ Great! This step concludes the Getting started guide. You have installed the Zoo
9494
9595
== What's next
9696
97-
Have a look at the xref:ROOT:usage.adoc[] page to learn more about configuration options for your ZooKeeper cluster like setting up encryption or authentication. You can also have a look at the xref:ROOT:znodes.adoc[] page to learn more about ZNodes.
97+
Have a look at the xref:usage_guide:index.adoc[] to learn more about configuration options for your ZooKeeper cluster like setting up encryption or authentication. You can also have a look at the xref:ROOT:znodes.adoc[] page to learn more about ZNodes.

docs/modules/usage_guide/nav.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* xref:index.adoc[]
2+
** xref:encryption.adoc[]
3+
** xref:authentication.adoc[]
4+
** xref:resource_configuration.adoc[]
5+
** xref:monitoring.adoc[]
6+
** xref:using_multiple_role_groups.adoc[]
7+
** xref:configuration_environment_overrides.adoc[]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
= Authentication
2+
3+
The quorum or server-to-server communication is authenticated via TLS per default. In order to enforce TLS authentication for client-to-server communication, you can set an `AuthenticationClass` reference in the custom resource provided by the xref:commons-operator::index.adoc[Commons Operator].
4+
5+
[source,yaml]
6+
----
7+
include::example$example-cluster-tls-authentication.yaml[]
8+
include::example$example-cluster-tls-authentication-class.yaml[]
9+
include::example$example-cluster-tls-authentication-secret.yaml[]
10+
----
11+
<1> The `config.clientAuthentication.authenticationClass` can be set to use TLS for authentication. This is optional.
12+
<2> The referenced `AuthenticationClass` that references a `SecretClass` to provide certificates.
13+
<3> The reference to a `SecretClass`.
14+
<4> The `SecretClass` that is referenced by the `AuthenticationClass` in order to provide certificates.
15+
16+
If both `spec.config.tls.secretClass` and `spec.config.clientAuthentication.authenticationClass` are set, the authentication class will take precedence over the secret class. The cluster will be encrypted and authenticate only against the authentication class.
17+
18+
WARNING: Due to a https://issues.apache.org/jira/browse/ZOOKEEPER-4276[bug] in ZooKeeper, the `clientPort` property in combination with `client.portUnification=true` is used instead of the `secureClientPort`. This means that unencrypted and unauthenticated access to the ZooKeeper cluster is still possible.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
= Configuration and environment overrides
3+
4+
The cluster definition also supports overriding configuration properties and environment variables, either per role or per role group, where the more specific override (role group) has precedence over the less specific one (role).
5+
6+
IMPORTANT: Overriding certain properties which are set by operator (such as the ports) can interfere with the operator and can lead to problems.
7+
8+
== Configuration properties
9+
10+
For a role or role group, at the same level of `config`, you can specify: `configOverrides` for the `zoo.cfg`. For example, if you want to set the `4lw.commands.whitelist` to allow the `ruok` administrative command, it can be configured in the `ZookeeperCluster` resource like so:
11+
12+
[source,yaml]
13+
----
14+
servers:
15+
roleGroups:
16+
default:
17+
configOverrides:
18+
zoo.cfg:
19+
4lw.commands.whitelist: "srvr, ruok"
20+
replicas: 1
21+
----
22+
23+
Just as for the `config`, it is possible to specify this at role level as well:
24+
25+
[source,yaml]
26+
----
27+
routers:
28+
configOverrides:
29+
zoo.cfg:
30+
4lw.commands.whitelist: "srvr, ruok"
31+
roleGroups:
32+
default:
33+
replicas: 1
34+
----
35+
36+
All override property values must be strings.
37+
38+
For a full list of configuration options we refer to the Apache ZooKeeper https://zookeeper.apache.org/doc/r3.7.0/zookeeperAdmin.html#sc_configuration[Configuration Reference].
39+
40+
== Environment variables
41+
42+
In a similar fashion, environment variables can be (over)written. For example per role group:
43+
44+
[source,yaml]
45+
----
46+
servers:
47+
roleGroups:
48+
default:
49+
envOverrides:
50+
MY_ENV_VAR: "MY_VALUE"
51+
replicas: 1
52+
----
53+
54+
or per role:
55+
56+
[source,yaml]
57+
----
58+
servers:
59+
envOverrides:
60+
MY_ENV_VAR: "MY_VALUE"
61+
roleGroups:
62+
default:
63+
replicas: 1
64+
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
= Encryption
2+
3+
The quorum and client communication are encrypted by default via TLS. This requires the xref:secret-operator::index.adoc[Secret Operator] to be present in order to provide certificates. The utilized certificates can be changed in a top-level config.
4+
5+
[source,yaml]
6+
----
7+
include::example$example-cluster-tls-encryption.yaml[]
8+
----
9+
<1> The `tls.secretClass` refers to the client-to-server encryption. Defaults to the `tls` secret.
10+
<2> The `quorumTlsSecretClass` refers to the server-to-server quorum encryption. Defaults to the `tls` secret.
11+
12+
The `tls` secret is deployed from the xref:secret-operator::index.adoc[Secret Operator] and looks like this:
13+
14+
[source,yaml]
15+
----
16+
include::example$example-secret-operator-tls-secret.yaml[]
17+
----
18+
19+
You can create your own secrets and reference them e.g. in the `tls.secretClass` to use different certificates.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Usage guide
2+
3+
This section provides more in depth information about specific aspects of using the Stackable Operator for Apache ZooKeeper.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
= Monitoring
2+
3+
The managed ZooKeeper instances are automatically configured to export Prometheus metrics. See
4+
xref:home:operators:monitoring.adoc[] for more details.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
= Storage and resource configuration
2+
3+
== Storage for data volumes
4+
5+
You can mount volumes where data is stored by specifying https://kubernetes.io/docs/concepts/storage/persistent-volumes[PersistentVolumeClaims] for each individual role group:
6+
7+
[source,yaml]
8+
----
9+
servers:
10+
roleGroups:
11+
default:
12+
config:
13+
resources:
14+
storage:
15+
data:
16+
capacity: 2Gi
17+
----
18+
19+
In the above example, all ZooKeeper nodes in the default group will store data (the location of the property `dataDir`) on a `2Gi` volume.
20+
21+
By default, in case nothing is configured in the custom resource for a certain role group, each Pod will have a `1Gi` large local volume mount for the data location.
22+
23+
== Resource requests
24+
25+
// The "nightly" version is needed because the "include" directive searches for
26+
// files in the "stable" version by default.
27+
// TODO: remove the "nightly" version after the next platform release (current: 22.09)
28+
include::nightly@home:concepts:stackable_resource_requests.adoc[]
29+
30+
If no resource requests are configured explicitly, the ZooKeeper operator uses the following defaults:
31+
32+
[source,yaml]
33+
----
34+
servers:
35+
roleGroups:
36+
default:
37+
config:
38+
resources:
39+
memory:
40+
limit: '512Mi'
41+
cpu:
42+
max: '4'
43+
min: '500m'
44+
storage:
45+
data:
46+
capacity: '1Gi'
47+
----

0 commit comments

Comments
 (0)