(List (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /../..]})]) (Com {[LIT_CHARS source]} {[DQ [LIT_CHARS config-default.sh]]} ) (= scope= flags=0 words=[] bindings=[('KUBECTL', {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/kubectl.sh]]})]) (= scope= flags=1 words=[] bindings=[('KUBECTL_PATH', {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/ubuntu/binaries/kubectl]]})]) (= scope= flags=1 words=[] bindings=[('KUBE_CONFIG_FILE', {[VarSub KUBE_CONFIG_FILE test_op=VS_TEST_COLON_HYPHEN {[VarSub KUBE_ROOT] [LIT_SLASH /] [LIT_CHARS cluster] [LIT_SLASH /] [LIT_CHARS ubuntu] [LIT_SLASH /] [LIT_CHARS config-default.sh]}]})]) (FunctionDef init [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating kube-system namespace..."]]} ) (= scope= flags=0 words=[] bindings=[('NAMESPACE', {[ComSub (Com {[LIT_CHARS eval]} {[DQ [VarSub KUBECTL][LIT_CHARS " get namespaces | grep kube-system | cat"]]})]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[DQ [VarSub NAMESPACE]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[VarSub KUBECTL]} {[LIT_CHARS create]} {[LIT_CHARS -f]} {[LIT_CHARS namespace.yaml]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "The namespace 'kube-system' is successfully created."]]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "The namespace 'kube-system' is already there. Skipping."]]} ) ) (Com {[LIT_CHARS echo]} ) ) ) (FunctionDef deploy_dns [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deploying DNS on Kubernetes"]]} ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS s/][\ LIT_ESCAPED_CHAR "\\\\"][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS DNS_REPLICAS/][VarSub DNS_REPLICAS][LIT_CHARS "/g;s/"][\ LIT_ESCAPED_CHAR "\\\\"][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS DNS_DOMAIN/][VarSub DNS_DOMAIN][LIT_CHARS "/g;"]]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/addons/dns/skydns-rc.yaml.sed]]} < (FilenameRedirectNode filename={[LIT_CHARS skydns-rc.yaml]} "> 1), > ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS s/][\ LIT_ESCAPED_CHAR "\\\\"][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS DNS_SERVER_IP/][VarSub DNS_SERVER_IP][LIT_CHARS /g]]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/addons/dns/skydns-svc.yaml.sed]]} < (FilenameRedirectNode filename={[LIT_CHARS skydns-svc.yaml]} "> 1), > ) (= scope= flags=0 words=[] bindings=[('KUBEDNS', {[ComSub (Com {[LIT_CHARS eval]} {[DQ [VarSub KUBECTL][LIT_CHARS " get services --namespace=kube-system | grep kube-dns | cat"]]})]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[DQ [VarSub KUBEDNS]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[VarSub KUBECTL]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [LIT_CHARS kube-system]} {[LIT_CHARS create]} {[LIT_CHARS -f]} {[LIT_CHARS skydns-rc.yaml]} ) (Com {[VarSub KUBECTL]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [LIT_CHARS kube-system]} {[LIT_CHARS create]} {[LIT_CHARS -f]} {[LIT_CHARS skydns-svc.yaml]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kube-dns rc and service is successfully deployed."]]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kube-dns rc and service is already deployed. Skipping."]]} ) ) (Com {[LIT_CHARS echo]} ) ) ) (FunctionDef deploy_dashboard [] (List (If (List (Fork (Pipeline (Com {[VarSub KUBECTL]} {[LIT_CHARS get]} {[LIT_CHARS rc]} {[LIT_CHARS -l]} {[LIT_CHARS k8s-app] [LIT_DBRACKET_LIKE "="] [LIT_CHARS kubernetes-dashboard]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [LIT_CHARS kube-system]} ) (Com {[LIT_CHARS grep]} {[LIT_CHARS kubernetes-dashboard-v]} ) ) ) (Com < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kubernetes Dashboard replicationController already exists"]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating Kubernetes Dashboard replicationController"]]} ) (Com {[VarSub KUBECTL]} {[LIT_CHARS create]} {[LIT_CHARS -f]} {[VarSub KUBE_ROOT] [LIT_CHARS /cluster/addons/dashboard/dashboard-controller.yaml]} ) ) ) (If (List (Fork (Com {[VarSub KUBECTL]} {[LIT_CHARS get]} {[LIT_CHARS service/kubernetes-dashboard]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [LIT_CHARS kube-system]} ) ) (Com < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kubernetes Dashboard service already exists"]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating Kubernetes Dashboard service"]]} ) (Com {[VarSub KUBECTL]} {[LIT_CHARS create]} {[LIT_CHARS -f]} {[VarSub KUBE_ROOT] [LIT_CHARS /cluster/addons/dashboard/dashboard-service.yaml]} ) ) ) (Com {[LIT_CHARS echo]} ) ) ) (Com {[LIT_CHARS init]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub ENABLE_CLUSTER_DNS]]} {[LIT_DBRACKET_LIKE "=="]} {[LIT_CHARS true]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS deploy_dns]} ) ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub ENABLE_CLUSTER_UI]]} {[LIT_DBRACKET_LIKE "=="]} {[LIT_CHARS true]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS deploy_dashboard]} ) ) )