Skip to content

Commit

Permalink
help command added
Browse files Browse the repository at this point in the history
  • Loading branch information
Emre Odabas committed Jun 17, 2020
1 parent f97ca03 commit 6f8e493
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions kubectl-bulk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,48 @@ CMD_INDEX=0;
GREP_CMD="";
GREP_NAMES="";

samples() {

cat <<"EOF"
USAGE:
kubectl bulk <resourceType>[<parameters>] get|list|create|update|delete|rollout|remove|scale [<parameters>]
#############################################################################################################
########## SAMPLES #########
#############################################################################################################
GET --> kubectl bulk <resourceType> [<parameters>] get [<fields>]
+ kubectl bulk hpa -n myspace get minReplicas maxReplicas
LIST --> kubectl bulk <resourceType> [<parameters>] list <optional:filename> <optional:format(json|yaml)>
+ kubectl bulk deployment list all_deploy.json json
+ kubectl bulk deployment list json
CREATE --> kubectl bulk <resourceType>[<parameters>] create parameterName oldValue newValue
+ kubectl bulk service -n test create namespace test newtest
UPDATE --> kubectl bulk <resourceType>[<parameters>] update parameterName newValue
+ kubectl bulk pods -l app=nginx update image nginx:1.16
kubectl bulk <resourceType>[<parameters>] update parameterName newValue
+ kubectl bulk pods -l app=nginx update image nginx:1.15 nginx:1.16
DELETE --> kubectl bulk <resourceType> [<parameters>] delete
+ kubectl bulk serviceaccount delete
REMOVE --> kubectl bulk <resourceType> [<parameters>] remove <field> <value>
+ kubectl bulk configMap remove label1
ROLLOUT --> kubectl bulk <resourceType> [<parameters>] rollout history|pause|resume|status|undo <rollout parameters>
+ kubectl bulk daemonsets -n kube-system rollout history
+ kubectl bulk daemonsets -n kube-system rollout undo
EOF

}



usage() {

Expand Down Expand Up @@ -191,6 +233,7 @@ fi

action_call() {


if [[ $CMD == "create" ]];then
create;
elif [[ $CMD == "update" ]];then
Expand All @@ -217,6 +260,11 @@ if [[ "$#" -lt 1 ]]; then
exit 0
fi

case $1 in "--h"|"--help"|"-h"|"-help"|"help" )
samples;
exit 0
esac

COUNTER=1
IS_GET=true
RESOURCE_TYPE="$1"
Expand Down

0 comments on commit 6f8e493

Please sign in to comment.