(List (AndOr OP_AND_IF (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[LIT_CHARS -z]} {[VarSub UTIL_SH_DEBUG test_op=VS_TEST_PLUS {[LIT_CHARS x]}]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -x]} ) ) (= 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=1 words=[] bindings=[('LIBVIRT_DEFAULT_URI', {[LIT_CHARS qemu] [LIT_OTHER ":"] [LIT_CHARS ///system]})]) (= scope= flags=1 words=[] bindings=[('SERVICE_ACCOUNT_LOOKUP', {[VarSub SERVICE_ACCOUNT_LOOKUP test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS false]}]})]) (= scope= flags=1 words=[] bindings=[('ADMISSION_CONTROL', {[VarSub ADMISSION_CONTROL test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota"]}]})]) (= scope= flags=2 words=[] bindings=[('POOL', {[LIT_CHARS kubernetes]})]) (= scope= flags=2 words=[] bindings=[('POOL_PATH', {[LIT_CHARS /var/lib/libvirt/images/kubernetes]})]) (AndOr OP_AND_IF (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[LIT_CHARS -d]} {[DQ [VarSub POOL_PATH]]} {[LIT_DBRACKET_LIKE "]"]} ) (Subshell (List (Com {[LIT_CHARS echo]} {[DQ [VarSub POOL_PATH]]} {[LIT_CHARS does]} {[LIT_CHARS not]} {[LIT_CHARS exist]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) (FunctionDef join [] (List (= scope= flags=0 words=[] bindings=[('IFS', {[DQ [VarSub 1]]})]) (Com {[LIT_CHARS shift]} ) (Com {[LIT_CHARS echo]} {[DQ [VarSub *]]} ) ) ) (FunctionDef detect-master [] (List (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_IP', {[VarSub MASTER_IP]})]) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER', {[VarSub MASTER_NAME]})]) (= scope= flags=1 words=[] bindings=[('KUBERNETES_MASTER', {[LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_MASTER_IP] [LIT_OTHER ":"] [LIT_CHARS 8080]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_MASTER_IP: "][VarSub KUBE_MASTER_IP]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_MASTER: "][VarSub KUBE_MASTER]]} ) ) ) (FunctionDef detect-nodes [] (= scope= flags=0 words=[] bindings=[('KUBE_NODE_IP_ADDRESSES', {[Array {[DQ [VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]})]) ) (FunctionDef generate_certs [] (List (= scope= flags=0 words=[] bindings=[('node_names', {[Array {[DQ [VarSub @]]}]})]) (= scope= flags=0 words=[] bindings=[('tempdir', {[ComSub (Com {[LIT_CHARS mktemp]} {[LIT_CHARS -d]})]})]) (= scope= flags=0 words=[] bindings=[('CA_KEY', {[VarSub CA_KEY test_op=VS_TEST_COLON_HYPHEN {[DQ [VarSub tempdir][LIT_CHARS /ca-key.pem]]}]})]) (= scope= flags=0 words=[] bindings=[('CA_CERT', {[VarSub CA_CERT test_op=VS_TEST_COLON_HYPHEN {[DQ [VarSub tempdir][LIT_CHARS /ca.pem]]}]})]) (Com {[LIT_CHARS openssl]} {[LIT_CHARS genrsa]} {[LIT_CHARS -out]} {[DQ [VarSub CA_KEY]]} {[LIT_CHARS 2048]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS req]} {[LIT_CHARS -x509]} {[LIT_CHARS -new]} {[LIT_CHARS -nodes]} {[LIT_CHARS -key]} {[DQ [VarSub CA_KEY]]} {[LIT_CHARS -days]} {[LIT_CHARS 10000]} {[LIT_CHARS -out]} {[DQ [VarSub CA_CERT]]} {[LIT_CHARS -subj]} {[DQ [LIT_CHARS "/CN=kube-ca"]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (= scope= flags=0 words=[] bindings=[('KUBE_KEY', {[VarSub KUBE_KEY test_op=VS_TEST_COLON_HYPHEN {[DQ [VarSub tempdir][LIT_CHARS /apiserver-key.pem]]}]})]) (= scope= flags=0 words=[] bindings=[('API_SERVER_CERT_REQ', {[VarSub API_SERVER_CERT_REQ test_op=VS_TEST_COLON_HYPHEN {[DQ [VarSub tempdir][LIT_CHARS /apiserver.csr]]}]})]) (Com {[LIT_CHARS openssl]} {[LIT_CHARS genrsa]} {[LIT_CHARS -out]} {[DQ [VarSub KUBE_KEY]]} {[LIT_CHARS 2048]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS req]} {[LIT_CHARS -new]} {[LIT_CHARS -key]} {[DQ [VarSub KUBE_KEY]]} {[LIT_CHARS -out]} {[DQ [VarSub API_SERVER_CERT_REQ]]} {[LIT_CHARS -subj]} {[DQ [LIT_CHARS "/CN=kube-apiserver"]]} {[LIT_CHARS -config]} {[LIT_CHARS cluster/libvirt-coreos/openssl.cnf]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > more_env=[('KUBERNETES_SVC', {[VarSub SERVICE_CLUSTER_IP_RANGE transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS ".*"]}]] [LIT_CHARS .1]})] ) (= scope= flags=0 words=[] bindings=[('KUBE_CERT', {[VarSub KUBE_CERT test_op=VS_TEST_COLON_HYPHEN {[DQ [VarSub tempdir][LIT_CHARS /apiserver.pem]]}]})]) (Com {[LIT_CHARS openssl]} {[LIT_CHARS x509]} {[LIT_CHARS -req]} {[LIT_CHARS -in]} {[DQ [VarSub API_SERVER_CERT_REQ]]} {[LIT_CHARS -CA]} {[DQ [VarSub CA_CERT]]} {[LIT_CHARS -CAkey]} {[DQ [VarSub CA_KEY]]} {[LIT_CHARS -CAcreateserial]} {[LIT_CHARS -out]} {[DQ [VarSub KUBE_CERT]]} {[LIT_CHARS -days]} {[LIT_CHARS 365]} {[LIT_CHARS -extensions]} {[LIT_CHARS v3_req]} {[LIT_CHARS -extfile]} {[LIT_CHARS cluster/libvirt-coreos/openssl.cnf]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > more_env=[('KUBERNETES_SVC', {[VarSub SERVICE_CLUSTER_IP_RANGE transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS ".*"]}]] [LIT_CHARS .1]})] ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub KUBE_CERT]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub KUBE_KEY]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub CA_CERT]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LESS {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub NUM_NODES]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (List (Com {[LIT_CHARS openssl]} {[LIT_CHARS genrsa]} {[LIT_CHARS -out]} {[VarSub tempdir] [LIT_CHARS /] [VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})] [LIT_CHARS -node-key.pem]} {[LIT_CHARS 2048]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (Com {[LIT_CHARS cp]} {[DQ [VarSub tempdir][LIT_CHARS /][VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})][LIT_CHARS -node-key.pem]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS req]} {[LIT_CHARS -new]} {[LIT_CHARS -key]} {[VarSub tempdir] [LIT_CHARS /] [VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})] [LIT_CHARS -node-key.pem]} {[LIT_CHARS -out]} {[VarSub tempdir] [LIT_CHARS /] [VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})] [LIT_CHARS -node.csr]} {[LIT_CHARS -subj]} {[DQ [LIT_CHARS "/CN="][VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]]} {[LIT_CHARS -config]} {[LIT_CHARS cluster/libvirt-coreos/node-openssl.cnf]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > more_env=[('WORKER_IP', {[VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})] ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS x509]} {[LIT_CHARS -req]} {[LIT_CHARS -in]} {[VarSub tempdir] [LIT_CHARS /] [VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})] [LIT_CHARS -node.csr]} {[LIT_CHARS -CA]} {[DQ [VarSub CA_CERT]]} {[LIT_CHARS -CAkey]} {[DQ [VarSub CA_KEY]]} {[LIT_CHARS -CAcreateserial]} {[LIT_CHARS -out]} {[VarSub tempdir] [LIT_CHARS /] [VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})] [LIT_CHARS -node.pem]} {[LIT_CHARS -days]} {[LIT_CHARS 365]} {[LIT_CHARS -extensions]} {[LIT_CHARS v3_req]} {[LIT_CHARS -extfile]} {[LIT_CHARS cluster/libvirt-coreos/node-openssl.cnf]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > more_env=[('WORKER_IP', {[VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})] ) (Com {[LIT_CHARS cp]} {[DQ [VarSub tempdir][LIT_CHARS /][VarSub node_names bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})][LIT_CHARS -node.pem]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/certs]]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "TLS assets generated..."]]} ) ) ) (FunctionDef verify-prereqs [] (List (If (Pipeline! (Com {[LIT_CHARS which]} {[LIT_CHARS virsh]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Can't find virsh in PATH, please fix and retry."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (If (Pipeline! (Com {[LIT_CHARS virsh]} {[LIT_CHARS nodeinfo]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) (If (DBracket {B2 BINARY_INT_NE {[DQ [ComSub (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /sys/kernel/mm/ksm/run]} 0)])]]} {[DQ [LIT_CHARS 1]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KSM is not enabled"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Enabling it would reduce the memory footprint of large clusters"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (If (DBracket {B1 UNARY_FILE_t {[LIT_CHARS 0]}}) (List (Com {[LIT_CHARS read]} {[LIT_CHARS -t]} {[LIT_CHARS 5]} {[LIT_CHARS -n]} {[LIT_CHARS 1]} {[LIT_CHARS -p]} {[DQ [LIT_CHARS "Do you want to enable KSM (requires root password) (y/n)? "]]} {[LIT_CHARS answer]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub answer]]} {[SQ ]}}) (Com {[LIT_CHARS su]} {[LIT_CHARS -c]} {[SQ /sys/kernel/mm/ksm/run">]} ) ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "You can enable it with (as root):"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " echo 1 > /sys/kernel/mm/ksm/run"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) ) ) ) ) ) (FunctionDef destroy-pool [] (List (AndOr OP_OR_IF (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-info]} {[VarSub POOL]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) (Com {[LIT_CHARS return]} ) ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub POOL_PATH]] [LIT_CHARS /kubernetes/] [LIT_OTHER "*"]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub POOL_PATH]] [LIT_CHARS /kubernetes_config] [LIT_OTHER "*"] [LIT_CHARS /] [LIT_OTHER "*"]} ) (= scope= flags=0 words=[{[LIT_CHARS vol]}] bindings=[]) (Pipeline (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-list]} {[VarSub POOL]} ) (Com {[LIT_CHARS awk]} {[SQ 2 && !/^$/ && $1 ~ /^kubernetes/ {print $1}">]} ) (While (Com {[LIT_CHARS read]} {[LIT_CHARS vol]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-delete]} {[VarSub vol]} {[LIT_CHARS --pool]} {[VarSub POOL]} ) ) ) (AndOr OP_AND_IF (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub 1]]} {[SQ ]}}) (Com {[LIT_CHARS return]} ) ) (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS e]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-delete]} {[LIT_CHARS coreos_base.img]} {[LIT_CHARS --pool]} {[VarSub POOL]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-destroy]} {[VarSub POOL]} ) (Com {[LIT_CHARS rmdir]} {[DQ [VarSub POOL_PATH]]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) ) ) (FunctionDef initialize-pool [] (List (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH]]} ) (If (Pipeline! (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-info]} {[VarSub POOL]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-create-as]} {[VarSub POOL]} {[LIT_CHARS dir]} {[LIT_CHARS --target]} {[DQ [VarSub POOL_PATH]]} ) ) (Com {[LIT_CHARS wget]} {[LIT_CHARS -N]} {[LIT_CHARS -P]} {[DQ [VarSub ROOT]]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub COREOS_CHANNEL test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS alpha]}] [LIT_CHARS .release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2]} ) (If (DBracket {B2 BINARY_FILE_NT {[DQ [VarSub ROOT][LIT_CHARS /coreos_production_qemu_image.img.bz2]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /coreos_base.img]]}}) (List (Com {[LIT_CHARS bunzip2]} {[LIT_CHARS -f]} {[LIT_CHARS -k]} {[DQ [VarSub ROOT][LIT_CHARS /coreos_production_qemu_image.img.bz2]]} ) (AndOr OP_OR_IF (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-delete]} {[LIT_CHARS coreos_base.img]} {[LIT_CHARS --pool]} {[VarSub POOL]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (Com {[LIT_CHARS true]} ) ) ) ) (If (Pipeline! (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-list]} {[VarSub POOL]} ) (Com {[LIT_CHARS grep]} {[LIT_CHARS -q]} {[LIT_CHARS coreos_base.img]} ) ) (List (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-create-as]} {[VarSub POOL]} {[LIT_CHARS coreos_base.img]} {[LIT_CHARS 10G]} {[LIT_CHARS --format]} {[LIT_CHARS qcow2]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-upload]} {[LIT_CHARS coreos_base.img]} {[DQ [VarSub ROOT][LIT_CHARS /coreos_production_qemu_image.img]]} {[LIT_CHARS --pool]} {[VarSub POOL]} ) ) ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes]]} ) (Com {[LIT_CHARS kube-push-internal]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/manifests]]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub ENABLE_NODE_LOGGING]]} {[DQ [LIT_CHARS true]]}}) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub LOGGING_DESTINATION]]} {[DQ [LIT_CHARS elasticsearch]]}}) (Com {[LIT_CHARS cp]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/saltbase/salt/fluentd-es/fluentd-es.manifest]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/manifests]]} ) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub LOGGING_DESTINATION]]} {[DQ [LIT_CHARS gcp]]}}) (Com {[LIT_CHARS cp]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.manifest]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/manifests]]} ) ) ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/addons]]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub ENABLE_CLUSTER_DNS]]} {[DQ [LIT_CHARS true]]}}) (List (Com {[LIT_CHARS render-template]} {[DQ [VarSub ROOT][LIT_CHARS /namespace.yaml]]} < (FilenameRedirectNode filename={[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/addons/namespace.yaml]]} "> 1), > ) (Com {[LIT_CHARS render-template]} {[DQ [VarSub ROOT][LIT_CHARS /skydns-svc.yaml]]} < (FilenameRedirectNode filename={[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/addons/skydns-svc.yaml]]} "> 1), > ) (Com {[LIT_CHARS render-template]} {[DQ [VarSub ROOT][LIT_CHARS /skydns-rc.yaml]]} < (FilenameRedirectNode filename={[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/addons/skydns-rc.yaml]]} "> 1), > ) ) ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-refresh]} {[VarSub POOL]} ) ) ) (FunctionDef destroy-network [] (List (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS e]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS net-destroy]} {[LIT_CHARS kubernetes_global]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS net-destroy]} {[LIT_CHARS kubernetes_pods]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) ) ) (FunctionDef initialize-network [] (List (Com {[LIT_CHARS virsh]} {[LIT_CHARS net-create]} {[DQ [VarSub ROOT][LIT_CHARS /network_kubernetes_global.xml]]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS net-create]} {[DQ [VarSub ROOT][LIT_CHARS /network_kubernetes_pods.xml]]} ) ) ) (FunctionDef render-template [] (Com {[LIT_CHARS eval]} {[DQ [LIT_CHARS "echo "][\ LIT_ESCAPED_CHAR "\\\""][ComSub (Com {[LIT_CHARS cat]} {[VarSub 1]})][\ LIT_ESCAPED_CHAR "\\\""]]} ) ) (FunctionDef wait-cluster-readiness [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Wait for cluster readiness"]]} ) (= scope= flags=0 words=[] bindings=[('kubectl', {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/kubectl.sh]]})]) (= scope= flags=0 words=[] bindings=[('timeout', {[LIT_CHARS 120]})]) (While (DBracket {B2 BINARY_INT_NE {[VarSub timeout]} {[LIT_CHARS 0]}}) (List (= scope= flags=0 words=[] bindings=[('nb_ready_nodes', {[ComSub (AndOr OP_OR_IF (Pipeline (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[DQ [VarSub kubectl]]} {[LIT_CHARS get]} {[LIT_CHARS nodes]} {[LIT_CHARS -o]} {[LIT_CHARS go-template] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS "{{range.items}}{{range.status.conditions}}{{.type}}{{end}}:{{end}}"]]} {[LIT_CHARS --api-version] [LIT_DBRACKET_LIKE "="] [LIT_CHARS v1]}) (Com {[LIT_CHARS tr]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS -c]} {[LIT_CHARS Ready]}) ) (Com {[LIT_CHARS true]}) )]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Nb ready nodes: "][VarSub nb_ready_nodes][LIT_CHARS " / "][VarSub NUM_NODES]]} ) (If (DBracket {B2 BINARY_INT_EQ {[DQ [VarSub nb_ready_nodes]]} {[DQ [VarSub NUM_NODES]]}}) (Com {[LIT_CHARS return]} {[LIT_CHARS 0]} ) ) (= scope= flags=0 words=[] bindings=[('timeout', {[ArithSub {A2 AS_OP_MINUS {A Atom NODE_ARITH_WORD {[VarSub timeout]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS .5]} ) ) ) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]} ) ) ) (FunctionDef kube-up [] (List (Com {[LIT_CHARS detect-master]} ) (Com {[LIT_CHARS detect-nodes]} ) (Com {[LIT_CHARS initialize-pool]} {[LIT_CHARS keep_base_image]} ) (Com {[LIT_CHARS generate_certs]} {[DQ [VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]} ) (Com {[LIT_CHARS initialize-network]} ) (= scope= flags=2 words=[] bindings=[('ssh_keys', {[DQ [ComSub (Pipeline (Com {[LIT_CHARS cat]} {[TildeSub ''] [LIT_CHARS /.ssh/] [LIT_OTHER "*"] [LIT_CHARS .pub]}) (Com {[LIT_CHARS sed]} {[SQ ]}) )]]})]) (= scope= flags=2 words=[] bindings=[('kubernetes_dir', {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes]]})]) (= scope= flags=0 words=[{[LIT_CHARS i]}] bindings=[]) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LE {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub NUM_NODES]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (If (DBracket {B2 BINARY_INT_EQ {[VarSub i]} {[VarSub NUM_NODES]}}) (Com {[LIT_CHARS etcd2_initial_cluster] [LIT_DBRACKET_LIKE "["] [VarSub i] [LIT_DBRACKET_LIKE "]="] [DQ [VarSub MASTER_NAME][LIT_CHARS "=http://"][VarSub MASTER_IP][LIT_CHARS ":2380"]]} ) (ElseTrue) (Com {[LIT_CHARS etcd2_initial_cluster] [LIT_DBRACKET_LIKE "["] [VarSub i] [LIT_DBRACKET_LIKE "]="] [DQ [VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})][LIT_CHARS "=http://"][VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})][LIT_CHARS ":2380"]]} ) ) ) (= scope= flags=0 words=[] bindings=[('etcd2_initial_cluster', {[ComSub (Com {[LIT_CHARS join]} {[LIT_COMMA ","]} {[DQ [VarSub etcd2_initial_cluster bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]})]})]) (= scope= flags=2 words=[] bindings=[('machines', {[ComSub (Com {[LIT_CHARS join]} {[LIT_COMMA ","]} {[DQ [VarSub KUBE_NODE_IP_ADDRESSES bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]})]})]) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LE {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub NUM_NODES]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (List (If (DBracket {B2 BINARY_INT_EQ {[VarSub i]} {[VarSub NUM_NODES]}}) (List (= scope= flags=0 words=[] bindings=[('type', {[LIT_CHARS master]})]) (= scope= flags=0 words=[] bindings=[('name', {[VarSub MASTER_NAME]})]) (= scope= flags=0 words=[] bindings=[('public_ip', {[VarSub MASTER_IP]})]) ) (ElseTrue) (List (= scope= flags=0 words=[] bindings=[('type', {[LIT_CHARS node-] [ComSub (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "%02d"]]} {[VarSub i]})]})]) (= scope= flags=0 words=[] bindings=[('name', {[VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})]) (= scope= flags=0 words=[] bindings=[('public_ip', {[VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})]) ) ) (= scope= flags=0 words=[] bindings=[('image', {[VarSub name] [LIT_CHARS .img]})]) (= scope= flags=0 words=[] bindings=[('config', {[LIT_CHARS kubernetes_config_] [VarSub type]})]) (Com {[LIT_CHARS virsh]} {[LIT_CHARS vol-create-as]} {[VarSub POOL]} {[VarSub image]} {[LIT_CHARS 10G]} {[LIT_CHARS --format]} {[LIT_CHARS qcow2]} {[LIT_CHARS --backing-vol]} {[LIT_CHARS coreos_base.img]} {[LIT_CHARS --backing-vol-format]} {[LIT_CHARS qcow2]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /][VarSub config][LIT_CHARS /openstack/latest]]} ) (Com {[LIT_CHARS render-template]} {[DQ [VarSub ROOT][LIT_CHARS /user_data.yml]]} < (FilenameRedirectNode filename={[DQ [VarSub POOL_PATH][LIT_CHARS /][VarSub config][LIT_CHARS /openstack/latest/user_data]]} "> 1), > ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS pool-refresh]} {[VarSub POOL]} ) (= scope= flags=0 words=[] bindings=[('domain_xml', {[ComSub (Com {[LIT_CHARS mktemp]})]})]) (Com {[LIT_CHARS render-template]} {[VarSub ROOT] [LIT_CHARS /coreos.xml]} < (FilenameRedirectNode filename={[VarSub domain_xml]} "> 1), > ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS create]} {[VarSub domain_xml]} ) (Com {[LIT_CHARS rm]} {[VarSub domain_xml]} ) ) ) (= scope= flags=1 words=[] bindings=[('KUBE_SERVER', {[DQ [LIT_CHARS "http://192.168.10.1:8080"]]})]) (= scope= flags=1 words=[] bindings=[('CONTEXT', {[DQ [LIT_CHARS libvirt-coreos]]})]) (Com {[LIT_CHARS create-kubeconfig]} ) (Com {[LIT_CHARS wait-cluster-readiness]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kubernetes cluster is running. The master is running at:"]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " http://"][VarSub KUBE_MASTER_IP][LIT_CHARS ":8080"]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "You can control the Kubernetes cluster with: 'cluster/kubectl.sh'"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "You can connect on the master with: 'ssh core@"][VarSub KUBE_MASTER_IP][LIT_CHARS "'"]]} ) ) ) (FunctionDef kube-down [] (List (Pipeline (Com {[LIT_CHARS virsh]} {[LIT_CHARS list]} ) (Com {[LIT_CHARS awk]} {[SQ 2 && !/^$/ && $2 ~ /^kubernetes/ {print $2}">]} ) (While (Com {[LIT_CHARS read]} {[LIT_CHARS dom]} ) (Com {[LIT_CHARS virsh]} {[LIT_CHARS destroy]} {[VarSub dom]} ) ) ) (Com {[LIT_CHARS destroy-pool]} {[LIT_CHARS keep_base_image]} ) (Com {[LIT_CHARS destroy-network]} ) ) ) (FunctionDef upload-server-tars [] (List (Com {[LIT_CHARS tar]} {[LIT_CHARS -x]} {[LIT_CHARS -C]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes]]} {[LIT_CHARS -f]} {[DQ [VarSub SERVER_BINARY_TAR]]} {[LIT_CHARS kubernetes]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/bin]]} ) (Com {[LIT_CHARS mv]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/kubernetes/server/bin]]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/bin]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -fr]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/kubernetes]]} ) ) ) (FunctionDef kube-push [] (List (Com {[LIT_CHARS kube-push-internal]} ) (Com {[LIT_CHARS ssh-to-node]} {[DQ [VarSub MASTER_NAME]]} {[DQ [LIT_CHARS "sudo systemctl restart kube-apiserver kube-controller-manager kube-scheduler"]]} ) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LESS {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub NUM_NODES]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (Com {[LIT_CHARS ssh-to-node]} {[DQ [VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]]} {[DQ [LIT_CHARS "sudo systemctl restart kubelet kube-proxy"]]} ) ) (Com {[LIT_CHARS wait-cluster-readiness]} ) ) ) (FunctionDef kube-push-internal [] (Case to_match={[DQ [VarSub KUBE_PUSH test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS release]}]]}, pat_word_list=[[{[LIT_CHARS release]}], [{[LIT_CHARS local]}], [{[LIT_OTHER "*"]}]] (Com {[LIT_CHARS kube-push-release]} ) (Com {[LIT_CHARS kube-push-local]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "The only known push methods are "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS release][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS " to use the release tarball or "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS local][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS " to use the binaries built by make. KUBE_PUSH is set "][\ LIT_ESCAPED_CHAR "\\\""][VarSub KUBE_PUSH][\ LIT_ESCAPED_CHAR "\\\""]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]} ) ) ) ) (FunctionDef kube-push-release [] (List (Com {[LIT_CHARS find-release-tars]} ) (Com {[LIT_CHARS upload-server-tars]} ) ) ) (FunctionDef kube-push-local [] (List (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub POOL_PATH][LIT_CHARS "/kubernetes/bin/*"]]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/bin]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /_output/local/go/bin]] [LIT_CHARS /] [LIT_OTHER "*"]} {[DQ [VarSub POOL_PATH][LIT_CHARS /kubernetes/bin]]} ) ) ) (FunctionDef test-build-release [] (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS TODO]]} ) ) (FunctionDef test-setup [] (Com {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/kube-up.sh]]} ) ) (FunctionDef test-teardown [] (Com {[LIT_CHARS kube-down]} ) ) (FunctionDef ssh-to-node [] (List (= scope= flags=0 words=[] bindings=[('node', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[] bindings=[('cmd', {[DQ [VarSub 2]]})]) (= scope= flags=0 words=[{[LIT_CHARS machine]}] bindings=[]) (If (AndOr OP_OR_IF (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub node]]} {[DQ [VarSub MASTER_IP]]}}) (DBracket {B2 BINARY_STRING_TILDE_EQUAL {[DQ [VarSub node]]} {[LIT_OTHER "^"] [DQ [VarSub NODE_IP_BASE]]}}) ) (= scope= flags=0 words=[] bindings=[('machine', {[DQ [VarSub node]]})]) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub node]]} {[DQ [VarSub MASTER_NAME]]}}) (= scope= flags=0 words=[] bindings=[('machine', {[DQ [VarSub MASTER_IP]]})]) (ElseTrue) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LESS {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub NUM_NODES]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub node]]} {[DQ [VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]]}}) (List (= scope= flags=0 words=[] bindings=[('machine', {[DQ [VarSub NODE_IPS bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]]})]) (Com {[LIT_CHARS break]} ) ) ) ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub machine]]}}) (Com {[LIT_CHARS echo]} {[DQ [VarSub node][LIT_CHARS " is an unknown machine to ssh to"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) (Com {[LIT_CHARS ssh]} {[LIT_CHARS -o]} {[LIT_VAR_LIKE "ConnectTimeout="] [LIT_CHARS 30] =} {[LIT_CHARS -o]} {[LIT_VAR_LIKE "StrictHostKeyChecking="] [LIT_CHARS no] =} {[LIT_CHARS -o]} {[LIT_VAR_LIKE "UserKnownHostsFile="] [LIT_CHARS /dev/null] =} {[LIT_CHARS -o]} {[LIT_VAR_LIKE "ControlMaster="] [LIT_CHARS no] =} {[DQ [LIT_CHARS "core@"][VarSub machine]]} {[DQ [VarSub cmd]]} ) ) ) (FunctionDef prepare-e2e [] (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "libvirt-coreos doesn't need special preparations for e2e tests"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) )