feat: Allow replicas to be set to zero
Noticed in !49 (comment 294456431).
When I set :
kubectl scale --replicas=0 deployments/production -n minimal-ruby-app-4349298-production
and then I set PRODUCTION_REPLICAS
to 0
(or REPLICAS to 0
) and run a pipeline, I expect that my resultant Deployment
to be deployed with zero replicas.
Manual QA
- Before:
$ kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 1/1 1 1 8d
- Test with
PRODUCTION_REPLICAS
0
https://staging.gitlab.com/hello-staging/minimal-ruby-app/pipelines/12716105
Both 50% and 100% had 0 replicas as expected:
kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 0/0 0 0 8d
- Test with
PRODUCTION_REPLICAS
1
https://staging.gitlab.com/hello-staging/minimal-ruby-app/pipelines/12716106
Both 50% and 100% had 1 replicas as expected:
$ kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 1/1 1 1 8d
- Test with
PRODUCTION_REPLICAS
2
25% had 1 replica as expected:
$ kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 1/1 1 1 8d
50% had 1 replica as expected:
$ kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 1/1 1 1 8d
100$ had 2 replicas as expected:
$ kc get deployment production -n minimal-ruby-app-4349298-production
NAME READY UP-TO-DATE AVAILABLE AGE
production 2/2 2 2 8d
Edited by 🤖 GitLab Bot 🤖