diff --git a/changelog.d/+scaledown-prep.internal.md b/changelog.d/+scaledown-prep.internal.md new file mode 100644 index 00000000000..32843a86a5d --- /dev/null +++ b/changelog.d/+scaledown-prep.internal.md @@ -0,0 +1 @@ +Updated `RolloutSpec` and operator setup. \ No newline at end of file diff --git a/mirrord/kube/src/api/kubernetes/rollout.rs b/mirrord/kube/src/api/kubernetes/rollout.rs index a99805df574..0b8b329ec22 100644 --- a/mirrord/kube/src/api/kubernetes/rollout.rs +++ b/mirrord/kube/src/api/kubernetes/rollout.rs @@ -38,6 +38,7 @@ pub struct RolloutStatus { #[derive(Clone, Debug, Deserialize, Serialize, Default)] #[serde(rename_all = "camelCase")] pub struct RolloutSpec { + pub replicas: Option, pub selector: LabelSelector, #[serde(deserialize_with = "rollout_pod_spec")] pub template: Option, diff --git a/mirrord/operator/src/setup.rs b/mirrord/operator/src/setup.rs index d100a228122..7df50e33422 100644 --- a/mirrord/operator/src/setup.rs +++ b/mirrord/operator/src/setup.rs @@ -539,29 +539,22 @@ impl OperatorRole { verbs: vec!["list".to_owned(), "get".to_owned()], ..Default::default() }, + // Allow for patching replicas and environment variables. + PolicyRule { + api_groups: Some(vec!["apps".to_owned()]), + resources: Some(vec!["deployments".to_owned(), "statefulsets".to_owned()]), + verbs: vec!["patch".to_owned()], + ..Default::default() + }, + // Allow for patching replicas and environment variables. + PolicyRule { + api_groups: Some(vec!["argoproj.io".to_owned()]), + resources: Some(vec!["rollouts".to_owned()]), + verbs: vec!["patch".to_owned()], + ..Default::default() + }, ]; - if sqs_splitting || kafka_splitting { - rules.extend([ - // For SQS/Kafka controller to temporarily change deployments to use changed - // queues. - PolicyRule { - api_groups: Some(vec!["apps".to_owned()]), - resources: Some(vec!["deployments".to_owned()]), - verbs: vec!["patch".to_owned()], - ..Default::default() - }, - // For SQS/Kafka controller to temporarily change Argo Rollouts to use changed - // queues. - PolicyRule { - api_groups: Some(vec!["argoproj.io".to_owned()]), - resources: Some(vec!["rollouts".to_owned()]), - verbs: vec!["patch".to_owned()], - ..Default::default() - }, - ]); - } - if kafka_splitting { rules.extend([ PolicyRule {