(List (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (= scope= flags=0 words=[] bindings=[('SSH_OPTS', {[DQ [LIT_CHARS "-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR -C"]]})]) (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /../..]})]) (= scope= flags=2 words=[] bindings=[('ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})]})]) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /][VarSub KUBE_CONFIG_FILE test_op=VS_TEST_COLON_HYPHEN {[DQ [LIT_CHARS config-default.sh]]}]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/common.sh]]} ) (= scope= flags=0 words=[] bindings=[('KUBECTL_PATH', {[VarSub KUBE_ROOT] [LIT_CHARS /cluster/centos/binaries/kubectl]})]) (= scope= flags=0 words=[] bindings=[('KUBE_TEMP', {[DQ [LIT_CHARS "~/kube_temp"]]})]) (FunctionDef detect-master [] (List (= scope= flags=0 words=[] bindings=[('KUBE_MASTER', {[VarSub MASTER]})]) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_IP', {[VarSub MASTER transform_ops=[VS_UNARY_POUND {[LIT_CHARS "*@"]}]]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_MASTER_IP: "][VarSub KUBE_MASTER_IP]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_MASTER: "][VarSub MASTER]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) ) (FunctionDef detect-nodes [] (List (= scope= flags=0 words=[] bindings=[('KUBE_NODE_IP_ADDRESSES', {[Array ]})]) (For node [{[VarSub NODES]}]) (= scope= flags=0 words=[] bindings=[('KUBE_NODE_IP_ADDRESSES+', {[Array {[DQ [VarSub node transform_ops=[VS_UNARY_POUND {[LIT_CHARS "*@"]}]]]}]})]) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_NODE_IP_ADDRESSES: ["][VarSub KUBE_NODE_IP_ADDRESSES bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_STAR "*"}})][LIT_CHARS "]"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) ) (FunctionDef verify-prereqs [] (List (= scope= flags=0 words=[{[LIT_CHARS rc]}] bindings=[]) (= scope= flags=0 words=[] bindings=[('rc', {[LIT_CHARS 0]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS ssh-add]} {[LIT_CHARS -L]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (= scope= flags=0 words=[] bindings=[('rc', {[DQ [VarSub ?]]})]) ) (If (DBracket {B2 BINARY_INT_EQ {[DQ [VarSub rc]]} {[LIT_CHARS 2]}}) (List (Com {[LIT_CHARS eval]} {[DQ [ComSub (Com {[LIT_CHARS ssh-agent]})]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) (Com {[LIT_CHARS trap-add]} {[DQ [LIT_CHARS "kill "][VarSub SSH_AGENT_PID]]} {[LIT_CHARS EXIT]} ) ) ) (= scope= flags=0 words=[] bindings=[('rc', {[LIT_CHARS 0]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS ssh-add]} {[LIT_CHARS -L]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (= scope= flags=0 words=[] bindings=[('rc', {[DQ [VarSub ?]]})]) ) (If (DBracket {B2 BINARY_INT_EQ {[DQ [VarSub rc]]} {[LIT_CHARS 1]}}) (AndOr OP_OR_IF (Com {[LIT_CHARS ssh-add]} ) (Com {[LIT_CHARS true]} ) ) ) (= scope= flags=0 words=[] bindings=[('rc', {[LIT_CHARS 0]})]) (If (Pipeline! (Com {[LIT_CHARS ssh-add]} {[LIT_CHARS -L]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not find or add an SSH identity."]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Please start ssh-agent, add your identity, and retry."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (FunctionDef trap-add [] (List (= scope= flags=0 words=[] bindings=[('handler', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[] bindings=[('signal', {[DQ [VarSub 2 test_op=VS_TEST_HYPHEN {[LIT_CHARS EXIT]}]]})]) (= scope= flags=0 words=[{[LIT_CHARS cur]}] bindings=[]) (= scope= flags=0 words=[] bindings=[('cur', {[DQ [ComSub (Com {[LIT_CHARS eval]} {[DQ [LIT_CHARS "sh -c 'echo "][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS "3' -- "][ComSub (Com {[LIT_CHARS trap]} {[LIT_CHARS -p]} {[VarSub signal]})]]})]]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub cur]]}}) (= scope= flags=0 words=[] bindings=[('handler', {[DQ [VarSub cur][LIT_CHARS "; "][VarSub handler]]})]) ) (Com {[LIT_CHARS trap]} {[DQ [VarSub handler]]} {[VarSub signal]} ) ) ) (FunctionDef validate-cluster [] (List (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS e]} ) (Com {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/validate-cluster.sh]]} ) (If (DBracket {B2 BINARY_INT_NE {[DQ [VarSub ?]]} {[DQ [LIT_CHARS 0]]}}) (List (Com {[LIT_CHARS troubleshoot-master]} ) (For node [{[VarSub NODES]}]) (Com {[LIT_CHARS troubleshoot-node]} {[VarSub node]} ) ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) ) ) (FunctionDef kube-up [] (List (Com {[LIT_CHARS provision-master]} ) (For node [{[VarSub NODES]}]) (Com {[LIT_CHARS provision-node]} {[VarSub node]} ) ) (Com {[LIT_CHARS detect-master]} ) (= scope= flags=1 words=[] bindings=[('CONTEXT', {[DQ [LIT_CHARS centos]]})]) (= scope= flags=1 words=[] bindings=[('KUBE_SERVER', {[DQ [LIT_CHARS "http://"][VarSub KUBE_MASTER_IP][LIT_CHARS ":8080"]]})]) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/common.sh]]} ) (Com {[LIT_CHARS get-password]} ) (Com {[LIT_CHARS create-kubeconfig]} ) ) ) (FunctionDef kube-down [] (List (Com {[LIT_CHARS tear-down-master]} ) (For node [{[VarSub NODES]}]) (Com {[LIT_CHARS tear-down-node]} {[VarSub node]} ) ) ) ) (FunctionDef troubleshoot-master [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Troubleshooting on master "][VarSub MASTER]]} ) (= scope= flags=0 words=[{[LIT_CHARS -a]}] bindings=[('required_daemon', {[Array {[DQ [LIT_CHARS kube-apiserver]]} {[DQ [LIT_CHARS kube-controller-manager]]} {[DQ [LIT_CHARS kube-scheduler]]}]})]) (= scope= flags=0 words=[{[LIT_CHARS daemon]}] bindings=[]) (= scope= flags=0 words=[{[LIT_CHARS daemon_status]}] bindings=[]) (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "%-24s %-10s "][\ LIT_ESCAPED_CHAR "\\n"]]} {[DQ [LIT_CHARS PROCESS]]} {[DQ [LIT_CHARS STATUS]]} ) (For daemon [{[DQ [VarSub required_daemon bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (List (= scope= flags=0 words=[] bindings=[('rc', {[LIT_CHARS 0]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS "sudo systemctl is-active "][VarSub daemon]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) (= scope= flags=0 words=[] bindings=[('rc', {[DQ [VarSub ?]]})]) ) (If (DBracket {B2 BINARY_INT_NE {[DQ [VarSub rc]]} {[DQ [LIT_CHARS 0]]}}) (= scope= flags=0 words=[] bindings=[('daemon_status', {[DQ [LIT_CHARS inactive]]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('daemon_status', {[DQ [LIT_CHARS active]]})]) ) (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "%-24s %s"][\ LIT_ESCAPED_CHAR "\\n"]]} {[VarSub daemon]} {[VarSub daemon_status]} ) ) ) (Com {[LIT_CHARS printf]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} ) ) ) (FunctionDef troubleshoot-node [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Troubleshooting on node "][VarSub 1]]} ) (= scope= flags=0 words=[{[LIT_CHARS -a]}] bindings=[('required_daemon', {[Array {[DQ [LIT_CHARS kube-proxy]]} {[DQ [LIT_CHARS kubelet]]} {[DQ [LIT_CHARS docker]]} {[DQ [LIT_CHARS flannel]]}]})]) (= scope= flags=0 words=[{[LIT_CHARS daemon]}] bindings=[]) (= scope= flags=0 words=[{[LIT_CHARS daemon_status]}] bindings=[]) (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "%-24s %-10s "][\ LIT_ESCAPED_CHAR "\\n"]]} {[DQ [LIT_CHARS PROCESS]]} {[DQ [LIT_CHARS STATUS]]} ) (For daemon [{[DQ [VarSub required_daemon bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (List (= scope= flags=0 words=[] bindings=[('rc', {[LIT_CHARS 0]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS "sudo systemctl is-active "][VarSub daemon]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) (= scope= flags=0 words=[] bindings=[('rc', {[DQ [VarSub ?]]})]) ) (If (DBracket {B2 BINARY_INT_NE {[DQ [VarSub rc]]} {[DQ [LIT_CHARS 0]]}}) (= scope= flags=0 words=[] bindings=[('daemon_status', {[DQ [LIT_CHARS inactive]]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('daemon_status', {[DQ [LIT_CHARS active]]})]) ) (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "%-24s %s"][\ LIT_ESCAPED_CHAR "\\n"]]} {[VarSub daemon]} {[VarSub daemon_status]} ) ) ) (Com {[LIT_CHARS printf]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} ) ) ) (FunctionDef tear-down-master [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] tear-down-master on "][VarSub MASTER]]} ) (For service_name [{[LIT_CHARS etcd]}, {[LIT_CHARS kube-apiserver]}, {[LIT_CHARS kube-controller-manager]}, {[LIT_CHARS kube-scheduler]}]) (List (= scope= flags=0 words=[] bindings=[('service_file', {[DQ [LIT_CHARS /usr/lib/systemd/system/][VarSub service_name][LIT_CHARS .service]]})]) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS " "][LIT_CHARS " if [[ -f "][VarSub service_file][LIT_CHARS " ]]; then "][LIT_CHARS " sudo systemctl stop "][VarSub service_name][LIT_CHARS "; "][LIT_CHARS " sudo systemctl disable "][VarSub service_name][LIT_CHARS "; "][LIT_CHARS " sudo rm -f "][VarSub service_file][LIT_CHARS "; "][LIT_CHARS " fi"]]} ) ) ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS "sudo rm -rf /opt/kubernetes"]]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS "sudo rm -rf "][VarSub KUBE_TEMP]]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS "sudo rm -rf /var/lib/etcd"]]} ) ) ) (FunctionDef tear-down-node [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] tear-down-node on "][VarSub 1]]} ) (For service_name [{[LIT_CHARS kube-proxy]}, {[LIT_CHARS kubelet]}, {[LIT_CHARS docker]}, {[LIT_CHARS flannel]}]) (List (= scope= flags=0 words=[] bindings=[('service_file', {[DQ [LIT_CHARS /usr/lib/systemd/system/][VarSub service_name][LIT_CHARS .service]]})]) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS " "][LIT_CHARS " if [[ -f "][VarSub service_file][LIT_CHARS " ]]; then "][LIT_CHARS " sudo systemctl stop "][VarSub service_name][LIT_CHARS "; "][LIT_CHARS " sudo systemctl disable "][VarSub service_name][LIT_CHARS "; "][LIT_CHARS " sudo rm -f "][VarSub service_file][LIT_CHARS "; "][LIT_CHARS " fi"]]} ) ) ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS "sudo rm -rf /run/flannel"]]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS "sudo rm -rf /opt/kubernetes"]]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS "sudo rm -rf "][VarSub KUBE_TEMP]]} ) ) ) (FunctionDef provision-master [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Provision master on "][VarSub MASTER]]} ) (= scope= flags=0 words=[] bindings=[('master_ip', {[VarSub MASTER transform_ops=[VS_UNARY_POUND {[LIT_CHARS "*@"]}]]})]) (Com {[LIT_CHARS ensure-setup-dir]} {[VarSub MASTER]} ) (Com {[LIT_CHARS kube-scp]} {[VarSub MASTER]} {[DQ [VarSub ROOT][LIT_CHARS "/../saltbase/salt/generate-cert/make-ca-cert.sh "][VarSub ROOT][LIT_CHARS "/binaries/master "][VarSub ROOT][LIT_CHARS "/master "][VarSub ROOT][LIT_CHARS "/config-default.sh "][VarSub ROOT][LIT_CHARS /util.sh]]} {[DQ [VarSub KUBE_TEMP]]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub MASTER]]} {[DQ [LIT_CHARS " "][LIT_CHARS " sudo cp -r "][VarSub KUBE_TEMP][LIT_CHARS "/master/bin /opt/kubernetes; "][LIT_CHARS " sudo chmod -R +x /opt/kubernetes/bin; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/make-ca-cert.sh "][VarSub master_ip][LIT_CHARS " IP:"][VarSub master_ip][LIT_CHARS ",IP:"][VarSub SERVICE_CLUSTER_IP_RANGE transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS ".*"]}]][LIT_CHARS ".1,DNS:kubernetes,DNS:kubernetes.default,DNS:kubernetes.default.svc,DNS:kubernetes.default.svc.cluster.local; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/master/scripts/etcd.sh; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/master/scripts/apiserver.sh "][VarSub master_ip][LIT_CHARS " "][VarSub ETCD_SERVERS][LIT_CHARS " "][VarSub SERVICE_CLUSTER_IP_RANGE][LIT_CHARS " "][VarSub ADMISSION_CONTROL][LIT_CHARS "; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/master/scripts/controller-manager.sh "][VarSub master_ip][LIT_CHARS "; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/master/scripts/scheduler.sh "][VarSub master_ip]]} ) ) ) (FunctionDef provision-node [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Provision node on "][VarSub 1]]} ) (= scope= flags=0 words=[] bindings=[('master_ip', {[VarSub MASTER transform_ops=[VS_UNARY_POUND {[LIT_CHARS "*@"]}]]})]) (= scope= flags=0 words=[] bindings=[('node', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('node_ip', {[VarSub node transform_ops=[VS_UNARY_POUND {[LIT_CHARS "*@"]}]]})]) (Com {[LIT_CHARS ensure-setup-dir]} {[VarSub node]} ) (Com {[LIT_CHARS kube-scp]} {[VarSub node]} {[DQ [VarSub ROOT][LIT_CHARS "/binaries/node "][VarSub ROOT][LIT_CHARS "/node "][VarSub ROOT][LIT_CHARS "/config-default.sh "][VarSub ROOT][LIT_CHARS /util.sh]]} {[VarSub KUBE_TEMP]} ) (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub node]]} {[DQ [LIT_CHARS " "][LIT_CHARS " sudo cp -r "][VarSub KUBE_TEMP][LIT_CHARS "/node/bin /opt/kubernetes; "][LIT_CHARS " sudo chmod -R +x /opt/kubernetes/bin; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/node/scripts/flannel.sh "][VarSub ETCD_SERVERS][LIT_CHARS " "][VarSub FLANNEL_NET][LIT_CHARS "; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/node/scripts/docker.sh "][\ LIT_ESCAPED_CHAR "\\\""][VarSub DOCKER_OPTS][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/node/scripts/kubelet.sh "][VarSub master_ip][LIT_CHARS " "][VarSub node_ip][LIT_CHARS "; "][LIT_CHARS " sudo bash "][VarSub KUBE_TEMP][LIT_CHARS "/node/scripts/proxy.sh "][VarSub master_ip]]} ) ) ) (FunctionDef ensure-setup-dir [] (Com {[LIT_CHARS kube-ssh]} {[DQ [VarSub 1]]} {[DQ [LIT_CHARS "mkdir -p "][VarSub KUBE_TEMP][LIT_CHARS "; "][LIT_CHARS " sudo mkdir -p /opt/kubernetes/bin; "][LIT_CHARS " sudo mkdir -p /opt/kubernetes/cfg"]]} ) ) (FunctionDef kube-ssh [] (List (= scope= flags=0 words=[] bindings=[('host', {[DQ [VarSub 1]]})]) (Com {[LIT_CHARS shift]} ) (Com {[LIT_CHARS ssh]} {[VarSub SSH_OPTS]} {[LIT_CHARS -t]} {[DQ [VarSub host]]} {[DQ [VarSub @]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) ) ) (FunctionDef kube-scp [] (List (= scope= flags=0 words=[] bindings=[('host', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[] bindings=[('src', {[Array {[VarSub 2]}]})]) (= scope= flags=0 words=[] bindings=[('dst', {[DQ [VarSub 3]]})]) (Com {[LIT_CHARS scp]} {[LIT_CHARS -r]} {[VarSub SSH_OPTS]} {[VarSub src bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_STAR "*"}})]} {[DQ [VarSub host][LIT_CHARS ":"][VarSub dst]]} ) ) ) (FunctionDef get-password [] (List (Com {[LIT_CHARS load-or-gen-kube-basicauth]} ) (If (DBracket {B? LOGICAL_BINARY_OR {B1 UNARY_STRING_z {[DQ [VarSub KUBE_USER]]}} {B1 UNARY_STRING_z {[DQ [VarSub KUBE_PASSWORD]]}}}) (List (= scope= flags=0 words=[] bindings=[('KUBE_USER', {[LIT_CHARS admin]})]) (= scope= flags=0 words=[] bindings=[('KUBE_PASSWORD', {[ComSub (Com {[LIT_CHARS python]} {[LIT_CHARS -c]} {[SQ ]})]})]) ) ) ) ) )