File tree 6 files changed +14
-24
lines changed
6 files changed +14
-24
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# ##Usage###
4
4
# ## Switch k8 context
5
- # ./kc.sh {environment }
5
+ # ./kc.sh {context} {namespace }
6
6
7
- echo " USAGE : ./kc.sh {environment }"
7
+ echo " USAGE : ./kc.sh {blah.live.com} {migrateme }"
8
8
9
9
if [ -z " $1 " ]; then
10
10
echo " No argument present. Please pass k8 environment ex:'./kc.sh prelive'"
11
11
exit 0
12
12
fi
13
13
14
- kubectl config use-context " k8s.$1 .mytaxi.com"
14
+ kubectl config use-context " $1 "
15
+
16
+ if [ " $2 " ]; then
17
+ kubectl config set-context --current --namespace=$2
18
+ fi
15
19
16
- echo " USAGE : ./kc.sh {environment}"
Original file line number Diff line number Diff line change 2
2
3
3
# ##Usage###
4
4
# ## GET Deployments
5
- # ./kd.sh {servicename} {environment}
5
+ # ./kd.sh {servicename}
6
6
7
- echo " USAGE : ./kd.sh {servicename} {environment}"
7
+ echo " Please initialize context and namespace using kc.sh first!"
8
+ echo " USAGE : ./kd.sh {servicename}"
8
9
9
10
if [ -z " $1 " ]; then
10
11
echo " No argument present. Please pass k8 servicename ex:'./kl.sh bookingoptionsservice'"
11
12
exit 0
12
13
fi
13
14
14
- if [ " $2 " ]; then
15
- kubectl config use-context " k8s.$2 .mytaxi.com"
16
- fi
17
-
18
15
kubectl get deployments | grep $1
19
-
20
- echo " USAGE : ./kd.sh {servicename} {environment}"
Original file line number Diff line number Diff line change 4
4
# ## GET K8 ingress details
5
5
# ./ki.sh {servicename}
6
6
7
+ echo " Please initialize context and namespace using kc.sh first!"
7
8
8
9
if [ -z " $1 " ]; then
9
10
echo " No argument present. Please pass k8 servicename ex:'./ki.sh bookingoptionsservice'"
10
11
exit 0
11
12
fi
12
13
13
- if [ " $2 " ]; then
14
- kubectl config use-context " k8s.$2 .mytaxi.com"
15
- fi
16
-
17
14
kubectl describe ingress $1
Original file line number Diff line number Diff line change 4
4
# ./kl.sh {servicename} {last n lines from logs} {search by this word in logs}
5
5
# ./kl.sh {servicename} 0 {search by this word in whole logs}
6
6
7
+ echo " Please initialize context and namespace using kc.sh first!"
7
8
8
9
if [ -z " $1 " ]; then
9
10
echo " No argument present. Please pass k8 servicename ex:'./kl.sh bookingoptionsservice'"
Original file line number Diff line number Diff line change 2
2
3
3
# ##Usage###
4
4
# ## GET LOGS without quiting
5
- # ./klf.sh {deployment} {environment}
5
+ # ./klf.sh {deployment}
6
6
7
+ echo " Please initialize context and namespace using kc.sh first!"
7
8
8
9
if [ -z " $1 " ]; then
9
10
echo " No argument present. Please pass k8 deployment ex:'./klf.sh bookingoptionsservice-1223'"
10
11
exit 0
11
12
fi
12
13
13
- if [ " $2 " ]; then
14
- kubectl config use-context " k8s.$2 .mytaxi.com"
15
- fi
16
-
17
14
pods=" $( kubectl get pods --no-headers -o custom-columns=' :metadata.name' | grep $1 ) "
18
15
19
16
for podname in $pods
20
17
do
21
18
kubectl logs $podname -f
22
19
done
23
20
24
- echo " \n\n\n --------------------- Usage"
25
- echo " ./klf.sh {deployment} {environment}"
26
- echo " \n ---------------------"
You can’t perform that action at this time.
0 commit comments