2 ##############################################################################
3 # Copyright (c) 2019 Huawei Tech and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 NGINXDEP=~/testk8s-nginx.yaml
13 cat <<EOF > "${NGINXDEP}"
18 name: nginx-deployment
39 #check if nginx is already deployed
40 if ! kubectl get pods | grep nginx; then
41 kubectl create -f ~/testk8s-nginx.yaml
44 #To check whether the deployment is succesesfull
46 while [ $retry -gt 0 ]
48 if [ 2 == "$(kubectl get pods | grep -c -e STATUS -e Running)" ]; then
54 [ $retry -gt 0 ] || exit 1