Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(annotations): makes format of the annotation commands consistent #9665

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ For example, `my-cluster-kafka-0`.
. Use `kubectl annotate` to annotate the `Pod` resource in Kubernetes:
+
[source,shell,subs="+quotes,attributes+"]
kubectl annotate pod <cluster_name>-kafka-<index_number> strimzi.io/delete-pod-and-pvc=true
kubectl annotate pod <cluster_name>-kafka-<index_number> strimzi.io/delete-pod-and-pvc="true"

. Wait for the next reconciliation, when the annotated pod with the underlying persistent volume claim will be deleted and then recreated.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ For example, `my-cluster-zookeeper-0`.
. Use `kubectl annotate` to annotate the `Pod` resource in Kubernetes:
+
[source,shell,subs="+quotes,attributes+"]
kubectl annotate pod <cluster_name>-zookeeper-<index_number> strimzi.io/delete-pod-and-pvc=true
kubectl annotate pod <cluster_name>-zookeeper-<index_number> strimzi.io/delete-pod-and-pvc="true"

. Wait for the next reconciliation, when the annotated pod with the underlying persistent volume claim will be deleted and then recreated.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Task IDs are non-negative integers, starting from 0.
+
[source,shell,subs="+quotes"]
----
kubectl annotate KafkaConnector <kafka_connector_name> strimzi.io/restart-task=0
kubectl annotate KafkaConnector <kafka_connector_name> strimzi.io/restart-task="0"
----
+
In this example, task `0` is restarted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ kubectl get KafkaConnector
+
[source,shell,subs="+quotes"]
----
kubectl annotate KafkaConnector <kafka_connector_name> strimzi.io/restart=true
kubectl annotate KafkaConnector <kafka_connector_name> strimzi.io/restart="true"
----
+
The `restart` annotation is set to `true`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ To do so, refresh the optimization proposal to make sure it uses the latest clus
+
[source,shell,subs="+quotes"]
----
kubectl annotate kafkarebalance _<kafka_rebalance_resource_name>_ strimzi.io/rebalance=refresh
kubectl annotate kafkarebalance <kafka_rebalance_resource_name> strimzi.io/rebalance="refresh"
----

