Skip to content

Commit a19b8c8

Browse files
committed
Consolidate top level config (#326)
# Description Part of #289 Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
1 parent 92fac25 commit a19b8c8

File tree

18 files changed

+91
-55
lines changed

18 files changed

+91
-55
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ All notable changes to this project will be documented in this file.
88

99
- Deploy default and support custom affinities ([#319]).
1010

11+
### Changed
12+
13+
- `operator-rs` `0.36.0` -> `0.37.0` ([#326]).
14+
- [Breaking] Moved top level config option to `clusterConfig` ([#326]).
15+
1116
[#319]: https://github.com/stackabletech/hdfs-operator/pull/319
17+
[#326]: https://github.com/stackabletech/hdfs-operator/pull/326
1218

1319
## [23.1.0] - 2023-01-23
1420

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,26 @@ spec:
2424
properties:
2525
spec:
2626
properties:
27-
autoFormatFs:
28-
nullable: true
29-
type: boolean
27+
clusterConfig:
28+
properties:
29+
autoFormatFs:
30+
nullable: true
31+
type: boolean
32+
dfsReplication:
33+
format: uint8
34+
minimum: 0.0
35+
nullable: true
36+
type: integer
37+
vectorAggregatorConfigMapName:
38+
description: Name of the Vector aggregator discovery ConfigMap. It must contain the key `ADDRESS` with the address of the Vector aggregator.
39+
nullable: true
40+
type: string
41+
zookeeperConfigMapName:
42+
description: Name of the ZooKeeper discovery config map.
43+
type: string
44+
required:
45+
- zookeeperConfigMapName
46+
type: object
3047
dataNodes:
3148
nullable: true
3249
properties:
@@ -1408,11 +1425,6 @@ spec:
14081425
required:
14091426
- roleGroups
14101427
type: object
1411-
dfsReplication:
1412-
format: uint8
1413-
minimum: 0.0
1414-
nullable: true
1415-
type: integer
14161428
image:
14171429
anyOf:
14181430
- required:
@@ -4181,16 +4193,9 @@ spec:
41814193
required:
41824194
- roleGroups
41834195
type: object
4184-
vectorAggregatorConfigMapName:
4185-
description: Name of the Vector aggregator discovery ConfigMap. It must contain the key `ADDRESS` with the address of the Vector aggregator.
4186-
nullable: true
4187-
type: string
4188-
zookeeperConfigMapName:
4189-
description: Name of the ZooKeeper discovery config map.
4190-
type: string
41914196
required:
4197+
- clusterConfig
41924198
- image
4193-
- zookeeperConfigMapName
41944199
type: object
41954200
required:
41964201
- spec

docs/modules/hdfs/examples/getting_started/hdfs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ spec:
77
image:
88
productVersion: 3.3.4
99
stackableVersion: 0.3.0
10-
zookeeperConfigMapName: simple-hdfs-znode
11-
dfsReplication: 3
10+
clusterConfig:
11+
zookeeperConfigMapName: simple-hdfs-znode
12+
dfsReplication: 1
1213
nameNodes:
1314
roleGroups:
1415
default:

docs/modules/hdfs/pages/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In the custom resource you can specify the number of replicas per role group (Na
2626

2727
* 2 NameNodes (HA)
2828
* 1 JournalNode
29-
* 1 DataNode (should match at least the `dfsReplication` factor)
29+
* 1 DataNode (should match at least the `clusterConfig.dfsReplication` factor)
3030

3131
== Supported Versions
3232

docs/modules/hdfs/pages/usage-guide/logging-log-aggregation.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ ConfigMap for the aggregator and by enabling the log agent:
66
[source,yaml]
77
----
88
spec:
9-
vectorAggregatorConfigMapName: vector-aggregator-discovery
9+
clusterConfig:
10+
vectorAggregatorConfigMapName: vector-aggregator-discovery
1011
nameNodes:
1112
config:
1213
logging:

rust/crd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version = "0.0.0-dev"
99
publish = false
1010

1111
[dependencies]
12-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.36.0" }
12+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.37.0" }
1313

1414
semver = "1.0"
1515
serde = { version = "1.0", features = ["derive"] }

rust/crd/src/affinity.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ spec:
5757
image:
5858
productVersion: 3.3.4
5959
stackableVersion: 0.2.0
60-
zookeeperConfigMapName: hdfs-zk
60+
clusterConfig:
61+
zookeeperConfigMapName: hdfs-zk
6162
journalNodes:
6263
roleGroups:
6364
default:
@@ -144,7 +145,8 @@ spec:
144145
image:
145146
productVersion: 3.3.4
146147
stackableVersion: 0.2.0
147-
zookeeperConfigMapName: hdfs-zk
148+
clusterConfig:
149+
zookeeperConfigMapName: hdfs-zk
148150
journalNodes:
149151
roleGroups:
150152
default:

rust/crd/src/lib.rs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,20 @@ pub enum Error {
6666
#[serde(rename_all = "camelCase")]
6767
pub struct HdfsClusterSpec {
6868
pub image: ProductImage,
69-
pub auto_format_fs: Option<bool>,
70-
pub dfs_replication: Option<u8>,
7169
#[serde(default, skip_serializing_if = "Option::is_none")]
7270
pub name_nodes: Option<Role<NameNodeConfigFragment>>,
7371
#[serde(default, skip_serializing_if = "Option::is_none")]
7472
pub data_nodes: Option<Role<DataNodeConfigFragment>>,
7573
#[serde(default, skip_serializing_if = "Option::is_none")]
7674
pub journal_nodes: Option<Role<JournalNodeConfigFragment>>,
75+
pub cluster_config: HdfsClusterConfig,
76+
}
77+
78+
#[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)]
79+
#[serde(rename_all = "camelCase")]
80+
pub struct HdfsClusterConfig {
81+
pub auto_format_fs: Option<bool>,
82+
pub dfs_replication: Option<u8>,
7783
/// Name of the Vector aggregator discovery ConfigMap.
7884
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.
7985
#[serde(skip_serializing_if = "Option::is_none")]
@@ -798,7 +804,7 @@ impl Configuration for NameNodeConfigFragment {
798804
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
799805
let mut config = BTreeMap::new();
800806
if file == HDFS_SITE_XML {
801-
if let Some(replication) = &resource.spec.dfs_replication {
807+
if let Some(replication) = &resource.spec.cluster_config.dfs_replication {
802808
config.insert(DFS_REPLICATION.to_string(), Some(replication.to_string()));
803809
}
804810
}
@@ -929,7 +935,7 @@ impl Configuration for DataNodeConfigFragment {
929935
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
930936
let mut config = BTreeMap::new();
931937
if file == HDFS_SITE_XML {
932-
if let Some(replication) = &resource.spec.dfs_replication {
938+
if let Some(replication) = &resource.spec.cluster_config.dfs_replication {
933939
config.insert(DFS_REPLICATION.to_string(), Some(replication.to_string()));
934940
}
935941
}
@@ -1072,7 +1078,8 @@ spec:
10721078
image:
10731079
productVersion: 3.3.4
10741080
stackableVersion: 0.2.0
1075-
zookeeperConfigMapName: hdfs-zk
1081+
clusterConfig:
1082+
zookeeperConfigMapName: hdfs-zk
10761083
dataNodes:
10771084
roleGroups:
10781085
default:
@@ -1110,7 +1117,8 @@ spec:
11101117
image:
11111118
productVersion: 3.3.4
11121119
stackableVersion: 0.2.0
1113-
zookeeperConfigMapName: hdfs-zk
1120+
clusterConfig:
1121+
zookeeperConfigMapName: hdfs-zk
11141122
dataNodes:
11151123
config:
11161124
resources:
@@ -1148,7 +1156,8 @@ spec:
11481156
image:
11491157
productVersion: 3.3.4
11501158
stackableVersion: 0.2.0
1151-
zookeeperConfigMapName: hdfs-zk
1159+
clusterConfig:
1160+
zookeeperConfigMapName: hdfs-zk
11521161
dataNodes:
11531162
roleGroups:
11541163
default:
@@ -1181,7 +1190,8 @@ spec:
11811190
image:
11821191
productVersion: 3.3.4
11831192
stackableVersion: 0.2.0
1184-
zookeeperConfigMapName: hdfs-zk
1193+
clusterConfig:
1194+
zookeeperConfigMapName: hdfs-zk
11851195
nameNodes:
11861196
roleGroups:
11871197
default:
@@ -1245,7 +1255,8 @@ spec:
12451255
image:
12461256
productVersion: 3.3.4
12471257
stackableVersion: 0.2.0
1248-
zookeeperConfigMapName: hdfs-zk
1258+
clusterConfig:
1259+
zookeeperConfigMapName: hdfs-zk
12491260
dataNodes:
12501261
config:
12511262
resources:
@@ -1299,7 +1310,8 @@ spec:
12991310
image:
13001311
productVersion: 3.3.4
13011312
stackableVersion: 0.2.0
1302-
zookeeperConfigMapName: hdfs-zk
1313+
clusterConfig:
1314+
zookeeperConfigMapName: hdfs-zk
13031315
dataNodes:
13041316
roleGroups:
13051317
default:

rust/operator-binary/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build = "build.rs"
1010
publish = false
1111

1212
[dependencies]
13-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.36.0" }
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.37.0" }
1414
stackable-hdfs-crd = { path = "../crd" }
1515
stackable-hdfs-operator = { path = "../operator" }
1616
anyhow = "1.0"
@@ -20,7 +20,7 @@ tracing = "0.1"
2020

2121
[build-dependencies]
2222
built = { version = "0.5", features = ["chrono", "git2"] }
23-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.36.0" }
23+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.37.0" }
2424
stackable-hdfs-crd = { path = "../crd" }
2525

2626
[[bin]]

0 commit comments

Comments
 (0)