Skip to content

[Merged by Bors] - BUGFIX: Revert openshift-specific settings and assign service account to history pods. #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed

- Revert openshift settings ([#207])
- BUGFIX: assign service account to history pods ([#207])

[#207]: https://github.com/stackabletech/spark-k8s-operator/pull/207

## [23.1.0] - 2023-01-23

### Added

- Create and manage history servers ([#187])
Expand Down
18 changes: 2 additions & 16 deletions deploy/helm/spark-k8s-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000
#
# OpenShift 4.11 replaces the PodSecurityPolicy with a new pod security
# admission mechanism as described in this blog post [1].
# This requires Pods to explicitely specify the securityContext.
#
# [1]: https://cloud.redhat.com/blog/pod-security-admission-in-openshift-4.11
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
runAsUser: 1000

securityContext: {}

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down
3 changes: 3 additions & 0 deletions rust/operator-binary/src/history_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ pub async fn reconcile(shs: Arc<SparkHistoryServer>, ctx: Arc<Ctx>) -> Result<Ac
&rgr,
s3_log_dir.as_ref().unwrap(),
&config.resources,
&serviceaccount,
)?;
cluster_resources
.add(client, &sts)
Expand Down Expand Up @@ -255,6 +256,7 @@ fn build_stateful_set(
rolegroupref: &RoleGroupRef<SparkHistoryServer>,
s3_log_dir: &S3LogDir,
resources: &Resources<HistoryStorageConfig, NoRuntimeLimits>,
serviceaccount: &ServiceAccount,
) -> Result<StatefulSet, Error> {
let container_name = "spark-history";
let container = ContainerBuilder::new(container_name)
Expand All @@ -274,6 +276,7 @@ fn build_stateful_set(
.build();

let template = PodBuilder::new()
.service_account_name(serviceaccount.name_unchecked())
.add_container(container)
.image_pull_secrets_from_product_image(resolved_product_image)
.add_volume(
Expand Down