This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from hello2mao/safe-delete-eip
Safe delete eip
- Loading branch information
Showing
5 changed files
with
199 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
startTime=`date +%Y%m%d-%H:%M` | ||
startTime_s=`date +%s` | ||
|
||
for i in `seq 1 2`; | ||
do | ||
kubectl create -f ./test/create-and-delete/nginx.yaml | ||
status="Check: " | ||
while true | ||
do | ||
if [ `kubectl get service |grep "nginx-service"|grep -v "pending"|wc -l` -eq 5 ]; then | ||
break | ||
fi | ||
sleep 10 | ||
status=$status"." | ||
echo $status | ||
done | ||
kubectl delete -f ./test/create-and-delete/nginx.yaml | ||
done | ||
|
||
endTime=`date +%Y%m%d-%H:%M` | ||
endTime_s=`date +%s` | ||
sumTime=$[ $endTime_s - $startTime_s ] | ||
echo "Test Finish: create-and-delete" "$startTime ---> $endTime" "Total: $sumTime s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-service-1 | ||
spec: | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
ports: | ||
- name: nginx-port | ||
port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-service-2 | ||
spec: | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
ports: | ||
- name: nginx-port | ||
port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-service-3 | ||
spec: | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
ports: | ||
- name: nginx-port | ||
port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-service-4 | ||
spec: | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
ports: | ||
- name: nginx-port | ||
port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-service-5 | ||
spec: | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
ports: | ||
- name: nginx-port | ||
port: 80 | ||
targetPort: 80 | ||
protocol: TCP | ||
--- | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
startTime=`date +%Y%m%d-%H:%M` | ||
startTime_s=`date +%s` | ||
|
||
echo "Test Nginx" | ||
kubectl create -f ./docs/controllers/service/examples/nginx.yaml | ||
status="Check: " | ||
while true | ||
do | ||
if [ `kubectl get service |grep "nginx-service"|grep -v "pending"|wc -l` -eq 1 ]; then | ||
break | ||
fi | ||
sleep 10 | ||
status=$status"." | ||
echo $status | ||
done | ||
kubectl delete -f ./docs/controllers/service/examples/nginx.yaml | ||
echo "Test Nginx success" | ||
echo "" | ||
|
||
echo "Test BLB allocate vip" | ||
kubectl create -f ./docs/controllers/service/examples/nginx-BLB-allocate-vip.yaml | ||
status="Check: " | ||
while true | ||
do | ||
if [ `kubectl get service |grep "nginx-service-blb-allocate-vip"|grep -v "pending"|wc -l` -eq 1 ]; then | ||
break | ||
fi | ||
sleep 10 | ||
status=$status"." | ||
echo $status | ||
done | ||
kubectl delete -f ./docs/controllers/service/examples/nginx-BLB-allocate-vip.yaml | ||
echo "Test BLB allocate vip success" | ||
echo "" | ||
|
||
echo "Test BLB support internal vpc" | ||
kubectl create -f ./docs/controllers/service/examples/nginx-BLB-support-internal-vpc.yaml | ||
status="Check: " | ||
while true | ||
do | ||
if [ `kubectl get service |grep "nginx-service-blb-internal-vpc"|grep -v "pending"|wc -l` -eq 1 ]; then | ||
break | ||
fi | ||
sleep 10 | ||
status=$status"." | ||
echo $status | ||
done | ||
kubectl delete -f ./docs/controllers/service/examples/nginx-BLB-support-internal-vpc.yaml | ||
echo "Test BLB support internal vpc success" | ||
echo "" | ||
|
||
endTime=`date +%Y%m%d-%H:%M` | ||
endTime_s=`date +%s` | ||
sumTime=$[ $endTime_s - $startTime_s ] | ||
echo "Test Finish: feature-test" "$startTime ---> $endTime" "Total: $sumTime s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
./test/feature-test/run.sh | ||
./test/create-and-delete/create-and-delete.sh |