mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Set RC's pod template TerminationGracePeriodSeconds to 0 in test-cmd.sh test data
This commit is contained in:
@@ -697,10 +697,10 @@ __EOF__
|
||||
## 6. kubectl autoscale --save-config should generate configuration annotation
|
||||
# Pre-Condition: no RC exists, then create the rc "frontend", which shouldn't have configuration annotation
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
! [[ "$(kubectl get rc frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]]
|
||||
# Command: autoscale rc "frontend"
|
||||
kubectl autoscale -f examples/guestbook/frontend-controller.yaml --save-config "${kube_flags[@]}" --max=2
|
||||
kubectl autoscale -f hack/testdata/frontend-controller.yaml --save-config "${kube_flags[@]}" --max=2
|
||||
# Post-Condition: hpa "frontend" has configuration annotation
|
||||
[[ "$(kubectl get hpa frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]]
|
||||
# Clean up
|
||||
@@ -989,7 +989,7 @@ __EOF__
|
||||
# Pre-condition: no replication controller exists
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl delete rc frontend "${kube_flags[@]}"
|
||||
# Post-condition: no pods from frontend controller
|
||||
kube::test::get_object_assert 'pods -l "name=frontend"' "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
@@ -998,7 +998,7 @@ __EOF__
|
||||
# Pre-condition: no replication controller exists
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
# Post-condition: frontend replication controller is created
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:'
|
||||
# Describe command should print detailed information
|
||||
@@ -1034,7 +1034,7 @@ __EOF__
|
||||
# Pre-condition: 3 replicas
|
||||
kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3'
|
||||
# Command
|
||||
kubectl scale --replicas=2 -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl scale --replicas=2 -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
# Post-condition: 2 replicas
|
||||
kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2'
|
||||
# Clean-up
|
||||
@@ -1081,7 +1081,7 @@ __EOF__
|
||||
kubectl delete deployment/nginx-deployment service/nginx-deployment "${kube_flags[@]}"
|
||||
|
||||
### Expose replication controller as service
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
# Pre-condition: 3 replicas
|
||||
kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3'
|
||||
# Command
|
||||
@@ -1151,7 +1151,7 @@ __EOF__
|
||||
# Pre-condition: no replication controller exists
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f examples/guestbook/redis-slave-controller.yaml "${kube_flags[@]}"
|
||||
# Post-condition: frontend and redis-slave
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:'
|
||||
@@ -1168,10 +1168,10 @@ __EOF__
|
||||
# Pre-condition: no replication controller exists
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl create -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}"
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:'
|
||||
# autoscale 1~2 pods, CPU utilization 70%, rc specified by file
|
||||
kubectl autoscale -f examples/guestbook/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70
|
||||
kubectl autoscale -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70
|
||||
kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70'
|
||||
kubectl delete hpa frontend "${kube_flags[@]}"
|
||||
# autoscale 2~3 pods, default CPU utilization (80%), rc specified by name
|
||||
|
Reference in New Issue
Block a user