Skip to content

Commit 3f0d9a3

Browse files
committed
remove jmx agent and metrics ports
1 parent ec416eb commit 3f0d9a3

File tree

5 files changed

+22
-53
lines changed

5 files changed

+22
-53
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ All notable changes to this project will be documented in this file.
2121
by `FILE_LOG_DIRECTORY` (or via `--file-log-directory <DIRECTORY>`).
2222
- Replace stackable-operator `print_startup_string` with `tracing::info!` with fields.
2323
- BREAKING: Inject the vector aggregator address into the vector config using the env var `VECTOR_AGGREGATOR_ADDRESS` instead
24-
of having the operator write it to the vector config ([#671]).
24+
of having the operator write it to the vector config ([#671]).
2525
- test: Bump to Vector `0.46.1` ([#677]).
2626
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#683])
2727
- The `runAsUser` and `runAsGroup` fields will not be set anymore by the operator
2828
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
2929
- This is marked as breaking because tools and policies might exist, which require these fields to be set
3030
- Use versioned common structs ([#684]).
31+
- BREAKING: the JMX exporter has been an replaced with the built-in Prometheus servlet ([#694]).
3132

3233
### Fixed
3334

@@ -48,6 +49,7 @@ All notable changes to this project will be documented in this file.
4849
[#683]: https://github.com/stackabletech/hdfs-operator/pull/683
4950
[#684]: https://github.com/stackabletech/hdfs-operator/pull/684
5051
[#693]: https://github.com/stackabletech/hdfs-operator/pull/693
52+
[#694]: https://github.com/stackabletech/hdfs-operator/pull/694
5153

5254
## [25.3.0] - 2025-03-21
5355

rust/operator-binary/src/config/jvm.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ pub fn construct_role_specific_jvm_args(
5656
kerberos_enabled: bool,
5757
resources: Option<&ResourceRequirements>,
5858
config_dir: &str,
59-
metrics_port: u16,
6059
) -> Result<String, Error> {
6160
let mut jvm_args = Vec::new();
6261

@@ -77,10 +76,9 @@ pub fn construct_role_specific_jvm_args(
7776
jvm_args.push(format!("-Xmx{heap}"));
7877
}
7978

80-
jvm_args.extend([
81-
format!("-Djava.security.properties={config_dir}/{JVM_SECURITY_PROPERTIES_FILE}"),
82-
format!("-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={metrics_port}:/stackable/jmx/{hdfs_role}.yaml")
83-
]);
79+
jvm_args.extend([format!(
80+
"-Djava.security.properties={config_dir}/{JVM_SECURITY_PROPERTIES_FILE}"
81+
)]);
8482
if kerberos_enabled {
8583
jvm_args.push(format!(
8684
"-Djava.security.krb5.conf={KERBEROS_CONTAINER_PATH}/krb5.conf"
@@ -101,7 +99,7 @@ pub fn construct_role_specific_jvm_args(
10199
mod tests {
102100

103101
use super::*;
104-
use crate::{container::ContainerConfig, crd::constants::DEFAULT_NAME_NODE_METRICS_PORT};
102+
use crate::container::ContainerConfig;
105103

106104
#[test]
107105
fn test_global_jvm_args() {
@@ -135,8 +133,7 @@ mod tests {
135133
jvm_config,
136134
"-Xms819m \
137135
-Xmx819m \
138-
-Djava.security.properties=/stackable/config/security.properties \
139-
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=8183:/stackable/jmx/namenode.yaml"
136+
-Djava.security.properties=/stackable/config/security.properties"
140137
);
141138
}
142139

@@ -181,7 +178,6 @@ mod tests {
181178
format!(
182179
"-Xms34406m \
183180
-Djava.security.properties=/stackable/config/security.properties \
184-
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=8183:/stackable/jmx/namenode.yaml \
185181
-Djava.security.krb5.conf={KERBEROS_CONTAINER_PATH}/krb5.conf \
186182
-Dhttps.proxyHost=proxy.my.corp \
187183
-Djava.net.preferIPv4Stack=true \
@@ -207,7 +203,6 @@ mod tests {
207203
kerberos_enabled,
208204
resources.as_ref(),
209205
"/stackable/config",
210-
DEFAULT_NAME_NODE_METRICS_PORT,
211206
)
212207
.unwrap()
213208
}

rust/operator-binary/src/container.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ use crate::{
6161
AnyNodeConfig, DataNodeContainer, HdfsNodeRole, HdfsPodRef, NameNodeContainer,
6262
UpgradeState,
6363
constants::{
64-
DATANODE_ROOT_DATA_DIR_PREFIX, DEFAULT_DATA_NODE_METRICS_PORT,
65-
DEFAULT_JOURNAL_NODE_METRICS_PORT, DEFAULT_NAME_NODE_METRICS_PORT, LISTENER_VOLUME_DIR,
66-
LISTENER_VOLUME_NAME, LIVENESS_PROBE_FAILURE_THRESHOLD,
67-
LIVENESS_PROBE_INITIAL_DELAY_SECONDS, LIVENESS_PROBE_PERIOD_SECONDS, LOG4J_PROPERTIES,
68-
NAMENODE_ROOT_DATA_DIR, READINESS_PROBE_FAILURE_THRESHOLD,
69-
READINESS_PROBE_INITIAL_DELAY_SECONDS, READINESS_PROBE_PERIOD_SECONDS,
70-
SERVICE_PORT_NAME_HTTP, SERVICE_PORT_NAME_HTTPS, SERVICE_PORT_NAME_IPC,
71-
SERVICE_PORT_NAME_RPC, STACKABLE_ROOT_DATA_DIR,
64+
DATANODE_ROOT_DATA_DIR_PREFIX, LISTENER_VOLUME_DIR, LISTENER_VOLUME_NAME,
65+
LIVENESS_PROBE_FAILURE_THRESHOLD, LIVENESS_PROBE_INITIAL_DELAY_SECONDS,
66+
LIVENESS_PROBE_PERIOD_SECONDS, LOG4J_PROPERTIES, NAMENODE_ROOT_DATA_DIR,
67+
READINESS_PROBE_FAILURE_THRESHOLD, READINESS_PROBE_INITIAL_DELAY_SECONDS,
68+
READINESS_PROBE_PERIOD_SECONDS, SERVICE_PORT_NAME_HTTP, SERVICE_PORT_NAME_HTTPS,
69+
SERVICE_PORT_NAME_IPC, SERVICE_PORT_NAME_RPC, STACKABLE_ROOT_DATA_DIR,
7270
},
7371
storage::DataNodeStorageConfig,
7472
v1alpha1,
@@ -164,8 +162,6 @@ pub enum ContainerConfig {
164162
web_ui_http_port_name: &'static str,
165163
/// Port name of the web UI HTTPS port, used for the liveness probe.
166164
web_ui_https_port_name: &'static str,
167-
/// The JMX Exporter metrics port.
168-
metrics_port: u16,
169165
},
170166
Zkfc {
171167
/// The provided custom container name.
@@ -1226,9 +1222,7 @@ wait_for_termination $!
12261222
resources: Option<&ResourceRequirements>,
12271223
) -> Result<String, Error> {
12281224
match self {
1229-
ContainerConfig::Hdfs {
1230-
role, metrics_port, ..
1231-
} => {
1225+
ContainerConfig::Hdfs { role, .. } => {
12321226
let cvd = ContainerVolumeDirs::from(role);
12331227
let config_dir = cvd.final_config();
12341228
construct_role_specific_jvm_args(
@@ -1238,7 +1232,6 @@ wait_for_termination $!
12381232
hdfs.has_kerberos_enabled(),
12391233
resources,
12401234
config_dir,
1241-
*metrics_port,
12421235
)
12431236
.with_context(|_| ConstructJvmArgumentsSnafu {
12441237
role: role.to_string(),
@@ -1379,7 +1372,6 @@ impl From<HdfsNodeRole> for ContainerConfig {
13791372
ipc_port_name: SERVICE_PORT_NAME_RPC,
13801373
web_ui_http_port_name: SERVICE_PORT_NAME_HTTP,
13811374
web_ui_https_port_name: SERVICE_PORT_NAME_HTTPS,
1382-
metrics_port: DEFAULT_NAME_NODE_METRICS_PORT,
13831375
},
13841376
HdfsNodeRole::Data => Self::Hdfs {
13851377
role,
@@ -1388,7 +1380,6 @@ impl From<HdfsNodeRole> for ContainerConfig {
13881380
ipc_port_name: SERVICE_PORT_NAME_IPC,
13891381
web_ui_http_port_name: SERVICE_PORT_NAME_HTTP,
13901382
web_ui_https_port_name: SERVICE_PORT_NAME_HTTPS,
1391-
metrics_port: DEFAULT_DATA_NODE_METRICS_PORT,
13921383
},
13931384
HdfsNodeRole::Journal => Self::Hdfs {
13941385
role,
@@ -1397,7 +1388,6 @@ impl From<HdfsNodeRole> for ContainerConfig {
13971388
ipc_port_name: SERVICE_PORT_NAME_RPC,
13981389
web_ui_http_port_name: SERVICE_PORT_NAME_HTTP,
13991390
web_ui_https_port_name: SERVICE_PORT_NAME_HTTPS,
1400-
metrics_port: DEFAULT_JOURNAL_NODE_METRICS_PORT,
14011391
},
14021392
}
14031393
}

rust/operator-binary/src/crd/constants.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,18 @@ pub const SERVICE_PORT_NAME_IPC: &str = "ipc";
1919
pub const SERVICE_PORT_NAME_HTTP: &str = "http";
2020
pub const SERVICE_PORT_NAME_HTTPS: &str = "https";
2121
pub const SERVICE_PORT_NAME_DATA: &str = "data";
22-
pub const SERVICE_PORT_NAME_METRICS: &str = "metrics";
2322

2423
pub const DEFAULT_LISTENER_CLASS: &str = "cluster-internal";
2524

26-
pub const DEFAULT_NAME_NODE_METRICS_PORT: u16 = 8183;
2725
pub const DEFAULT_NAME_NODE_HTTP_PORT: u16 = 9870;
2826
pub const DEFAULT_NAME_NODE_HTTPS_PORT: u16 = 9871;
2927
pub const DEFAULT_NAME_NODE_RPC_PORT: u16 = 8020;
3028

31-
pub const DEFAULT_DATA_NODE_METRICS_PORT: u16 = 8082;
3229
pub const DEFAULT_DATA_NODE_HTTP_PORT: u16 = 9864;
3330
pub const DEFAULT_DATA_NODE_HTTPS_PORT: u16 = 9865;
3431
pub const DEFAULT_DATA_NODE_DATA_PORT: u16 = 9866;
3532
pub const DEFAULT_DATA_NODE_IPC_PORT: u16 = 9867;
3633

37-
pub const DEFAULT_JOURNAL_NODE_METRICS_PORT: u16 = 8081;
3834
pub const DEFAULT_JOURNAL_NODE_HTTP_PORT: u16 = 8480;
3935
pub const DEFAULT_JOURNAL_NODE_HTTPS_PORT: u16 = 8481;
4036
pub const DEFAULT_JOURNAL_NODE_RPC_PORT: u16 = 8485;

rust/operator-binary/src/crd/mod.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,14 @@ use crate::crd::{
5353
constants::{
5454
APP_NAME, CORE_SITE_XML, DEFAULT_DATA_NODE_DATA_PORT,
5555
DEFAULT_DATA_NODE_GRACEFUL_SHUTDOWN_TIMEOUT, DEFAULT_DATA_NODE_HTTP_PORT,
56-
DEFAULT_DATA_NODE_HTTPS_PORT, DEFAULT_DATA_NODE_IPC_PORT, DEFAULT_DATA_NODE_METRICS_PORT,
57-
DEFAULT_DFS_REPLICATION_FACTOR, DEFAULT_JOURNAL_NODE_GRACEFUL_SHUTDOWN_TIMEOUT,
58-
DEFAULT_JOURNAL_NODE_HTTP_PORT, DEFAULT_JOURNAL_NODE_HTTPS_PORT,
59-
DEFAULT_JOURNAL_NODE_METRICS_PORT, DEFAULT_JOURNAL_NODE_RPC_PORT, DEFAULT_LISTENER_CLASS,
56+
DEFAULT_DATA_NODE_HTTPS_PORT, DEFAULT_DATA_NODE_IPC_PORT, DEFAULT_DFS_REPLICATION_FACTOR,
57+
DEFAULT_JOURNAL_NODE_GRACEFUL_SHUTDOWN_TIMEOUT, DEFAULT_JOURNAL_NODE_HTTP_PORT,
58+
DEFAULT_JOURNAL_NODE_HTTPS_PORT, DEFAULT_JOURNAL_NODE_RPC_PORT, DEFAULT_LISTENER_CLASS,
6059
DEFAULT_NAME_NODE_GRACEFUL_SHUTDOWN_TIMEOUT, DEFAULT_NAME_NODE_HTTP_PORT,
61-
DEFAULT_NAME_NODE_HTTPS_PORT, DEFAULT_NAME_NODE_METRICS_PORT, DEFAULT_NAME_NODE_RPC_PORT,
62-
DFS_REPLICATION, HADOOP_POLICY_XML, HDFS_SITE_XML, JVM_SECURITY_PROPERTIES_FILE,
63-
LISTENER_VOLUME_NAME, SERVICE_PORT_NAME_DATA, SERVICE_PORT_NAME_HTTP,
64-
SERVICE_PORT_NAME_HTTPS, SERVICE_PORT_NAME_IPC, SERVICE_PORT_NAME_METRICS,
65-
SERVICE_PORT_NAME_RPC, SSL_CLIENT_XML, SSL_SERVER_XML,
60+
DEFAULT_NAME_NODE_HTTPS_PORT, DEFAULT_NAME_NODE_RPC_PORT, DFS_REPLICATION,
61+
HADOOP_POLICY_XML, HDFS_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, LISTENER_VOLUME_NAME,
62+
SERVICE_PORT_NAME_DATA, SERVICE_PORT_NAME_HTTP, SERVICE_PORT_NAME_HTTPS,
63+
SERVICE_PORT_NAME_IPC, SERVICE_PORT_NAME_RPC, SSL_CLIENT_XML, SSL_SERVER_XML,
6664
},
6765
security::{AuthenticationConfig, KerberosConfig},
6866
storage::{
@@ -667,10 +665,6 @@ impl v1alpha1::HdfsCluster {
667665
pub fn ports(&self, role: &HdfsNodeRole) -> Vec<(String, u16)> {
668666
match role {
669667
HdfsNodeRole::Name => vec![
670-
(
671-
String::from(SERVICE_PORT_NAME_METRICS),
672-
DEFAULT_NAME_NODE_METRICS_PORT,
673-
),
674668
(
675669
String::from(SERVICE_PORT_NAME_RPC),
676670
DEFAULT_NAME_NODE_RPC_PORT,
@@ -688,10 +682,6 @@ impl v1alpha1::HdfsCluster {
688682
},
689683
],
690684
HdfsNodeRole::Data => vec![
691-
(
692-
String::from(SERVICE_PORT_NAME_METRICS),
693-
DEFAULT_DATA_NODE_METRICS_PORT,
694-
),
695685
(
696686
String::from(SERVICE_PORT_NAME_DATA),
697687
DEFAULT_DATA_NODE_DATA_PORT,
@@ -713,10 +703,6 @@ impl v1alpha1::HdfsCluster {
713703
},
714704
],
715705
HdfsNodeRole::Journal => vec![
716-
(
717-
String::from(SERVICE_PORT_NAME_METRICS),
718-
DEFAULT_JOURNAL_NODE_METRICS_PORT,
719-
),
720706
(
721707
String::from(SERVICE_PORT_NAME_RPC),
722708
DEFAULT_JOURNAL_NODE_RPC_PORT,

0 commit comments

Comments
 (0)