Skip to content

Commit 266ac35

Browse files
adwk67razvan
andcommitted
BUGFIX: Revert openshift-specific settings and assign service account to history pods. (#207)
# Description Openshift-specific settings are no longer needed as operators will be packaged with olm for OS clusters. Co-authored-by: Razvan-Daniel Mihai <[email protected]>
1 parent 38073d9 commit 266ac35

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

CHANGELOG.md

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

55
## [Unreleased]
66

7+
### Changed
8+
9+
- Revert openshift settings ([#207])
10+
- BUGFIX: assign service account to history pods ([#207])
11+
12+
[#207]: https://github.com/stackabletech/spark-k8s-operator/pull/207
13+
14+
## [23.1.0] - 2023-01-23
15+
716
### Added
817

918
- Create and manage history servers ([#187])

deploy/helm/spark-k8s-operator/values.yaml

+2-16
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,8 @@ podAnnotations: {}
2121

2222
podSecurityContext: {}
2323
# fsGroup: 2000
24-
#
25-
# OpenShift 4.11 replaces the PodSecurityPolicy with a new pod security
26-
# admission mechanism as described in this blog post [1].
27-
# This requires Pods to explicitely specify the securityContext.
28-
#
29-
# [1]: https://cloud.redhat.com/blog/pod-security-admission-in-openshift-4.11
30-
securityContext:
31-
capabilities:
32-
drop:
33-
- ALL
34-
readOnlyRootFilesystem: false
35-
allowPrivilegeEscalation: false
36-
seccompProfile:
37-
type: RuntimeDefault
38-
runAsNonRoot: true
39-
runAsUser: 1000
24+
25+
securityContext: {}
4026

4127
resources: {}
4228
# We usually recommend not to specify default resources and to leave this as a conscious

rust/operator-binary/src/history_controller.rs

+3
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ pub async fn reconcile(shs: Arc<SparkHistoryServer>, ctx: Arc<Ctx>) -> Result<Ac
202202
&rgr,
203203
s3_log_dir.as_ref().unwrap(),
204204
&config.resources,
205+
&serviceaccount,
205206
)?;
206207
cluster_resources
207208
.add(client, &sts)
@@ -255,6 +256,7 @@ fn build_stateful_set(
255256
rolegroupref: &RoleGroupRef<SparkHistoryServer>,
256257
s3_log_dir: &S3LogDir,
257258
resources: &Resources<HistoryStorageConfig, NoRuntimeLimits>,
259+
serviceaccount: &ServiceAccount,
258260
) -> Result<StatefulSet, Error> {
259261
let container_name = "spark-history";
260262
let container = ContainerBuilder::new(container_name)
@@ -274,6 +276,7 @@ fn build_stateful_set(
274276
.build();
275277

276278
let template = PodBuilder::new()
279+
.service_account_name(serviceaccount.name_unchecked())
277280
.add_container(container)
278281
.image_pull_secrets_from_product_image(resolved_product_image)
279282
.add_volume(

0 commit comments

Comments
 (0)