Skip to content

Commit 1fc4224

Browse files
committed
Remove SPARK_DAEMON_JAVA_OPTS
1 parent c0a50c4 commit 1fc4224

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

CHANGELOG.md

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

1414
- `vector` `0.26.0` -> `0.31.0` ([#269]).
1515
- `operator-rs` `0.44.0` -> `0.45.1` ([#267]).
16+
- Removed usages of SPARK_DAEMON_JAVA_OPTS since it's not a reliable way to pass extra JVM options ([#272]).
1617

1718
[#267]: https://github.com/stackabletech/spark-k8s-operator/pull/267
1819
[#268]: https://github.com/stackabletech/spark-k8s-operator/pull/268

rust/crd/src/lib.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -659,18 +659,6 @@ impl SparkApplication {
659659
value_from: None,
660660
});
661661
}
662-
if let Some(s3logdir) = s3logdir {
663-
if tlscerts::tls_secret_name(&s3logdir.bucket.connection).is_some() {
664-
e.push(EnvVar {
665-
name: "SPARK_DAEMON_JAVA_OPTS".to_string(),
666-
value: Some(format!(
667-
"-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}/truststore.p12 -Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD} -Djavax.net.ssl.trustStoreType=pkcs12"
668-
)),
669-
value_from: None,
670-
});
671-
}
672-
}
673-
674662
e
675663
}
676664

rust/operator-binary/src/history_controller.rs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -618,25 +618,30 @@ fn env_vars(s3logdir: &S3LogDir) -> Vec<EnvVar> {
618618
value: Some("/stackable/spark/extra-jars/*".into()),
619619
value_from: None,
620620
});
621+
622+
let mut history_opts = vec![
623+
format!("-Dlog4j.configurationFile={VOLUME_MOUNT_PATH_LOG_CONFIG}/{LOG4J2_CONFIG_FILE}"),
624+
format!(
625+
"-Djava.security.properties={VOLUME_MOUNT_PATH_CONFIG}/{JVM_SECURITY_PROPERTIES_FILE}"
626+
),
627+
];
628+
if tlscerts::tls_secret_name(&s3logdir.bucket.connection).is_some() {
629+
history_opts.extend(
630+
vec![
631+
format!("-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}/truststore.p12"),
632+
format!("-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}"),
633+
format!("-Djavax.net.ssl.trustStoreType=pkcs12"),
634+
]
635+
.into_iter(),
636+
);
637+
}
638+
621639
vars.push(EnvVar {
622640
name: "SPARK_HISTORY_OPTS".to_string(),
623-
value: Some(vec![
624-
format!("-Dlog4j.configurationFile={VOLUME_MOUNT_PATH_LOG_CONFIG}/{LOG4J2_CONFIG_FILE}"),
625-
format!("-Djava.security.properties={VOLUME_MOUNT_PATH_CONFIG}/{JVM_SECURITY_PROPERTIES_FILE}"),
626-
].join(" ")),
641+
value: Some(history_opts.join(" ")),
627642
value_from: None,
628643
});
629644
// if TLS is enabled build truststore
630-
if tlscerts::tls_secret_name(&s3logdir.bucket.connection).is_some() {
631-
vars.push(EnvVar {
632-
name: "SPARK_DAEMON_JAVA_OPTS".to_string(),
633-
value: Some(format!(
634-
"-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}/truststore.p12 -Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD} -Djavax.net.ssl.trustStoreType=pkcs12"
635-
)),
636-
value_from: None,
637-
});
638-
}
639-
640645
vars
641646
}
642647

0 commit comments

Comments
 (0)