. Wait for the status of the optimization proposal to change to `ProposalReady`:
+
[source,shell,subs="+quotes"]
----
kubectl get kafkarebalance -o wide -w -n _<namespace>_
kubectl get kafkarebalance -o wide -w -n <namespace>
----
+
--
Expand All @@ -57,7 +57,7 @@ Annotate the `KafkaRebalance` resource in Kubernetes with `strimzi.io/rebalance=
+
[source,shell,subs="+quotes"]
----
kubectl annotate kafkarebalance _<kafka_rebalance_resource_name>_ strimzi.io/rebalance=approve
kubectl annotate kafkarebalance _<kafka_rebalance_resource_name>_ strimzi.io/rebalance="approve"
----

. The Cluster Operator detects the annotated resource and instructs Cruise Control to rebalance the Kafka cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kubectl describe kafkarebalance _rebalance-cr-name_
+
[source,shell,subs="+quotes"]
----
kubectl annotate kafkarebalance _rebalance-cr-name_ strimzi.io/rebalance=refresh
kubectl annotate kafkarebalance _rebalance-cr-name_ strimzi.io/rebalance="refresh"
----

. Check the status of the `KafkaRebalance` resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ NOTE: The performance of the Kafka cluster in the intermediate (stopped) state m
+
[source,shell,subs="+quotes"]
----
kubectl annotate kafkarebalance _rebalance-cr-name_ strimzi.io/rebalance=stop
kubectl annotate kafkarebalance _rebalance-cr-name_ strimzi.io/rebalance="stop"
----

. Check the status of the `KafkaRebalance` resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ The `<index_number>` assigned to a pod starts at zero and ends at the total numb
+
[source,shell,subs=+quotes]
----
kubectl annotate pod <cluster_name>-kafka-<index_number> strimzi.io/manual-rolling-update=true
kubectl annotate pod <cluster_name>-kafka-<index_number> strimzi.io/manual-rolling-update="true"

kubectl annotate pod <cluster_name>-zookeeper-<index_number> strimzi.io/manual-rolling-update=true
kubectl annotate pod <cluster_name>-zookeeper-<index_number> strimzi.io/manual-rolling-update="true"

kubectl annotate pod <cluster_name>-connect-<index_number> strimzi.io/manual-rolling-update=true
kubectl annotate pod <cluster_name>-connect-<index_number> strimzi.io/manual-rolling-update="true"

kubectl annotate pod <cluster_name>-mirrormaker2-<index_number> strimzi.io/manual-rolling-update=true
kubectl annotate pod <cluster_name>-mirrormaker2-<index_number> strimzi.io/manual-rolling-update="true"
----

. Wait for the next reconciliation to occur (every two minutes by default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ And for a MirrorMaker 2 cluster named _my-mm2-cluster_, the corresponding name i
.Annotating a StrimziPodSet
[source,shell,subs=+quotes]
----
kubectl annotate strimzipodset <cluster_name>-kafka strimzi.io/manual-rolling-update=true
kubectl annotate strimzipodset <cluster_name>-kafka strimzi.io/manual-rolling-update="true"

kubectl annotate strimzipodset <cluster_name>-zookeeper strimzi.io/manual-rolling-update=true
kubectl annotate strimzipodset <cluster_name>-zookeeper strimzi.io/manual-rolling-update="true"

kubectl annotate strimzipodset <cluster_name>-connect strimzi.io/manual-rolling-update=true
kubectl annotate strimzipodset <cluster_name>-connect strimzi.io/manual-rolling-update="true"

kubectl annotate strimzipodset <cluster_name>-mirrormaker2 strimzi.io/manual-rolling-update=true
kubectl annotate strimzipodset <cluster_name>-mirrormaker2 strimzi.io/manual-rolling-update="true"
----

. Wait for the next reconciliation to occur (every two minutes by default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The custom resource is created, but it is ignored.
+
[source,shell,subs="+quotes"]
----
kubectl annotate _<kind_of_custom_resource>_ _<name_of_custom_resource>_ strimzi.io/pause-reconciliation="true"
kubectl annotate <kind_of_custom_resource> <name_of_custom_resource> strimzi.io/pause-reconciliation="true"
----
+
For example, for the `KafkaConnect` custom resource:
Expand All @@ -41,7 +41,7 @@ kubectl annotate KafkaConnect my-connect strimzi.io/pause-reconciliation="true"
+
[source,shell,subs="+quotes"]
----
kubectl describe _<kind_of_custom_resource>_ _<name_of_custom_resource>_
kubectl describe <kind_of_custom_resource> <name_of_custom_resource>
----
+
The `type` condition changes to `ReconciliationPaused` at the `lastTransitionTime`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can perform this task if you are using unidirectional topic management.
+
[source,shell,subs="+quotes"]
----
kubectl annotate kafkatopic my-topic-1 strimzi.io/managed=false
kubectl annotate kafkatopic my-topic-1 strimzi.io/managed="false"
----
+
Specify the `metadata.name` of the topic in your `KafkaTopic` resource, which is `my-topic-1` in this example.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Stable feature gates have reached a beta level of maturity, and are generally en
Stable feature gates are production-ready, but they can still be disabled.

[id='ref-operator-use-kraft-feature-gate-{context}']
== UseKRaft feature gate
=== UseKRaft feature gate

The `UseKRaft` feature gate has a default state of _enabled_.

Expand All @@ -71,7 +71,7 @@ Controllers are responsible for coordinating operations and maintaining the clus
Using the `UseKRaft` feature gate requires the `KafkaNodePools` feature gate to be enabled as well.
To deploy a Kafka cluster in KRaft mode, you must use the `KafkaNodePool` resources.
For more details and examples, see xref:deploying-kafka-node-pools-{context}[].
The `Kafka` custom resource using KRaft mode must also have the annotation `strimzi.io/kraft: enabled`.
The `Kafka` custom resource using KRaft mode must also have the annotation `strimzi.io/kraft="enabled"`.

Currently, the KRaft mode in Strimzi has the following major limitations:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Install your own CA certificates and private keys instead of using the cluster a
By default, Strimzi uses the following xref:con-certificates-{context}[cluster CA and clients CA secrets], which are renewed automatically.

* Cluster CA secrets
** `_<cluster_name>_-cluster-ca`
** `_<cluster_name>_-cluster-ca-cert`
** `<cluster_name>-cluster-ca`
** `<cluster_name>-cluster-ca-cert`
* Clients CA secrets
** `_<cluster_name>_-clients-ca`
** `_<cluster_name>_-clients-ca-cert`
** `<cluster_name>-clients-ca`
** `<cluster_name>-clients-ca-cert`

To install your own certificates, use the same names.

Expand Down Expand Up @@ -46,63 +46,63 @@ If you don't have a cluster certificate in PKCS #12 format, use the OpenSSL TLS

.Example certificate generation command
[source,shell,subs="+quotes"]
openssl pkcs12 -export -in ca.crt -nokeys -out ca.p12 -password pass:__<P12_password>__ -caname ca.crt
openssl pkcs12 -export -in ca.crt -nokeys -out ca.p12 -password pass:<P12_password> -caname ca.crt

Replace _<P12_password>_ with your own password.
Replace <P12_password> with your own password.

.Procedure

. Create a new secret that contains the CA certificate.
+
.Client secret creation with a certificate in PEM format only
[source,shell,subs="+quotes"]
kubectl create secret generic _<cluster_name>_-clients-ca-cert --from-file=ca.crt=ca.crt
kubectl create secret generic <cluster_name>-clients-ca-cert --from-file=ca.crt=ca.crt
+
.Cluster secret creation with certificates in PEM and PKCS #12 format
[source,shell,subs="+quotes"]
----
kubectl create secret generic _<cluster_name>_-cluster-ca-cert \
kubectl create secret generic <cluster_name>-cluster-ca-cert \
--from-file=ca.crt=ca.crt \
--from-file=ca.p12=ca.p12 \
--from-literal=ca.password=_P12-PASSWORD_
----
+
Replace _<cluster_name>_ with the name of your Kafka cluster.
Replace <cluster_name> with the name of your Kafka cluster.

. Create a new secret that contains the private key.
+
[source,shell,subs="+quotes"]
kubectl create secret generic _CA-KEY-SECRET_ --from-file=ca.key=ca.key
kubectl create secret generic <ca_key_secret> --from-file=ca.key=ca.key

. Label the secrets.
+
[source,shell,subs="+quotes"]
----
kubectl label secret _CA-CERTIFICATE-SECRET_ strimzi.io/kind=Kafka strimzi.io/cluster=_<cluster_name>_
kubectl label secret <ca_certificate_secret> strimzi.io/kind=Kafka strimzi.io/cluster="<cluster_name>"
----
+
[source,shell,subs="+quotes"]
----
kubectl label secret _CA-KEY-SECRET_ strimzi.io/kind=Kafka strimzi.io/cluster=_<cluster_name>_
kubectl label secret <ca_key_secret> strimzi.io/kind=Kafka strimzi.io/cluster="<cluster_name>"
----
+
* Label `strimzi.io/kind=Kafka` identifies the Kafka custom resource.
* Label `strimzi.io/cluster=_<cluster_name>_` identifies the Kafka cluster.
* Label `strimzi.io/cluster="<cluster_name>"` identifies the Kafka cluster.

. Annotate the secrets
+
[source,shell,subs="+quotes"]
----
kubectl annotate secret _CA-CERTIFICATE-SECRET_ strimzi.io/ca-cert-generation=_CA-CERTIFICATE-GENERATION_
kubectl annotate secret <ca_certificate_secret> strimzi.io/ca-cert-generation="<ca_certificate_generation>"
----
+
[source,shell,subs="+quotes"]
----
kubectl annotate secret _CA-KEY-SECRET_ strimzi.io/ca-key-generation=_CA-KEY-GENERATION_
kubectl annotate secret <ca_key_secret> strimzi.io/ca-key-generation="<ca_key_generation>"
----
+
* Annotation `strimzi.io/ca-cert-generation=_CA-CERTIFICATE-GENERATION_` defines the generation of a new CA certificate.
* Annotation `strimzi.io/ca-key-generation=_CA-KEY-GENERATION_` defines the generation of a new CA key.
* Annotation `strimzi.io/ca-cert-generation="<ca_certificate_generation>"` defines the generation of a new CA certificate.
* Annotation `strimzi.io/ca-key-generation="<ca_key_generation>"` defines the generation of a new CA key.
+
Start from 0 (zero) as the incremental value (`strimzi.io/ca-cert-generation=0`) for your own CA certificate. Set a higher incremental value when you renew the certificates.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ In this procedure, we use a Kafka cluster named `my-cluster` within the `my-proj
.Renewing the Cluster CA secret
[source,shell]
----
kubectl annotate secret my-cluster-cluster-ca-cert -n my-project strimzi.io/force-renew=true
kubectl annotate secret my-cluster-cluster-ca-cert -n my-project strimzi.io/force-renew="true"

----
+
.Renewing the Clients CA secret
[source,shell]
----
kubectl annotate secret my-cluster-clients-ca-cert -n my-project strimzi.io/force-renew=true
kubectl annotate secret my-cluster-clients-ca-cert -n my-project strimzi.io/force-renew="true"
----

. At the next reconciliation, the Cluster Operator generates new certificates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Instead, follow the procedure for xref:renewing-your-own-ca-certificates-{contex
¦Annotate command

¦Cluster CA
¦_CLUSTER-NAME_-cluster-ca
m¦kubectl annotate secret _CLUSTER-NAME_-cluster-ca strimzi.io/force-replace=true
¦<cluster_name>-cluster-ca
m¦kubectl annotate secret <cluster_name>-cluster-ca strimzi.io/force-replace="true"

¦Clients CA
¦_CLUSTER-NAME_-clients-ca
m¦kubectl annotate secret _CLUSTER-NAME_-clients-ca strimzi.io/force-replace=true
¦<cluster_name>-clients-ca
m¦kubectl annotate secret <cluster_name>-clients-ca strimzi.io/force-replace="true"

|===

Expand Down