Merge pull request #733 from andyzhangx/fix-e2e-test
test: add default namespace in examples to fix e2e test failure
This commit is contained in:
commit
59364a0008
4
Makefile
4
Makefile
@ -131,8 +131,8 @@ endif
|
|||||||
.PHONY: install-nfs-server
|
.PHONY: install-nfs-server
|
||||||
install-nfs-server:
|
install-nfs-server:
|
||||||
kubectl apply -f ./deploy/example/nfs-provisioner/nfs-server.yaml
|
kubectl apply -f ./deploy/example/nfs-provisioner/nfs-server.yaml
|
||||||
kubectl delete secret mount-options --ignore-not-found
|
kubectl delete secret mount-options -n default --ignore-not-found
|
||||||
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=4.1"
|
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=4.1" -n default
|
||||||
|
|
||||||
.PHONY: install-helm
|
.PHONY: install-helm
|
||||||
install-helm:
|
install-helm:
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: Pod
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-nfs-restored-cloning
|
name: nginx-nfs-restored-cloning
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
"kubernetes.io/os": linux
|
"kubernetes.io/os": linux
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: DaemonSet
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: daemonset-nfs-ephemeral
|
name: daemonset-nfs-ephemeral
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
|||||||
@ -3,6 +3,7 @@ apiVersion: v1
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: pvc-deployment-nfs
|
name: pvc-deployment-nfs
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany # In this example, multiple Pods consume the same PVC.
|
- ReadWriteMany # In this example, multiple Pods consume the same PVC.
|
||||||
@ -15,6 +16,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: deployment-nfs
|
name: deployment-nfs
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: Service
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nfs-server
|
name: nfs-server
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: nfs-server
|
app: nfs-server
|
||||||
spec:
|
spec:
|
||||||
@ -21,6 +22,7 @@ kind: Deployment
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nfs-server
|
name: nfs-server
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@ -5,6 +5,7 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io
|
pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io
|
||||||
name: pv-nginx
|
name: pv-nginx
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
capacity:
|
capacity:
|
||||||
storage: 10Gi
|
storage: 10Gi
|
||||||
@ -26,6 +27,7 @@ kind: PersistentVolumeClaim
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: pvc-nginx
|
name: pvc-nginx
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
@ -39,6 +41,7 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-nfs-example
|
name: nginx-nfs-example
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: nginx
|
- image: nginx
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: Pod
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-pod-inline-volume
|
name: nginx-pod-inline-volume
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
"kubernetes.io/os": linux
|
"kubernetes.io/os": linux
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: Pod
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-nfs
|
name: nginx-nfs
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
"kubernetes.io/os": linux
|
"kubernetes.io/os": linux
|
||||||
|
|||||||
@ -3,6 +3,7 @@ apiVersion: v1
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: pvc-nfs-dynamic
|
name: pvc-nfs-dynamic
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: PersistentVolumeClaim
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: pvc-nfs-static
|
name: pvc-nfs-static
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
|
|||||||
@ -3,6 +3,7 @@ kind: Pod
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-nfs-restored-snapshot
|
name: nginx-nfs-restored-snapshot
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
"kubernetes.io/os": linux
|
"kubernetes.io/os": linux
|
||||||
|
|||||||
@ -3,6 +3,7 @@ apiVersion: apps/v1
|
|||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: statefulset-nfs
|
name: statefulset-nfs
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: nginx
|
app: nginx
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@ -21,9 +21,9 @@ rollout_and_wait() {
|
|||||||
|
|
||||||
APPNAME=$(kubectl apply -f $1 | grep -E "^(:?daemonset|deployment|statefulset|pod)" | awk '{printf $1}')
|
APPNAME=$(kubectl apply -f $1 | grep -E "^(:?daemonset|deployment|statefulset|pod)" | awk '{printf $1}')
|
||||||
if [[ -n $(expr "${APPNAME}" : "\(daemonset\|deployment\|statefulset\|pod\)" || true) ]]; then
|
if [[ -n $(expr "${APPNAME}" : "\(daemonset\|deployment\|statefulset\|pod\)" || true) ]]; then
|
||||||
kubectl rollout status $APPNAME --watch --timeout=5m
|
kubectl rollout status $APPNAME --watch --timeout=5m -n default
|
||||||
else
|
else
|
||||||
kubectl wait "${APPNAME}" --for condition=ready --timeout=5m
|
kubectl wait "${APPNAME}" --for condition=ready --timeout=5m -n default
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user