Skip to content

Commit e23dae7

Browse files
committed
run as root group (#241)
# Description run as root group instead of 1000. Tests on openshift: ``` --- PASS: kuttl (624.59s) --- PASS: kuttl/harness (0.00s) --- PASS: kuttl/harness/spark-pi-private-s3_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (119.82s) --- PASS: kuttl/harness/spark-history-server_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (206.96s) --- PASS: kuttl/harness/pyspark-ny-public-s3_openshift-true_spark-3.3.0-stackable0.0.0-dev (137.54s) --- PASS: kuttl/harness/spark-ny-public-s3_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (85.56s) --- PASS: kuttl/harness/spark-examples_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (42.68s) --- PASS: kuttl/harness/pyspark-ny-public-s3-image_openshift-true_spark-3.3.0-stackable0.0.0-dev_ny-tlc-report-0.1.0 (93.64s) --- PASS: kuttl/harness/spark-pi-public-s3_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (73.82s) --- PASS: kuttl/harness/logging_openshift-true_spark-3.3.0-stackable0.0.0-dev_ny-tlc-report-0.1.0_examples-3.3.0 (287.47s) --- PASS: kuttl/harness/resources_openshift-true_spark-3.3.0-stackable0.0.0-dev_examples-3.3.0 (110.78s) PASS ```
1 parent 48a499c commit e23dae7

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ All notable changes to this project will be documented in this file.
1313
- `operator-rs` `0.38.0` -> `0.41.0` ([#235]).
1414
- Use 0.0.0-dev product images for testing ([#236])
1515
- Use testing-tools 0.2.0 ([#236])
16+
- Run as root group ([#241]).
1617

1718
[#235]: https://github.com/stackabletech/spark-k8s-operator/pull/235
1819
[#236]: https://github.com/stackabletech/spark-k8s-operator/pull/236
1920
[#238]: https://github.com/stackabletech/spark-k8s-operator/pull/238
21+
[#241]: https://github.com/stackabletech/spark-k8s-operator/pull/241
2022

2123
## [23.4.0] - 2023-04-17
2224

rust/crd/src/constants.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ pub const HISTORY_CONFIG_FILE_NAME: &str = "spark-defaults.conf";
5151
pub const HISTORY_CONFIG_FILE_NAME_FULL: &str = "/stackable/spark/conf/spark-defaults.conf";
5252

5353
pub const SPARK_CLUSTER_ROLE: &str = "spark-k8s-clusterrole";
54+
pub const SPARK_UID: i64 = 1000;

rust/operator-binary/src/history_controller.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ fn build_stateful_set(
347347
))
348348
})
349349
.security_context(PodSecurityContext {
350-
run_as_user: Some(1000),
351-
run_as_group: Some(1000),
350+
run_as_user: Some(SPARK_UID),
351+
run_as_group: Some(0),
352352
fs_group: Some(1000),
353353
..PodSecurityContext::default()
354354
});

rust/operator-binary/src/spark_k8s_controller.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ fn build_spark_role_serviceaccount(
747747

748748
fn security_context() -> PodSecurityContext {
749749
PodSecurityContext {
750-
run_as_user: Some(1000),
751-
run_as_group: Some(1000),
750+
run_as_user: Some(SPARK_UID),
751+
run_as_group: Some(0),
752752
fs_group: Some(1000),
753753
..PodSecurityContext::default()
754754
}

0 commit comments

Comments
 (0)