Skip to content

Commit

Permalink
chore: renmae pvc env name
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Feb 24, 2024
1 parent 823453f commit e1afd90
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ AMP_NATS_URL=nats://amp-nats.amp-system.svc:4222
# The workspace path.
AMP_WORKSPACE=/workspace

# The storage class name. The default is `standard`.
AMP_STORAGE_CLASS_NAME=standard
# Persistent Volume storage class name, the default is `standard`.
AMP_PV_STORAGE_CLASS_NAME=standard

# Persistent Volume access mode, the default is `ReadWriteOnce`.
AMP_PV_ACCESS_MODE=ReadWriteOnce
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.8.22"
version = "0.8.23"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/amphitheatre-app/amphitheatre"
Expand Down
10 changes: 7 additions & 3 deletions controllers/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ pub struct Config {
#[clap(long, env = "AMP_NATS_URL")]
pub nats_url: String,

/// The storage class name.
#[clap(long, env = "AMP_STORAGE_CLASS_NAME", default_value = "standard")]
pub storage_class_name: String,
/// Persistent Volume storage class name, the default is `standard`.
#[clap(long, env = "AMP_PV_STORAGE_CLASS_NAME", default_value = "standard")]
pub pv_storage_class_name: String,

/// Persistent Volume access mode, the default is `ReadWriteOnce`.
#[clap(long, env = "AMP_PV_ACCESS_MODE", default_value = "ReadWriteOnce")]
pub pv_access_mode: String,
}
1 change: 0 additions & 1 deletion resources/src/containers/syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ pub fn container(actor: &Actor, security_context: &Option<SecurityContext>) -> R
("once", once.as_str()),
];

// FIXME: get the syncer image from the config of context.
Ok(Container {
name: "syncer".to_string(),
image: Some(DEFAULT_SYNCER_IMAGE.to_string()),
Expand Down
5 changes: 3 additions & 2 deletions resources/src/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ fn new(actor: &Actor) -> Result<PersistentVolumeClaim> {
..Default::default()
},
spec: Some(PersistentVolumeClaimSpec {
access_modes: Some(vec!["ReadWriteMany".into()]),
// @TODO: Make access modes configurable
access_modes: Some(vec![env::var("AMP_PV_ACCESS_MODE").unwrap_or("ReadWriteOnce".into())]),
resources: Some(ResourceRequirements {
requests: Some(BTreeMap::from([("storage".into(), Quantity("1Gi".into()))])),
..Default::default()
}),
// @TODO: Make storage class name configurable
storage_class_name: env::var("AMP_STORAGE_CLASS_NAME").ok(),
storage_class_name: env::var("AMP_PV_STORAGE_CLASS_NAME").ok(),
volume_mode: Some("Filesystem".into()),
..Default::default()
}),
Expand Down

0 comments on commit e1afd90

Please sign in to comment.