Skip to content

Commit 30e441f

Browse files
committed
Added explicit PodSecurityContext to have write access to the data vo… (#406)
…lumes. ## Description Tested on Azure and with Kind.
1 parent 93cc920 commit 30e441f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
- Enabled Prometheus scraping ([#380]).
1010
- ZookeeperZnode.spec.clusterRef.namespace now defaults to .metadata.namespace ([#382]).
11+
- PodSecurityContext.fsGroup to allow write access to mounted volumes ([406]).
1112

1213
### Changed
1314

@@ -22,6 +23,7 @@ All notable changes to this project will be documented in this file.
2223
[#380]: https://github.com/stackabletech/zookeeper-operator/pull/380
2324
[#382]: https://github.com/stackabletech/zookeeper-operator/pull/382
2425
[#384]: https://github.com/stackabletech/zookeeper-operator/pull/384
26+
[#406]: https://github.com/stackabletech/zookeeper-operator/pull/406
2527

2628
## [0.8.0] - 2021-12-22
2729

rust/operator-binary/src/zk_controller.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ use stackable_operator::{
2121
apps::v1::{StatefulSet, StatefulSetSpec},
2222
core::v1::{
2323
ConfigMap, ConfigMapVolumeSource, EnvVar, EnvVarSource, ExecAction,
24-
ObjectFieldSelector, PersistentVolumeClaim, PersistentVolumeClaimSpec, Probe,
25-
ResourceRequirements, SecurityContext, Service, ServicePort, ServiceSpec, Volume,
24+
ObjectFieldSelector, PersistentVolumeClaim, PersistentVolumeClaimSpec,
25+
PodSecurityContext, Probe, ResourceRequirements, SecurityContext, Service,
26+
ServicePort, ServiceSpec, Volume,
2627
},
2728
},
2829
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::LabelSelector},
@@ -496,6 +497,10 @@ fn build_server_rolegroup_statefulset(
496497
}),
497498
..Volume::default()
498499
})
500+
.security_context(PodSecurityContext {
501+
fs_group: Some(1000),
502+
..PodSecurityContext::default()
503+
})
499504
.build_template(),
500505
volume_claim_templates: Some(vec![PersistentVolumeClaim {
501506
metadata: ObjectMeta {

0 commit comments

Comments
 (0)