Skip to content

Commit 7911ad5

Browse files
fhennigmaltesander
andauthored
Better CRD docs (#433)
* ~ * Updated changelog * ~ * Update rust/crd/src/lib.rs Co-authored-by: Malte Sander <[email protected]> * Update rust/crd/src/lib.rs Co-authored-by: Malte Sander <[email protected]> * regenerate charts --------- Co-authored-by: Malte Sander <[email protected]>
1 parent 2a8f17e commit 7911ad5

File tree

7 files changed

+160
-69
lines changed

7 files changed

+160
-69
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- More CRD documentation ([#433]).
10+
11+
### Changed
12+
13+
- `operator-rs` `0.56.1` -> `0.57.0` ([#433]).
14+
15+
[#433]: https://github.com/stackabletech/hdfs-operator/pull/433
16+
717
## [23.11.0] - 2023-11-24
818

919
### Added

Cargo.lock

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ serde = { version = "1.0", features = ["derive"] }
2020
serde_json = "1.0"
2121
serde_yaml = "0.9"
2222
snafu = "0.7"
23-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.56.1" }
23+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.57.0" }
2424
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.6.0" }
2525
strum = { version = "0.25", features = ["derive"] }
2626
tokio = { version = "1.29", features = ["full"] }

deploy/helm/hdfs-operator/crds/crds.yaml

+108-53
Large diffs are not rendered by default.

rust/crd/src/lib.rs

+34-9
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ pub enum Error {
6161
FragmentValidationFailure { source: ValidationError },
6262
}
6363

64+
/// An HDFS cluster stacklet. This resource is managed by the Stackable operator for Apache Hadoop HDFS.
65+
/// Find more information on how to use it and the resources that the operator generates in the
66+
/// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/hdfs/).
67+
///
68+
/// The CRD contains three roles: `nameNodes`, `dataNodes` and `journalNodes`.
6469
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
6570
#[kube(
6671
group = "hdfs.stackable.tech",
@@ -78,43 +83,63 @@ pub enum Error {
7883
)]
7984
#[serde(rename_all = "camelCase")]
8085
pub struct HdfsClusterSpec {
86+
/// Configuration that applies to all roles and role groups.
87+
/// This includes settings for authentication, logging and the ZooKeeper cluster to use.
88+
pub cluster_config: HdfsClusterConfig,
89+
90+
// no doc string - See ProductImage struct
8191
pub image: ProductImage,
92+
93+
// no doc string - See ClusterOperation struct
94+
#[serde(default)]
95+
pub cluster_operation: ClusterOperation,
96+
97+
// no doc string - See Role struct
8298
#[serde(default, skip_serializing_if = "Option::is_none")]
8399
pub name_nodes: Option<Role<NameNodeConfigFragment>>,
100+
101+
// no doc string - See Role struct
84102
#[serde(default, skip_serializing_if = "Option::is_none")]
85103
pub data_nodes: Option<Role<DataNodeConfigFragment>>,
104+
105+
// no doc string - See Role struct
86106
#[serde(default, skip_serializing_if = "Option::is_none")]
87107
pub journal_nodes: Option<Role<JournalNodeConfigFragment>>,
88-
// Cluster wide configuration
89-
pub cluster_config: HdfsClusterConfig,
90-
/// Cluster operations like pause reconciliation or cluster stop.
91-
#[serde(default)]
92-
pub cluster_operation: ClusterOperation,
93108
}
94109

95110
#[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)]
96111
#[serde(rename_all = "camelCase")]
97112
pub struct HdfsClusterConfig {
113+
/// `dfsReplication` is the factor of how many times a file will be replicated to different data nodes.
114+
/// The default is 3.
115+
/// You need at least the same amount of data nodes so each file can be replicated correctly, otherwise a warning will be printed.
98116
#[serde(default = "default_dfs_replication_factor")]
99117
pub dfs_replication: u8,
100-
/// Name of the Vector aggregator discovery ConfigMap.
118+
119+
/// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery).
101120
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.
121+
/// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator)
122+
/// to learn how to configure log aggregation with Vector.
102123
#[serde(skip_serializing_if = "Option::is_none")]
103124
pub vector_aggregator_config_map_name: Option<String>,
104-
/// Name of the ZooKeeper discovery config map.
125+
126+
/// Name of the [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery)
127+
/// for a ZooKeeper cluster.
105128
pub zookeeper_config_map_name: String,
129+
106130
/// This field controls which type of Service the Operator creates for this HdfsCluster:
107131
///
108132
/// * cluster-internal: Use a ClusterIP service
109133
///
110134
/// * external-unstable: Use a NodePort service
111135
///
112136
/// This is a temporary solution with the goal to keep yaml manifests forward compatible.
113-
/// In the future, this setting will control which ListenerClass <https://docs.stackable.tech/home/stable/listener-operator/listenerclass.html>
137+
/// In the future, this setting will control which [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html)
114138
/// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
115139
#[serde(default)]
116140
pub listener_class: CurrentlySupportedListenerClasses,
117-
/// Configuration to set up a cluster secured using Kerberos.
141+
142+
/// Settings related to user [authentication](DOCS_BASE_URL_PLACEHOLDER/usage-guide/security).
118143
pub authentication: Option<AuthenticationConfig>,
119144
}
120145

rust/crd/src/security.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct AuthenticationConfig {
77
/// Name of the SecretClass providing the tls certificates for the WebUIs.
88
#[serde(default = "default_tls_secret_class")]
99
pub tls_secret_class: String,
10-
/// Kerberos configuration
10+
/// Kerberos configuration.
1111
pub kerberos: KerberosConfig,
1212
}
1313

rust/operator-binary/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Opts {
4949
async fn main() -> anyhow::Result<()> {
5050
let opts = Opts::parse();
5151
match opts.cmd {
52-
Command::Crd => HdfsCluster::print_yaml_schema()?,
52+
Command::Crd => HdfsCluster::print_yaml_schema(built_info::CARGO_PKG_VERSION)?,
5353
Command::Run(ProductOperatorRun {
5454
product_config,
5555
watch_namespace,

0 commit comments

Comments
 (0)