(List (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS errexit]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS nounset]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS pipefail]} ) (= scope= flags=0 words=[] bindings=[('KUBE_HOST', {[VarSub KUBE_HOST test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS localhost]}]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('RED', {[DQ [\ LIT_ESCAPED_CHAR "\\0"][LIT_CHARS "33[0;31m"]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('GREEN', {[DQ [\ LIT_ESCAPED_CHAR "\\0"][LIT_CHARS "33[0;32m"]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('YELLOW', {[DQ [\ LIT_ESCAPED_CHAR "\\0"][LIT_CHARS "33[0;33m"]]})]) (FunctionDef echo_green [] (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub GREEN][VarSub 1]]} ) (Com {[LIT_CHARS tput]} {[LIT_CHARS sgr0]} ) ) ) (FunctionDef echo_red [] (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub RED][VarSub 1]]} ) (Com {[LIT_CHARS tput]} {[LIT_CHARS sgr0]} ) ) ) (FunctionDef echo_yellow [] (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub YELLOW][VarSub 1]]} ) (Com {[LIT_CHARS tput]} {[LIT_CHARS sgr0]} ) ) ) (FunctionDef run [] (List (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS o]} {[LIT_CHARS errexit]} ) (= scope= flags=0 words=[] bindings=[('output', {[ComSub (Com redirects=[(DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2)]{[VarSub 1]})]})]) (= scope= flags=0 words=[] bindings=[('exit_code', {[VarSub ?]})]) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS errexit]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub exit_code]} {[LIT_CHARS -eq]} {[LIT_CHARS 0]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS echo_green]} {[DQ [LIT_CHARS SUCCESS]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS FAILED]]} ) (Com {[LIT_CHARS echo]} {[VarSub output]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (FunctionDef create_cluster [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating a local cluster:"]]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[LIT_CHARS -n]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"][LIT_CHARS "Starting kubelet..."]]} ) (Com {[LIT_CHARS run]} {[DQ [LIT_CHARS "docker run "][LIT_CHARS " --volume=/:/rootfs:ro "][LIT_CHARS " --volume=/sys:/sys:ro "][LIT_CHARS " --volume=/var/lib/docker/:/var/lib/docker:rw "][LIT_CHARS " --volume=/var/lib/kubelet/:/var/lib/kubelet:rw "][LIT_CHARS " --volume=/var/run:/var/run:rw "][LIT_CHARS " --net=host "][LIT_CHARS " --pid=host "][LIT_CHARS " --privileged=true "][LIT_CHARS " -d "][LIT_CHARS " gcr.io/google_containers/hyperkube-"][VarSub arch][LIT_CHARS ":"][VarSub release][LIT_CHARS " "][LIT_CHARS " /hyperkube kubelet "][LIT_CHARS " --containerized "][LIT_CHARS " --hostname-override="]] [LIT_CHARS 127.0.0.1] [DQ [LIT_CHARS " "][LIT_CHARS " --address="]] [LIT_CHARS 0.0.0.0] [DQ [LIT_CHARS " "][LIT_CHARS " --api-servers=http://localhost:8080 "][LIT_CHARS " --config=/etc/kubernetes/manifests "][LIT_CHARS " --allow-privileged=true "][LIT_CHARS " --cluster-dns=10.0.0.10 "][LIT_CHARS " --cluster-domain=cluster.local "][LIT_CHARS " --v=2"]]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[LIT_CHARS -n]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"][LIT_CHARS "Waiting for master components to start..."]]} ) (While (Com {[LIT_CHARS true]} ) (List (= scope= flags=0 words=[] bindings=[('running_count', {[ComSub (Pipeline (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS kubectl]} {[LIT_CHARS -s] [LIT_DBRACKET_LIKE "="] [LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_HOST] [LIT_OTHER ":"] [LIT_CHARS 8080]} {[LIT_CHARS get]} {[LIT_CHARS pods]} {[LIT_CHARS --no-headers]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS Running]]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub running_count]]} {[LIT_CHARS -ge]} {[LIT_CHARS 3]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS break]} ) ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -n]} {[DQ [LIT_CHARS .]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo_green]} {[DQ [LIT_CHARS SUCCESS]]} ) (Com {[LIT_CHARS echo_green]} {[DQ [LIT_CHARS "Cluster created!"]]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS kubectl]} {[LIT_CHARS -s]} {[LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_HOST] [LIT_OTHER ":"] [LIT_CHARS 8080]} {[LIT_CHARS clusterinfo]} ) ) ) (FunctionDef get_latest_version_number [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('latest_url', {[DQ [LIT_CHARS "https://storage.googleapis.com/kubernetes-release/release/stable.txt"]]})]) (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS wget]})]}}) (Com {[LIT_CHARS wget]} {[LIT_CHARS -qO-]} {[VarSub latest_url]} ) (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS curl]})]}}) (Com {[LIT_CHARS curl]} {[LIT_CHARS -Ss]} {[VarSub latest_url]} ) (ElseTrue) (List (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Couldn't find curl or wget. Bailing out."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 4]} ) ) ) ) ) (= scope= flags=0 words=[] bindings=[('latest_release', {[ComSub (Com {[LIT_CHARS get_latest_version_number]})]})]) (= scope= flags=0 words=[] bindings=[('release', {[VarSub KUBE_VERSION test_op=VS_TEST_COLON_HYPHEN {[VarSub latest_release]}]})]) (= scope= flags=0 words=[] bindings=[('uname', {[ComSub (Com {[LIT_CHARS uname]})]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub uname]]} {[DQ [LIT_CHARS Darwin]]}}) (= scope= flags=0 words=[] bindings=[('platform', {[DQ [LIT_CHARS darwin]]})]) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub uname]]} {[DQ [LIT_CHARS Linux]]}}) (= scope= flags=0 words=[] bindings=[('platform', {[DQ [LIT_CHARS linux]]})]) (ElseTrue) (List (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Unknown, unsupported platform: ("][VarSub uname][LIT_CHARS ")."]]} ) (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Supported platforms: Linux, Darwin."]]} ) (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Bailing out."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) ) (= scope= flags=0 words=[] bindings=[('machine', {[ComSub (Com {[LIT_CHARS uname]} {[LIT_CHARS -m]})]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub machine]]} {[DQ [LIT_CHARS x86_64]]}}) (= scope= flags=0 words=[] bindings=[('arch', {[DQ [LIT_CHARS amd64]]})]) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub machine]]} {[DQ [LIT_CHARS i686]]}}) (= scope= flags=0 words=[] bindings=[('arch', {[DQ [LIT_CHARS 386]]})]) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub machine]]} {[DQ [LIT_CHARS "arm*"]]}}) (= scope= flags=0 words=[] bindings=[('arch', {[DQ [LIT_CHARS arm]]})]) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub machine]]} {[DQ [LIT_CHARS "s390x*"]]}}) (= scope= flags=0 words=[] bindings=[('arch', {[DQ [LIT_CHARS s390x]]})]) (ElseTrue) (List (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Unknown, unsupported architecture ("][VarSub machine][LIT_CHARS ")."]]} ) (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Supported architectures x86_64, i686, arm, s390x."]]} ) (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Bailing out."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 3]} ) ) ) (= scope= flags=0 words=[] bindings=[('kubectl_url', {[DQ [LIT_CHARS "https://storage.googleapis.com/kubernetes-release/release/"][VarSub release][LIT_CHARS /bin/][VarSub platform][LIT_CHARS /][VarSub arch][LIT_CHARS /kubectl]]})]) (If (DBracket {B2 BINARY_INT_LT {[ComSub (Pipeline (Com {[LIT_CHARS ls]} {[LIT_CHARS .]}) (Com {[LIT_CHARS grep]} {[LIT_OTHER "^"] [LIT_CHARS kubectl] [LIT_OTHER "$"]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]} {[LIT_CHARS 1]}}) (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -n]} {[DQ [LIT_CHARS "Downloading kubectl binary..."]]} ) (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS wget]})]}}) (Com {[LIT_CHARS run]} {[DQ [LIT_CHARS "wget "][VarSub kubectl_url]]} ) (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS curl]})]}}) (Com {[LIT_CHARS run]} {[DQ [LIT_CHARS "curl -OL "][VarSub kubectl_url]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo_red]} {[DQ [LIT_CHARS "Couldn't find curl or wget. Bailing out."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS a] [LIT_OTHER "+"] [LIT_CHARS x]} {[LIT_CHARS kubectl]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Detected existing kubectl binary. Skipping download."]]} ) ) (Com {[LIT_CHARS create_cluster]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "To list the nodes in your cluster run"]]} ) (Com {[LIT_CHARS echo_yellow]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"][LIT_CHARS "kubectl -s=http://"][VarSub KUBE_HOST][LIT_CHARS ":8080 get nodes"]]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "To run your first pod run"]]} ) (Com {[LIT_CHARS echo_yellow]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"][LIT_CHARS "kubectl -s http://"][VarSub KUBE_HOST][LIT_CHARS ":8080 run nginx --image=nginx --port=80"]]} ) )