Skip to content

Commit fcdec5a

Browse files
author
Rohith Kunnath
committed
Update with namespace and context
1 parent adcd57f commit fcdec5a

File tree

6 files changed

+14
-24
lines changed

6 files changed

+14
-24
lines changed

kc.sh

100644100755
+7-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
###Usage###
44
### Switch k8 context
5-
#./kc.sh {environment}
5+
#./kc.sh {context} {namespace}
66

7-
echo "USAGE : ./kc.sh {environment}"
7+
echo "USAGE : ./kc.sh {blah.live.com} {migrateme}"
88

99
if [ -z "$1" ]; then
1010
echo "No argument present. Please pass k8 environment ex:'./kc.sh prelive'"
1111
exit 0
1212
fi
1313

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
1519

16-
echo "USAGE : ./kc.sh {environment}"

kd.sh

100644100755
+3-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
###Usage###
44
### GET Deployments
5-
#./kd.sh {servicename} {environment}
5+
#./kd.sh {servicename}
66

7-
echo "USAGE : ./kd.sh {servicename} {environment}"
7+
echo "Please initialize context and namespace using kc.sh first!"
8+
echo "USAGE : ./kd.sh {servicename}"
89

910
if [ -z "$1" ]; then
1011
echo "No argument present. Please pass k8 servicename ex:'./kl.sh bookingoptionsservice'"
1112
exit 0
1213
fi
1314

14-
if [ "$2" ]; then
15-
kubectl config use-context "k8s.$2.mytaxi.com"
16-
fi
17-
1815
kubectl get deployments | grep $1
19-
20-
echo "USAGE : ./kd.sh {servicename} {environment}"

ki.sh

100644100755
+1-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
### GET K8 ingress details
55
#./ki.sh {servicename}
66

7+
echo "Please initialize context and namespace using kc.sh first!"
78

89
if [ -z "$1" ]; then
910
echo "No argument present. Please pass k8 servicename ex:'./ki.sh bookingoptionsservice'"
1011
exit 0
1112
fi
1213

13-
if [ "$2" ]; then
14-
kubectl config use-context "k8s.$2.mytaxi.com"
15-
fi
16-
1714
kubectl describe ingress $1

kl.sh

100644100755
+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#./kl.sh {servicename} {last n lines from logs} {search by this word in logs}
55
#./kl.sh {servicename} 0 {search by this word in whole logs}
66

7+
echo "Please initialize context and namespace using kc.sh first!"
78

89
if [ -z "$1" ]; then
910
echo "No argument present. Please pass k8 servicename ex:'./kl.sh bookingoptionsservice'"

klf.sh

100644100755
+2-8
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@
22

33
###Usage###
44
### GET LOGS without quiting
5-
#./klf.sh {deployment} {environment}
5+
#./klf.sh {deployment}
66

7+
echo "Please initialize context and namespace using kc.sh first!"
78

89
if [ -z "$1" ]; then
910
echo "No argument present. Please pass k8 deployment ex:'./klf.sh bookingoptionsservice-1223'"
1011
exit 0
1112
fi
1213

13-
if [ "$2" ]; then
14-
kubectl config use-context "k8s.$2.mytaxi.com"
15-
fi
16-
1714
pods="$(kubectl get pods --no-headers -o custom-columns=':metadata.name' | grep $1)"
1815

1916
for podname in $pods
2017
do
2118
kubectl logs $podname -f
2219
done
2320

24-
echo "\n\n\n --------------------- Usage"
25-
echo "./klf.sh {deployment} {environment}"
26-
echo "\n ---------------------"

readme.md

100644100755
File mode changed.

0 commit comments

Comments
 (0)