Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to know namespace is present or not in kubernetes shell script

#!/bin/bash

namespaceStatus=$(kubectl get ns nightlybuild-test -o json | jq .status.phase -r)
if [ $namespaceStatus == "Active" ]
then
    echo "namespace is present"
else
   echo "namespace is not present"
 
PREVIOUS NEXT
Tagged: #namespace #present #kubernetes #shell #script
ADD COMMENT
Topic
Name
2+2 =