(List (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /../..]})]) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/][VarSub KUBE_CONFIG_FILE test_op=VS_TEST_HYPHEN {[DQ [LIT_CHARS config-default.sh]]}]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/common.sh]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/lib/util.sh]]} ) (= scope= flags=0 words=[] bindings=[('ALLOCATE_NODE_CIDRS', {[LIT_CHARS true]})]) (= scope= flags=0 words=[] bindings=[('NODE_INSTANCE_PREFIX', {[DQ [VarSub INSTANCE_PREFIX][LIT_CHARS -minion]]})]) (= scope= flags=0 words=[] bindings=[('ASG_NAME', {[DQ [VarSub NODE_INSTANCE_PREFIX][LIT_CHARS -group-][VarSub ZONE]]})]) (= scope= flags=0 words=[] bindings=[('MASTER_DISK_ID', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('TAG_KEY_MASTER_IP', {[DQ [LIT_CHARS kubernetes.io/master-ip]]})]) (= scope= flags=0 words=[] bindings=[('OS_DISTRIBUTION', {[VarSub KUBE_OS_DISTRIBUTION]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub OS_DISTRIBUTION]]} {[DQ [LIT_CHARS ubuntu]]}}) (= scope= flags=0 words=[] bindings=[('OS_DISTRIBUTION', {[LIT_CHARS wily]})]) ) (FunctionDef load_distro_utils [] (List (Case to_match={[DQ [VarSub OS_DISTRIBUTION]]}, pat_word_list=[[{[LIT_CHARS jessie]}], [{[LIT_CHARS wily]}], [{[LIT_CHARS vivid]}], [{[LIT_CHARS coreos]}], [{[LIT_CHARS trusty]}], [{[LIT_CHARS wheezy]}], [{[LIT_OTHER "*"]}]] (ElseTrue) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "vivid is no longer supported by kube-up; please use jessie instead"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "coreos is no longer supported by kube-up; please use jessie instead"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "trusty is no longer supported by kube-up; please use jessie or wily instead"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "wheezy is no longer supported by kube-up; please use jessie instead"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cannot start cluster using os distro: "][VarSub OS_DISTRIBUTION]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "The current recommended distro is jessie"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/][VarSub OS_DISTRIBUTION][LIT_CHARS /util.sh]]} ) ) ) (Com {[LIT_CHARS load_distro_utils]} ) (= scope= flags=0 words=[] bindings=[('re', {[SQ ]})]) (If (DBracket {B2 BINARY_STRING_TILDE_EQUAL {[VarSub ZONE transform_ops=[Slice {A1 NODE_UNARY_MINUS {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}} } None]]} {[VarSub re]}}) (= scope= flags=0 words=[] bindings=[('AWS_REGION', {[VarSub ZONE transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS "?"]}]]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('AWS_REGION', {[VarSub ZONE]})]) ) (= scope= flags=1 words=[] bindings=[('AWS_DEFAULT_REGION', {[VarSub AWS_REGION]})]) (= scope= flags=1 words=[] bindings=[('AWS_DEFAULT_OUTPUT', {[LIT_CHARS text]})]) (= scope= flags=0 words=[] bindings=[('AWS_CMD', {[DQ [LIT_CHARS "aws ec2"]]})]) (= scope= flags=0 words=[] bindings=[('AWS_ASG_CMD', {[DQ [LIT_CHARS "aws autoscaling"]]})]) (= scope= flags=0 words=[] bindings=[('VPC_CIDR_BASE', {[VarSub KUBE_VPC_CIDR_BASE test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS 172.20]}]})]) (= scope= flags=0 words=[] bindings=[('MASTER_IP_SUFFIX', {[LIT_CHARS .9]})]) (= scope= flags=0 words=[] bindings=[('VPC_CIDR', {[VarSub VPC_CIDR_BASE] [LIT_CHARS .0.0/16]})]) (= scope= flags=0 words=[] bindings=[('SUBNET_CIDR', {[VarSub VPC_CIDR_BASE] [LIT_CHARS .0.0/24]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub KUBE_SUBNET_CIDR test_op=VS_TEST_COLON_HYPHEN {}]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using subnet CIDR override: "][VarSub KUBE_SUBNET_CIDR]]} ) (= scope= flags=0 words=[] bindings=[('SUBNET_CIDR', {[VarSub KUBE_SUBNET_CIDR]})]) ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_INTERNAL_IP test_op=VS_TEST_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('MASTER_INTERNAL_IP', {[DQ [VarSub SUBNET_CIDR transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS ".*"]}]][VarSub MASTER_IP_SUFFIX]]})]) ) (= scope= flags=0 words=[] bindings=[('MASTER_SG_NAME', {[DQ [LIT_CHARS kubernetes-master-][VarSub CLUSTER_ID]]})]) (= scope= flags=0 words=[] bindings=[('NODE_SG_NAME', {[DQ [LIT_CHARS kubernetes-minion-][VarSub CLUSTER_ID]]})]) (= scope= flags=0 words=[] bindings=[('IAM_PROFILE_MASTER', {[DQ [LIT_CHARS kubernetes-master-][VarSub CLUSTER_ID][LIT_CHARS -][VarSub VPC_NAME]]})]) (= scope= flags=0 words=[] bindings=[('IAM_PROFILE_NODE', {[DQ [LIT_CHARS kubernetes-minion-][VarSub CLUSTER_ID][LIT_CHARS -][VarSub VPC_NAME]]})]) (= scope= flags=0 words=[] bindings=[('EPHEMERAL_BLOCK_DEVICE_MAPPINGS', {[DQ [LIT_CHARS ",{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ": "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS /dev/sdc][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VirtualName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ephemeral0][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "},{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ": "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS /dev/sdd][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VirtualName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ephemeral1][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "},{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ": "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS /dev/sde][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VirtualName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ephemeral2][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "},{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ": "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS /dev/sdf][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VirtualName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ephemeral3][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "}"]]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub KUBE_AWS_STORAGE test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS ebs]]}}) (= scope= flags=0 words=[] bindings=[('EPHEMERAL_BLOCK_DEVICE_MAPPINGS', {[DQ ]})]) ) (FunctionDef get_vpc_id [] (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-vpcs]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS Name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub VPC_NAME] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS Vpcs] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .VpcId]} ) ) (FunctionDef get_subnet_id [] (List (= scope= flags=0 words=[] bindings=[('vpc_id', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('az', {[VarSub 2]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-subnets]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS availabilityZone] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub az] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_CHARS --query]} {[LIT_CHARS Subnets] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .SubnetId]} ) ) ) (FunctionDef get_igw_id [] (List (= scope= flags=0 words=[] bindings=[('vpc_id', {[VarSub 1]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-internet-gateways]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS attachment.vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_CHARS --query]} {[LIT_CHARS InternetGateways] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .InternetGatewayId]} ) ) ) (FunctionDef get_elbs_in_vpc [] (Pipeline (Com {[LIT_CHARS aws]} {[LIT_CHARS elb]} {[LIT_CHARS --output]} {[LIT_CHARS json]} {[LIT_CHARS describe-load-balancers]} ) (Com {[LIT_CHARS python]} {[LIT_CHARS -c]} {[DQ [LIT_CHARS "import json,sys; lst = [str(lb['LoadBalancerName']) for lb in json.load(sys.stdin)['LoadBalancerDescriptions'] if 'VPCId' in lb and lb['VPCId'] == '"][VarSub 1][LIT_CHARS "']; print('"][\ LIT_ESCAPED_CHAR "\\n"][LIT_CHARS "'.join(lst))"]]} ) ) ) (FunctionDef get_instanceid_from_name [] (List (= scope= flags=0 words=[] bindings=[('tagName', {[VarSub 1]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS Name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub tagName] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS instance-state-name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [LIT_CHARS running] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .InstanceId]} ) ) ) (FunctionDef get_instance_public_ip [] (List (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 1]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --instance-ids]} {[VarSub instance_id]} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .NetworkInterfaces] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0] [LIT_DBRACKET_LIKE "]"] [LIT_CHARS .Association.PublicIp]} ) ) ) (FunctionDef get_instance_private_ip [] (List (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 1]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --instance-ids]} {[VarSub instance_id]} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .NetworkInterfaces] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0] [LIT_DBRACKET_LIKE "]"] [LIT_CHARS .PrivateIpAddress]} ) ) ) (FunctionDef get_security_group_id [] (List (= scope= flags=0 words=[] bindings=[('name', {[VarSub 1]})]) (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-security-groups]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub VPC_ID] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS group-name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub name] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS SecurityGroups] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .GroupId]} ) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} ) ) ) ) (FunctionDef find-tagged-master-ip [] (List (Com {[LIT_CHARS find-master-pd]} ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub MASTER_DISK_ID test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_IP', {[ComSub (Com {[LIT_CHARS get-tag]} {[VarSub MASTER_DISK_ID]} {[VarSub TAG_KEY_MASTER_IP]})]})]) ) ) ) (FunctionDef get-tag [] (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-tags]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS resource-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub 1] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS key] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub 2] =} {[LIT_CHARS --query]} {[LIT_CHARS Tags] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Value]} ) ) (FunctionDef detect-master [] (List (Com {[LIT_CHARS find-tagged-master-ip]} ) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER', {[VarSub MASTER_NAME]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub KUBE_MASTER_IP test_op=VS_TEST_COLON_HYPHEN {}]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect Kubernetes master node IP. Make sure you've launched a cluster with 'kube-up.sh'"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using master: "][VarSub KUBE_MASTER][LIT_CHARS " (external IP: "][VarSub KUBE_MASTER_IP][LIT_CHARS ")"]]} ) ) ) (FunctionDef get-master-env [] (Com {[LIT_CHARS ssh]} {[LIT_CHARS -oStrictHostKeyChecking] [LIT_DBRACKET_LIKE "="] [LIT_CHARS no]} {[LIT_CHARS -i]} {[DQ [VarSub AWS_SSH_KEY]]} {[VarSub SSH_USER] [LIT_OTHER "@"] [VarSub KUBE_MASTER_IP]} {[LIT_CHARS sudo]} {[LIT_CHARS cat]} {[LIT_CHARS /etc/kubernetes/kube_env.yaml]} ) ) (FunctionDef query-running-minions [] (List (= scope= flags=0 words=[] bindings=[('query', {[VarSub 1]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS instance-state-name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [LIT_CHARS running] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub VPC_ID] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS aws] [LIT_OTHER ":"] [LIT_CHARS autoscaling] [LIT_OTHER ":"] [LIT_CHARS groupName] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub ASG_NAME] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS Role] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub NODE_TAG] =} {[LIT_CHARS --query]} {[VarSub query]} ) ) ) (FunctionDef detect-node-names [] (List (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub VPC_ID test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('VPC_ID', {[ComSub (Com {[LIT_CHARS get_vpc_id]})]})]) ) (= scope= flags=0 words=[] bindings=[('NODE_IDS', {[Array ]})]) (= scope= flags=0 words=[] bindings=[('NODE_NAMES', {[Array ]})]) (For id [{[ComSub (Com {[LIT_CHARS query-running-minions]} {[DQ [LIT_CHARS "Reservations[].Instances[].InstanceId"]]})]}]) (List (= scope= flags=0 words=[] bindings=[('NODE_IDS+', {[Array {[DQ [VarSub id]]}]})]) (= scope= flags=0 words=[] bindings=[('NODE_NAMES+', {[Array {[DQ [VarSub id]]}]})]) ) ) ) ) (FunctionDef detect-project [] (Com {[LIT_OTHER ":"]} ) ) (FunctionDef detect-nodes [] (List (Com {[LIT_CHARS detect-node-names]} ) (= scope= flags=0 words=[] bindings=[('KUBE_NODE_IP_ADDRESSES', {[Array ]})]) (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 NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (List (= scope= flags=0 words=[{[LIT_CHARS minion_ip]}] bindings=[]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub ENABLE_NODE_PUBLIC_IP]]} {[DQ [LIT_CHARS true]]}}) (= scope= flags=0 words=[] bindings=[('minion_ip', {[ComSub (Com {[LIT_CHARS get_instance_public_ip]} {[VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('minion_ip', {[ComSub (Com {[LIT_CHARS get_instance_private_ip]} {[VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})]})]) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Found minion "][VarSub i][LIT_CHARS ": "][VarSub NODE_NAMES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})][LIT_CHARS " @ "][VarSub minion_ip]]} ) (= scope= flags=0 words=[] bindings=[('KUBE_NODE_IP_ADDRESSES+', {[Array {[DQ [VarSub minion_ip]]}]})]) ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub KUBE_NODE_IP_ADDRESSES]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect Kubernetes minion nodes. Make sure you've launched a cluster with 'kube-up.sh'"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (FunctionDef detect-security-groups [] (List (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_SG_ID test_op=VS_TEST_HYPHEN {}]]}}) (List (= scope= flags=0 words=[] bindings=[('MASTER_SG_ID', {[ComSub (Com {[LIT_CHARS get_security_group_id]} {[DQ [VarSub MASTER_SG_NAME]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_SG_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect Kubernetes master security group. Make sure you've launched a cluster with 'kube-up.sh'"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using master security group: "][VarSub MASTER_SG_NAME][LIT_CHARS " "][VarSub MASTER_SG_ID]]} ) ) ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub NODE_SG_ID test_op=VS_TEST_HYPHEN {}]]}}) (List (= scope= flags=0 words=[] bindings=[('NODE_SG_ID', {[ComSub (Com {[LIT_CHARS get_security_group_id]} {[DQ [VarSub NODE_SG_NAME]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub NODE_SG_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect Kubernetes minion security group. Make sure you've launched a cluster with 'kube-up.sh'"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using minion security group: "][VarSub NODE_SG_NAME][LIT_CHARS " "][VarSub NODE_SG_ID]]} ) ) ) ) ) ) (FunctionDef detect-image [] (Case to_match={[DQ [VarSub OS_DISTRIBUTION]]}, pat_word_list=[[{[LIT_CHARS wily]}], [{[LIT_CHARS jessie]}], [{[LIT_OTHER "*"]}]] (Com {[LIT_CHARS detect-wily-image]} ) (Com {[LIT_CHARS detect-jessie-image]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Please specify AWS_IMAGE directly (distro "][VarSub OS_DISTRIBUTION][LIT_CHARS " not recognized)"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 2]} ) ) ) ) (FunctionDef detect-root-device [] (List (= scope= flags=0 words=[] bindings=[('master_image', {[VarSub AWS_IMAGE]})]) (= scope= flags=0 words=[] bindings=[('node_image', {[VarSub KUBE_NODE_IMAGE]})]) (= scope= flags=0 words=[] bindings=[('ROOT_DEVICE_MASTER', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-images]} {[LIT_CHARS --image-ids]} {[VarSub master_image]} {[LIT_CHARS --query]} {[SQ ]})]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub master_image]]} {[DQ [VarSub node_image]]}}) (= scope= flags=0 words=[] bindings=[('ROOT_DEVICE_NODE', {[VarSub ROOT_DEVICE_MASTER]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('ROOT_DEVICE_NODE', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-images]} {[LIT_CHARS --image-ids]} {[VarSub node_image]} {[LIT_CHARS --query]} {[SQ ]})]})]) ) (= scope= flags=0 words=[] bindings=[('MASTER_BLOCK_DEVICE_MAPPINGS', {[DQ [LIT_CHARS "[{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][VarSub ROOT_DEVICE_MASTER][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS Ebs][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeleteOnTermination][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":true,"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VolumeSize][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][VarSub MASTER_ROOT_DISK_SIZE][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VolumeType][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][VarSub MASTER_ROOT_DISK_TYPE][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "}} "][VarSub EPHEMERAL_BLOCK_DEVICE_MAPPINGS][LIT_CHARS "]"]]})]) (= scope= flags=0 words=[] bindings=[('NODE_BLOCK_DEVICE_MAPPINGS', {[DQ [LIT_CHARS "[{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeviceName][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][VarSub ROOT_DEVICE_NODE][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS Ebs][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":{"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS DeleteOnTermination][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":true,"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VolumeSize][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][VarSub NODE_ROOT_DISK_SIZE][LIT_CHARS ","][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS VolumeType][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\\""][VarSub NODE_ROOT_DISK_TYPE][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS "}} "][VarSub EPHEMERAL_BLOCK_DEVICE_MAPPINGS][LIT_CHARS "]"]]})]) ) ) (FunctionDef get-aws-fingerprint [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('pubkey_path', {[VarSub 1]})]) (Pipeline (Com {[LIT_CHARS ssh-keygen]} {[LIT_CHARS -f]} {[VarSub pubkey_path]} {[LIT_CHARS -e]} {[LIT_CHARS -m]} {[LIT_CHARS PKCS8]} ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS rsa]} {[LIT_CHARS -pubin]} {[LIT_CHARS -outform]} {[LIT_CHARS DER]} ) (Com {[LIT_CHARS openssl]} {[LIT_CHARS md5]} {[LIT_CHARS -c]} ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[SQ ]} ) ) ) ) (FunctionDef get-ssh-fingerprint [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('pubkey_path', {[VarSub 1]})]) (Pipeline (Com {[LIT_CHARS ssh-keygen]} {[LIT_CHARS -lf]} {[VarSub pubkey_path]} ) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f2]} {[LIT_CHARS -d] [SQ ]} ) ) ) ) (FunctionDef import-public-key [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('name', {[VarSub 1]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('path', {[VarSub 2]})]) (= scope= flags=0 words=[] bindings=[('ok', {[LIT_CHARS 1]})]) (= scope= flags=0 words=[] bindings=[('output', {[DQ ]})]) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('output', {[ComSub (Com redirects=[(DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2)]{[VarSub AWS_CMD]} {[LIT_CHARS import-key-pair]} {[LIT_CHARS --key-name]} {[VarSub name]} {[LIT_CHARS --public-key-material]} {[DQ [LIT_CHARS "file://"][VarSub path]]})]})]) (= scope= flags=0 words=[] bindings=[('ok', {[LIT_CHARS 0]})]) ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub ok]} {[LIT_CHARS 0]}}) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub output]]} {[LIT_OTHER "*"] [DQ [LIT_CHARS InvalidKeyPair.Duplicate]] [LIT_OTHER "*"]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Error importing public key"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Output: "][VarSub output]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) ) (FunctionDef create-security-group [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('name', {[VarSub 1]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('description', {[VarSub 2]})]) (= scope= flags=0 words=[] bindings=[('sgid', {[ComSub (Com {[LIT_CHARS get_security_group_id]} {[DQ [VarSub name]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub sgid]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating security group "][VarSub name][LIT_CHARS .]]} ) (= scope= flags=0 words=[] bindings=[('sgid', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-security-group]} {[LIT_CHARS --group-name]} {[DQ [VarSub name]]} {[LIT_CHARS --description]} {[DQ [VarSub description]]} {[LIT_CHARS --vpc-id]} {[DQ [VarSub VPC_ID]]} {[LIT_CHARS --query]} {[LIT_CHARS GroupId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub sgid]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) ) ) ) (FunctionDef authorize-security-group-ingress [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('sgid', {[VarSub 1]})]) (Com {[LIT_CHARS shift]} ) (= scope= flags=0 words=[] bindings=[('ok', {[LIT_CHARS 1]})]) (= scope= flags=0 words=[] bindings=[('output', {[DQ ]})]) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('output', {[ComSub (Com redirects=[(DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2)]{[VarSub AWS_CMD]} {[LIT_CHARS authorize-security-group-ingress]} {[LIT_CHARS --group-id]} {[DQ [VarSub sgid]]} {[VarSub @]})]})]) (= scope= flags=0 words=[] bindings=[('ok', {[LIT_CHARS 0]})]) ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub ok]} {[LIT_CHARS 0]}}) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub output]]} {[LIT_OTHER "*"] [DQ [LIT_CHARS InvalidPermission.Duplicate]] [LIT_OTHER "*"]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Error creating security group ingress rule"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Output: "][VarSub output]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) ) (FunctionDef find-master-pd [] (List (= scope= flags=0 words=[] bindings=[('name', {[VarSub MASTER_NAME] [LIT_CHARS -pd]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_DISK_ID]]}}) (List (= scope= flags=0 words=[] bindings=[('zone_filter', {[DQ [LIT_CHARS "Name=availability-zone,Values="][VarSub ZONE]]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub KUBE_USE_EXISTING_MASTER test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS true]]}}) (= scope= flags=0 words=[] bindings=[('zone_filter', {[DQ ]})]) ) (= scope= flags=0 words=[] bindings=[('MASTER_DISK_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-volumes]} {[LIT_CHARS --filters]} {[VarSub zone_filter]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS Name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub name] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS Volumes] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .VolumeId]})]})]) ) ) ) ) (FunctionDef ensure-master-pd [] (List (= scope= flags=0 words=[] bindings=[('name', {[VarSub MASTER_NAME] [LIT_CHARS -pd]})]) (Com {[LIT_CHARS find-master-pd]} ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_DISK_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating master disk: size "][VarSub MASTER_DISK_SIZE][LIT_CHARS "GB, type "][VarSub MASTER_DISK_TYPE]]} ) (= scope= flags=0 words=[] bindings=[('MASTER_DISK_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-volume]} {[LIT_CHARS --availability-zone]} {[VarSub ZONE]} {[LIT_CHARS --volume-type]} {[VarSub MASTER_DISK_TYPE]} {[LIT_CHARS --size]} {[VarSub MASTER_DISK_SIZE]} {[LIT_CHARS --query]} {[LIT_CHARS VolumeId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub MASTER_DISK_ID]} {[LIT_CHARS Name]} {[VarSub name]} ) (Com {[LIT_CHARS add-tag]} {[VarSub MASTER_DISK_ID]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) ) ) ) (FunctionDef reboot-on-failure [] (List (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 1]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating Cloudwatch alarm to reboot instance "][VarSub instance_id][LIT_CHARS " on failure"]]} ) (= scope= flags=0 words=[] bindings=[('aws_owner_id', {[ComSub (Com {[LIT_CHARS aws]} {[LIT_CHARS ec2]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --instance-ids]} {[VarSub instance_id]} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0] [LIT_DBRACKET_LIKE "]"] [LIT_CHARS .OwnerId]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub aws_owner_id]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Unable to determinate AWS account id for "][VarSub instance_id]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS aws]} {[LIT_CHARS cloudwatch]} {[LIT_CHARS put-metric-alarm]} {[LIT_CHARS --alarm-name]} {[LIT_CHARS k8s-] [VarSub instance_id] [LIT_CHARS -statuscheckfailure-reboot]} {[LIT_CHARS --alarm-description]} {[DQ [LIT_CHARS "Reboot "][VarSub instance_id][LIT_CHARS " on status check failure"]]} {[LIT_CHARS --namespace]} {[DQ [LIT_CHARS AWS/EC2]]} {[LIT_CHARS --dimensions]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS InstanceId] [LIT_COMMA ","] [LIT_VAR_LIKE "Value="] [VarSub instance_id] =} {[LIT_CHARS --statistic]} {[LIT_CHARS Minimum]} {[LIT_CHARS --metric-name]} {[LIT_CHARS StatusCheckFailed]} {[LIT_CHARS --comparison-operator]} {[LIT_CHARS GreaterThanThreshold]} {[LIT_CHARS --threshold]} {[LIT_CHARS 0]} {[LIT_CHARS --period]} {[LIT_CHARS 60]} {[LIT_CHARS --evaluation-periods]} {[LIT_CHARS 3]} {[LIT_CHARS --alarm-actions]} {[LIT_CHARS arn] [LIT_OTHER ":"] [LIT_CHARS aws] [LIT_OTHER ":"] [LIT_CHARS swf] [LIT_OTHER ":"] [VarSub AWS_REGION] [LIT_OTHER ":"] [VarSub aws_owner_id] [LIT_OTHER ":"] [LIT_CHARS action/actions/AWS_EC2.InstanceId.Reboot/1.0]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (FunctionDef delete-instance-alarms [] (List (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('alarm_names', {[ComSub (Com {[LIT_CHARS aws]} {[LIT_CHARS cloudwatch]} {[LIT_CHARS describe-alarms]} {[LIT_CHARS --alarm-name-prefix]} {[LIT_CHARS k8s-] [VarSub instance_id] [LIT_CHARS -]} {[LIT_CHARS --query]} {[LIT_CHARS MetricAlarms] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .AlarmName]})]})]) (For alarm_name [{[VarSub alarm_names]}]) (Com {[LIT_CHARS aws]} {[LIT_CHARS cloudwatch]} {[LIT_CHARS delete-alarms]} {[LIT_CHARS --alarm-names]} {[VarSub alarm_name]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) ) (FunctionDef ensure-master-ip [] (List (Com {[LIT_CHARS find-tagged-master-ip]} ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub KUBE_MASTER_IP test_op=VS_TEST_COLON_HYPHEN {}]]}}) (List (If (DBracket {B2 BINARY_STRING_TILDE_EQUAL {[DQ [VarSub MASTER_RESERVED_IP]]} {[LIT_OTHER "^"] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0-9] [LIT_DBRACKET_LIKE "]"] [LIT_OTHER "+"] [\ LIT_ESCAPED_CHAR "\\."] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0-9] [LIT_DBRACKET_LIKE "]"] [LIT_OTHER "+"] [\ LIT_ESCAPED_CHAR "\\."] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0-9] [LIT_DBRACKET_LIKE "]"] [LIT_OTHER "+"] [\ LIT_ESCAPED_CHAR "\\."] [LIT_DBRACKET_LIKE "["] [LIT_CHARS 0-9] [LIT_DBRACKET_LIKE "]"] [LIT_OTHER "+"] [LIT_OTHER "$"]}}) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_IP', {[DQ [VarSub MASTER_RESERVED_IP]]})]) (ElseTrue) (List (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_IP', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS allocate-address]} {[LIT_CHARS --domain]} {[LIT_CHARS vpc]} {[LIT_CHARS --query]} {[LIT_CHARS PublicIp]})]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Allocated Elastic IP for master: "][VarSub KUBE_MASTER_IP]]} ) ) ) (Com {[LIT_CHARS add-tag]} {[VarSub MASTER_DISK_ID]} {[VarSub TAG_KEY_MASTER_IP]} {[VarSub KUBE_MASTER_IP]} ) ) ) ) ) (FunctionDef create-dhcp-option-set [] (List (If (DBracket {B1 UNARY_STRING_z {[VarSub DHCP_OPTION_SET_ID test_op=VS_TEST_HYPHEN {}]}}) (List (Case to_match={[DQ [VarSub AWS_REGION]]}, pat_word_list=[[{[LIT_CHARS us-east-1]}], [{[LIT_OTHER "*"]}]] (= scope= flags=0 words=[] bindings=[('OPTION_SET_DOMAIN', {[LIT_CHARS ec2.internal]})]) (= scope= flags=0 words=[] bindings=[('OPTION_SET_DOMAIN', {[DQ [VarSub AWS_REGION][LIT_CHARS .compute.internal]]})]) ) (= scope= flags=0 words=[] bindings=[('DHCP_OPTION_SET_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-dhcp-options]} {[LIT_CHARS --dhcp-configuration]} {[LIT_VAR_LIKE "Key="] [LIT_CHARS domain-name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub OPTION_SET_DOMAIN] =} {[LIT_VAR_LIKE "Key="] [LIT_CHARS domain-name-servers] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [LIT_CHARS AmazonProvidedDNS] =} {[LIT_CHARS --query]} {[LIT_CHARS DhcpOptions.DhcpOptionsId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub DHCP_OPTION_SET_ID]} {[LIT_CHARS Name]} {[LIT_CHARS kubernetes-dhcp-option-set]} ) (Com {[LIT_CHARS add-tag]} {[VarSub DHCP_OPTION_SET_ID]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS associate-dhcp-options]} {[LIT_CHARS --dhcp-options-id]} {[VarSub DHCP_OPTION_SET_ID]} {[LIT_CHARS --vpc-id]} {[VarSub VPC_ID]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using DHCP option set "][VarSub DHCP_OPTION_SET_ID]]} ) ) ) (FunctionDef verify-prereqs [] (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS aws]})]]} {[DQ ]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Can't find aws in PATH, please fix and retry."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) (FunctionDef ensure-temp-dir [] (If (DBracket {B1 UNARY_STRING_z {[VarSub KUBE_TEMP test_op=VS_TEST_HYPHEN {}]}}) (List (= scope= flags=0 words=[] bindings=[('KUBE_TEMP', {[ComSub (Com {[LIT_CHARS mktemp]} {[LIT_CHARS -d]} {[LIT_CHARS -t]} {[LIT_CHARS kubernetes.XXXXXX]})]})]) (Com {[LIT_CHARS trap]} {[SQ ]} {[LIT_CHARS EXIT]} ) ) ) ) (FunctionDef upload-server-tars [] (List (= scope= flags=0 words=[] bindings=[('SERVER_BINARY_TAR_URL', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('SERVER_BINARY_TAR_HASH', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('SALT_TAR_URL', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('SALT_TAR_HASH', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('BOOTSTRAP_SCRIPT_URL', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('BOOTSTRAP_SCRIPT_HASH', {[SQ ]})]) (Com {[LIT_CHARS ensure-temp-dir]} ) (= scope= flags=0 words=[] bindings=[('SERVER_BINARY_TAR_HASH', {[ComSub (Com {[LIT_CHARS sha1sum-file]} {[DQ [VarSub SERVER_BINARY_TAR]]})]})]) (= scope= flags=0 words=[] bindings=[('SALT_TAR_HASH', {[ComSub (Com {[LIT_CHARS sha1sum-file]} {[DQ [VarSub SALT_TAR]]})]})]) (= scope= flags=0 words=[] bindings=[('BOOTSTRAP_SCRIPT_HASH', {[ComSub (Com {[LIT_CHARS sha1sum-file]} {[DQ [VarSub BOOTSTRAP_SCRIPT]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[VarSub AWS_S3_BUCKET test_op=VS_TEST_HYPHEN {}]}}) (List (= scope= flags=0 words=[] bindings=[('project_hash', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('key', {[ComSub (Com {[LIT_CHARS aws]} {[LIT_CHARS configure]} {[LIT_CHARS get]} {[LIT_CHARS aws_access_key_id]})]})]) (If (Com {[LIT_CHARS which]} {[LIT_CHARS md5]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) (= scope= flags=0 words=[] bindings=[('project_hash', {[ComSub (Com {[LIT_CHARS md5]} {[LIT_CHARS -q]} {[LIT_CHARS -s]} {[DQ [VarSub USER][LIT_CHARS " "][VarSub key][LIT_CHARS " "][VarSub INSTANCE_PREFIX]]})]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('project_hash', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[LIT_CHARS -n]} {[DQ [VarSub USER][LIT_CHARS " "][VarSub key][LIT_CHARS " "][VarSub INSTANCE_PREFIX]]}) (Com {[LIT_CHARS md5sum]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) ) (= scope= flags=0 words=[] bindings=[('AWS_S3_BUCKET', {[DQ [LIT_CHARS kubernetes-staging-][VarSub project_hash]]})]) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Uploading to Amazon S3"]]} ) (If (Pipeline! (Com {[LIT_CHARS aws]} {[LIT_CHARS s3api]} {[LIT_CHARS get-bucket-location]} {[LIT_CHARS --bucket]} {[VarSub AWS_S3_BUCKET]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating "][VarSub AWS_S3_BUCKET]]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS s3]} {[LIT_CHARS mb]} {[DQ [LIT_CHARS "s3://"][VarSub AWS_S3_BUCKET]]} {[LIT_CHARS --region]} {[VarSub AWS_S3_REGION]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Confirming bucket was created..."]]} ) (= scope= flags=0 words=[] bindings=[('attempt', {[LIT_CHARS 0]})]) (While (Com {[LIT_CHARS true]} ) (List (If (Pipeline! (Com {[LIT_CHARS aws]} {[LIT_CHARS s3]} {[LIT_CHARS ls]} {[LIT_CHARS --region]} {[VarSub AWS_S3_REGION]} {[DQ [LIT_CHARS "s3://"][VarSub AWS_S3_BUCKET]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) ) (If (DParen {A2 AS_OP_GREAT {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 120]}}}) (List (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_red][LIT_CHARS "Unable to confirm bucket creation."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Please ensure that s3://"][VarSub AWS_S3_BUCKET][LIT_CHARS " exists"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS "and run the script again. (sorry!)"][VarSub color_norm]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (ElseTrue) (Com {[LIT_CHARS break]} ) ) (= scope= flags=0 words=[] bindings=[('attempt', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 1]} ) ) ) ) ) (= scope= flags=0 words=[] bindings=[('s3_bucket_location', {[ComSub (Com {[LIT_CHARS aws]} {[LIT_CHARS s3api]} {[LIT_CHARS get-bucket-location]} {[LIT_CHARS --bucket]} {[VarSub AWS_S3_BUCKET]})]})]) (= scope= flags=0 words=[] bindings=[('s3_url_base', {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //s3-] [VarSub s3_bucket_location] [LIT_CHARS .amazonaws.com]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub s3_bucket_location]]} {[DQ [LIT_CHARS None]]}}) (List (= scope= flags=0 words=[] bindings=[('s3_url_base', {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //s3.amazonaws.com]})]) (= scope= flags=0 words=[] bindings=[('s3_bucket_location', {[LIT_CHARS us-east-1]})]) ) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub s3_bucket_location]]} {[DQ [LIT_CHARS cn-north-1]]}}) (= scope= flags=0 words=[] bindings=[('s3_url_base', {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //s3.cn-north-1.amazonaws.com.cn]})]) ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('staging_path', {[DQ [LIT_CHARS devel]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('local_dir', {[DQ [VarSub KUBE_TEMP][LIT_CHARS /s3/]]})]) (Com {[LIT_CHARS mkdir]} {[VarSub local_dir]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "+++ Staging server tars to S3 Storage: "][VarSub AWS_S3_BUCKET][LIT_CHARS /][VarSub staging_path]]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS -a]} {[DQ [VarSub SERVER_BINARY_TAR]]} {[VarSub local_dir]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS -a]} {[DQ [VarSub SALT_TAR]]} {[VarSub local_dir]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS -a]} {[DQ [VarSub BOOTSTRAP_SCRIPT]]} {[VarSub local_dir]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS s3]} {[LIT_CHARS sync]} {[LIT_CHARS --region]} {[VarSub s3_bucket_location]} {[LIT_CHARS --exact-timestamps]} {[VarSub local_dir]} {[DQ [LIT_CHARS "s3://"][VarSub AWS_S3_BUCKET][LIT_CHARS /][VarSub staging_path][LIT_CHARS /]]} ) (= scope= flags=0 words=[] bindings=[('server_binary_path', {[DQ [VarSub staging_path][LIT_CHARS /][VarSub SERVER_BINARY_TAR transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (Com {[LIT_CHARS aws]} {[LIT_CHARS s3api]} {[LIT_CHARS put-object-acl]} {[LIT_CHARS --region]} {[VarSub s3_bucket_location]} {[LIT_CHARS --bucket]} {[VarSub AWS_S3_BUCKET]} {[LIT_CHARS --key]} {[DQ [VarSub server_binary_path]]} {[LIT_CHARS --grant-read]} {[SQ ]} ) (= scope= flags=0 words=[] bindings=[('SERVER_BINARY_TAR_URL', {[DQ [VarSub s3_url_base][LIT_CHARS /][VarSub AWS_S3_BUCKET][LIT_CHARS /][VarSub server_binary_path]]})]) (= scope= flags=0 words=[] bindings=[('salt_tar_path', {[DQ [VarSub staging_path][LIT_CHARS /][VarSub SALT_TAR transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (Com {[LIT_CHARS aws]} {[LIT_CHARS s3api]} {[LIT_CHARS put-object-acl]} {[LIT_CHARS --region]} {[VarSub s3_bucket_location]} {[LIT_CHARS --bucket]} {[VarSub AWS_S3_BUCKET]} {[LIT_CHARS --key]} {[DQ [VarSub salt_tar_path]]} {[LIT_CHARS --grant-read]} {[SQ ]} ) (= scope= flags=0 words=[] bindings=[('SALT_TAR_URL', {[DQ [VarSub s3_url_base][LIT_CHARS /][VarSub AWS_S3_BUCKET][LIT_CHARS /][VarSub salt_tar_path]]})]) (= scope= flags=0 words=[] bindings=[('bootstrap_script_path', {[DQ [VarSub staging_path][LIT_CHARS /][VarSub BOOTSTRAP_SCRIPT transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (Com {[LIT_CHARS aws]} {[LIT_CHARS s3api]} {[LIT_CHARS put-object-acl]} {[LIT_CHARS --region]} {[VarSub s3_bucket_location]} {[LIT_CHARS --bucket]} {[VarSub AWS_S3_BUCKET]} {[LIT_CHARS --key]} {[DQ [VarSub bootstrap_script_path]]} {[LIT_CHARS --grant-read]} {[SQ ]} ) (= scope= flags=0 words=[] bindings=[('BOOTSTRAP_SCRIPT_URL', {[DQ [VarSub s3_url_base][LIT_CHARS /][VarSub AWS_S3_BUCKET][LIT_CHARS /][VarSub bootstrap_script_path]]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Uploaded server tars:"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " SERVER_BINARY_TAR_URL: "][VarSub SERVER_BINARY_TAR_URL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " SALT_TAR_URL: "][VarSub SALT_TAR_URL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " BOOTSTRAP_SCRIPT_URL: "][VarSub BOOTSTRAP_SCRIPT_URL]]} ) ) ) (FunctionDef add-tag [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Adding tag to "][VarSub 1][LIT_CHARS ": "][VarSub 2][LIT_CHARS "="][VarSub 3]]} ) (= scope= flags=0 words=[] bindings=[('n', {[LIT_CHARS 0]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub n]} {[LIT_CHARS -ge]} {[LIT_CHARS 25]} {[LIT_DBRACKET_LIKE "]"]} ) (List (AndOr OP_AND_IF (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-tags]} {[LIT_CHARS --resources]} {[VarSub 1]} {[LIT_CHARS --tags]} {[LIT_VAR_LIKE "Key="] [VarSub 2] [LIT_COMMA ","] [LIT_VAR_LIKE "Value="] [VarSub 3] =} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS return]} ) ) (= scope= flags=0 words=[] bindings=[('n', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub n]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 3]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Unable to add tag to AWS resource"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (FunctionDef create-iam-profile [] (List (= scope= flags=0 words=[] bindings=[('key', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('role', {[VarSub 2]})]) (= scope= flags=0 words=[] bindings=[('conf_dir', {[LIT_CHARS file] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_ROOT] [LIT_CHARS /cluster/aws/templates/iam]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating IAM role: "][VarSub key]]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS create-role]} {[LIT_CHARS --role-name]} {[VarSub key]} {[LIT_CHARS --assume-role-policy-document]} {[VarSub conf_dir] [LIT_CHARS /] [VarSub role] [LIT_CHARS -role.json]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating IAM role-policy: "][VarSub key]]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS put-role-policy]} {[LIT_CHARS --role-name]} {[VarSub key]} {[LIT_CHARS --policy-name]} {[VarSub key]} {[LIT_CHARS --policy-document]} {[VarSub conf_dir] [LIT_CHARS /] [VarSub role] [LIT_CHARS -policy.json]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating IAM instance-policy: "][VarSub key]]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS create-instance-profile]} {[LIT_CHARS --instance-profile-name]} {[VarSub key]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Adding IAM role to instance-policy: "][VarSub key]]} ) (Com {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS add-role-to-instance-profile]} {[LIT_CHARS --instance-profile-name]} {[VarSub key]} {[LIT_CHARS --role-name]} {[VarSub key]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (FunctionDef ensure-iam-profiles [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating master IAM profile: "][VarSub IAM_PROFILE_MASTER]]} ) (Com {[LIT_CHARS create-iam-profile]} {[VarSub IAM_PROFILE_MASTER]} {[LIT_CHARS kubernetes-master]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating minion IAM profile: "][VarSub IAM_PROFILE_NODE]]} ) (Com {[LIT_CHARS create-iam-profile]} {[VarSub IAM_PROFILE_NODE]} {[LIT_CHARS kubernetes-minion]} ) ) ) (FunctionDef wait-for-instance-state [] (List (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('state', {[VarSub 2]})]) (While (Com {[LIT_CHARS true]} ) (List (= scope= flags=0 words=[] bindings=[('instance_state', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --instance-ids]} {[VarSub instance_id]} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .State.Name]})]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub instance_state]]} {[DQ [VarSub state]]}}) (Com {[LIT_CHARS break]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Waiting for instance "][VarSub instance_id][LIT_CHARS " to be "][VarSub state][LIT_CHARS " (currently "][VarSub instance_state][LIT_CHARS ")"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Sleeping for 3 seconds..."]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 3]} ) ) ) ) ) ) ) (FunctionDef allocate-elastic-ip [] (Com {[VarSub AWS_CMD]} {[LIT_CHARS allocate-address]} {[LIT_CHARS --domain]} {[LIT_CHARS vpc]} {[LIT_CHARS --query]} {[LIT_CHARS PublicIp]} ) ) (FunctionDef attach-ip-to-instance [] (List (= scope= flags=0 words=[] bindings=[('ip_address', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('instance_id', {[VarSub 2]})]) (= scope= flags=0 words=[] bindings=[('elastic_ip_allocation_id', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-addresses]} {[LIT_CHARS --public-ips]} {[VarSub ip_address]} {[LIT_CHARS --query]} {[LIT_CHARS Addresses] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .AllocationId]})]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Attaching IP "][VarSub ip_address][LIT_CHARS " to instance "][VarSub instance_id]]} ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS associate-address]} {[LIT_CHARS --instance-id]} {[VarSub instance_id]} {[LIT_CHARS --allocation-id]} {[VarSub elastic_ip_allocation_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (FunctionDef release-elastic-ip [] (List (= scope= flags=0 words=[] bindings=[('ip_address', {[VarSub 1]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Releasing Elastic IP: "][VarSub ip_address]]} ) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('elastic_ip_allocation_id', {[ComSub (Com redirects=[(FilenameRedirectNode filename={[VarSub LOG]} "> 2)]{[VarSub AWS_CMD]} {[LIT_CHARS describe-addresses]} {[LIT_CHARS --public-ips]} {[VarSub ip_address]} {[LIT_CHARS --query]} {[LIT_CHARS Addresses] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .AllocationId]})]})]) (Com {[LIT_CHARS true]} ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub elastic_ip_allocation_id]]}}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Elastic IP already released"]]} ) (ElseTrue) (Com {[VarSub AWS_CMD]} {[LIT_CHARS release-address]} {[LIT_CHARS --allocation-id]} {[VarSub elastic_ip_allocation_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) ) (FunctionDef delete_security_group [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('sg_id', {[VarSub 1]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting security group: "][VarSub sg_id]]} ) (= scope= flags=0 words=[] bindings=[('n', {[LIT_CHARS 0]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub n]} {[LIT_CHARS -ge]} {[LIT_CHARS 20]} {[LIT_DBRACKET_LIKE "]"]} ) (List (AndOr OP_AND_IF (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-security-group]} {[LIT_CHARS --group-id]} {[VarSub sg_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS return]} ) ) (= scope= flags=0 words=[] bindings=[('n', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub n]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 3]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Unable to delete security group: "][VarSub sg_id]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (FunctionDef delete-iam-profiles [] (For iam_profile_name [{[VarSub IAM_PROFILE_MASTER]}, {[VarSub IAM_PROFILE_NODE]}]) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Removing role from instance profile: "][VarSub iam_profile_name]]} ) (Com {[LIT_CHARS conceal-no-such-entity-response]} {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS remove-role-from-instance-profile]} {[LIT_CHARS --instance-profile-name]} {[DQ [VarSub iam_profile_name]]} {[LIT_CHARS --role-name]} {[DQ [VarSub iam_profile_name]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting IAM Instance-Profile: "][VarSub iam_profile_name]]} ) (Com {[LIT_CHARS conceal-no-such-entity-response]} {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS delete-instance-profile]} {[LIT_CHARS --instance-profile-name]} {[DQ [VarSub iam_profile_name]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Delete IAM role policy: "][VarSub iam_profile_name]]} ) (Com {[LIT_CHARS conceal-no-such-entity-response]} {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS delete-role-policy]} {[LIT_CHARS --role-name]} {[DQ [VarSub iam_profile_name]]} {[LIT_CHARS --policy-name]} {[DQ [VarSub iam_profile_name]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting IAM Role: "][VarSub iam_profile_name]]} ) (Com {[LIT_CHARS conceal-no-such-entity-response]} {[LIT_CHARS aws]} {[LIT_CHARS iam]} {[LIT_CHARS delete-role]} {[LIT_CHARS --role-name]} {[DQ [VarSub iam_profile_name]]} ) ) ) ) (FunctionDef conceal-no-such-entity-response [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('errMsg', {[ComSub (Com redirects=[(DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2) (FilenameRedirectNode filename={[VarSub LOG]} "> 1)]{[VarSub @]})]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub errMsg]]} {[DQ ]}}) (Com {[LIT_CHARS return]} ) ) (Com {[LIT_CHARS echo]} {[VarSub errMsg]} ) (If (DBracket {B2 BINARY_STRING_TILDE_EQUAL {[DQ [VarSub errMsg]]} {[DQ [LIT_CHARS " (NoSuchEntity) "]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " -> no such entity response detected. will assume operation is not necessary due to prior incomplete teardown"]]} ) (Com {[LIT_CHARS return]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Error message is fatal. Will exit"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (FunctionDef ssh-key-setup [] (List (If (DBracket {B! {B1 UNARY_FILE_f {[DQ [VarSub AWS_SSH_KEY]]}}}) (Com {[LIT_CHARS ssh-keygen]} {[LIT_CHARS -f]} {[DQ [VarSub AWS_SSH_KEY]]} {[LIT_CHARS -N]} {[SQ ]} ) ) (= scope= flags=0 words=[] bindings=[('AWS_SSH_KEY_FINGERPRINT', {[ComSub (Com {[LIT_CHARS get-ssh-fingerprint]} {[VarSub AWS_SSH_KEY] [LIT_CHARS .pub]})]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using SSH key with (AWS) fingerprint: "][VarSub AWS_SSH_KEY_FINGERPRINT]]} ) (= scope= flags=0 words=[] bindings=[('AWS_SSH_KEY_NAME', {[DQ [LIT_CHARS kubernetes-][VarSub AWS_SSH_KEY_FINGERPRINT transform_ops=[PatSub {[LIT_CHARS ":"]} {} do_all]]]})]) (Com {[LIT_CHARS import-public-key]} {[VarSub AWS_SSH_KEY_NAME]} {[VarSub AWS_SSH_KEY] [LIT_CHARS .pub]} ) ) ) (FunctionDef vpc-setup [] (List (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub VPC_ID test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('VPC_ID', {[ComSub (Com {[LIT_CHARS get_vpc_id]})]})]) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub VPC_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating vpc."]]} ) (= scope= flags=0 words=[] bindings=[('VPC_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-vpc]} {[LIT_CHARS --cidr-block]} {[VarSub VPC_CIDR]} {[LIT_CHARS --query]} {[LIT_CHARS Vpc.VpcId]})]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS modify-vpc-attribute]} {[LIT_CHARS --vpc-id]} {[VarSub VPC_ID]} {[LIT_CHARS --enable-dns-support]} {[SQ ]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS modify-vpc-attribute]} {[LIT_CHARS --vpc-id]} {[VarSub VPC_ID]} {[LIT_CHARS --enable-dns-hostnames]} {[SQ ]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS add-tag]} {[VarSub VPC_ID]} {[LIT_CHARS Name]} {[VarSub VPC_NAME]} ) (Com {[LIT_CHARS add-tag]} {[VarSub VPC_ID]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using VPC "][VarSub VPC_ID]]} ) ) ) (FunctionDef subnet-setup [] (List (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub SUBNET_ID test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('SUBNET_ID', {[ComSub (Com {[LIT_CHARS get_subnet_id]} {[VarSub VPC_ID]} {[VarSub ZONE]})]})]) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub SUBNET_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating subnet."]]} ) (= scope= flags=0 words=[] bindings=[('SUBNET_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-subnet]} {[LIT_CHARS --cidr-block]} {[VarSub SUBNET_CIDR]} {[LIT_CHARS --vpc-id]} {[VarSub VPC_ID]} {[LIT_CHARS --availability-zone]} {[VarSub ZONE]} {[LIT_CHARS --query]} {[LIT_CHARS Subnet.SubnetId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub SUBNET_ID]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) (ElseTrue) (List (= scope= flags=0 words=[] bindings=[('EXISTING_CIDR', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-subnets]} {[LIT_CHARS --subnet-ids]} {[VarSub SUBNET_ID]} {[LIT_CHARS --query]} {[LIT_CHARS Subnets] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .CidrBlock]})]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using existing subnet with CIDR "][VarSub EXISTING_CIDR]]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[VarSub SUBNET_CIDR]} {[LIT_DBRACKET_LIKE "="]} {[VarSub EXISTING_CIDR]} {[LIT_DBRACKET_LIKE "]"]} ) (List (= scope= flags=0 words=[] bindings=[('MASTER_INTERNAL_IP', {[DQ [VarSub EXISTING_CIDR transform_ops=[VS_UNARY_PERCENT {[LIT_CHARS ".*"]}]][VarSub MASTER_IP_SUFFIX]]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Assuming MASTER_INTERNAL_IP="][VarSub MASTER_INTERNAL_IP]]} ) ) ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using subnet "][VarSub SUBNET_ID]]} ) ) ) (FunctionDef kube-up [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Starting cluster using os distro: "][VarSub OS_DISTRIBUTION]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS get-tokens]} ) (Com {[LIT_CHARS detect-image]} ) (Com {[LIT_CHARS detect-minion-image]} ) (Com {[LIT_CHARS detect-root-device]} ) (Com {[LIT_CHARS find-release-tars]} ) (Com {[LIT_CHARS ensure-temp-dir]} ) (Com {[LIT_CHARS create-bootstrap-script]} ) (Com {[LIT_CHARS upload-server-tars]} ) (Com {[LIT_CHARS ensure-iam-profiles]} ) (Com {[LIT_CHARS load-or-gen-kube-basicauth]} ) (Com {[LIT_CHARS load-or-gen-kube-bearertoken]} ) (Com {[LIT_CHARS ssh-key-setup]} ) (Com {[LIT_CHARS vpc-setup]} ) (Com {[LIT_CHARS create-dhcp-option-set]} ) (Com {[LIT_CHARS subnet-setup]} ) (= scope= flags=0 words=[] bindings=[('IGW_ID', {[ComSub (Com {[LIT_CHARS get_igw_id]} {[VarSub VPC_ID]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub IGW_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating Internet Gateway."]]} ) (= scope= flags=0 words=[] bindings=[('IGW_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-internet-gateway]} {[LIT_CHARS --query]} {[LIT_CHARS InternetGateway.InternetGatewayId]})]})]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS attach-internet-gateway]} {[LIT_CHARS --internet-gateway-id]} {[VarSub IGW_ID]} {[LIT_CHARS --vpc-id]} {[VarSub VPC_ID]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using Internet Gateway "][VarSub IGW_ID]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Associating route table."]]} ) (= scope= flags=0 words=[] bindings=[('ROUTE_TABLE_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-route-tables]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub VPC_ID] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS RouteTables] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .RouteTableId]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub ROUTE_TABLE_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating route table"]]} ) (= scope= flags=0 words=[] bindings=[('ROUTE_TABLE_ID', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-route-table]} {[LIT_CHARS --vpc-id] [LIT_DBRACKET_LIKE "="] [VarSub VPC_ID]} {[LIT_CHARS --query]} {[LIT_CHARS RouteTable.RouteTableId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub ROUTE_TABLE_ID]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Associating route table "][VarSub ROUTE_TABLE_ID][LIT_CHARS " to subnet "][VarSub SUBNET_ID]]} ) (AndOr OP_OR_IF (Com {[VarSub AWS_CMD]} {[LIT_CHARS associate-route-table]} {[LIT_CHARS --route-table-id]} {[VarSub ROUTE_TABLE_ID]} {[LIT_CHARS --subnet-id]} {[VarSub SUBNET_ID]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS true]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Adding route to route table "][VarSub ROUTE_TABLE_ID]]} ) (AndOr OP_OR_IF (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-route]} {[LIT_CHARS --route-table-id]} {[VarSub ROUTE_TABLE_ID]} {[LIT_CHARS --destination-cidr-block]} {[LIT_CHARS 0.0.0.0/0]} {[LIT_CHARS --gateway-id]} {[VarSub IGW_ID]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS true]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using Route Table "][VarSub ROUTE_TABLE_ID]]} ) (= scope= flags=0 words=[] bindings=[('MASTER_SG_ID', {[ComSub (Com {[LIT_CHARS get_security_group_id]} {[DQ [VarSub MASTER_SG_NAME]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub MASTER_SG_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating master security group."]]} ) (Com {[LIT_CHARS create-security-group]} {[DQ [VarSub MASTER_SG_NAME]]} {[DQ [LIT_CHARS "Kubernetes security group applied to master nodes"]]} ) ) ) (= scope= flags=0 words=[] bindings=[('NODE_SG_ID', {[ComSub (Com {[LIT_CHARS get_security_group_id]} {[DQ [VarSub NODE_SG_NAME]]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub NODE_SG_ID]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating minion security group."]]} ) (Com {[LIT_CHARS create-security-group]} {[DQ [VarSub NODE_SG_NAME]]} {[DQ [LIT_CHARS "Kubernetes security group applied to minion nodes"]]} ) ) ) (Com {[LIT_CHARS detect-security-groups]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub MASTER_SG_ID]]} {[DQ [LIT_CHARS "--source-group "][VarSub MASTER_SG_ID][LIT_CHARS " --protocol all"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--source-group "][VarSub NODE_SG_ID][LIT_CHARS " --protocol all"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub MASTER_SG_ID]]} {[DQ [LIT_CHARS "--source-group "][VarSub NODE_SG_ID][LIT_CHARS " --protocol all"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--source-group "][VarSub MASTER_SG_ID][LIT_CHARS " --protocol all"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub MASTER_SG_ID]]} {[DQ [LIT_CHARS "--protocol tcp --port 22 --cidr "][VarSub SSH_CIDR]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--protocol tcp --port 22 --cidr "][VarSub SSH_CIDR]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub MASTER_SG_ID]]} {[DQ [LIT_CHARS "--protocol tcp --port 443 --cidr "][VarSub HTTP_API_CIDR]]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub KUBE_USE_EXISTING_MASTER test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS true]]}}) (List (Com {[LIT_CHARS detect-master]} ) (Com {[LIT_CHARS parse-master-env]} ) (Com {[LIT_CHARS start-minions]} ) (Com {[LIT_CHARS wait-minions]} ) ) (ElseTrue) (List (Com {[LIT_CHARS start-master]} ) (Com {[LIT_CHARS build-config]} ) (Com {[LIT_CHARS start-minions]} ) (Com {[LIT_CHARS wait-minions]} ) (Com {[LIT_CHARS wait-master]} ) ) ) (Com {[LIT_CHARS check-cluster]} ) ) ) (FunctionDef create-bootstrap-script [] (List (Com {[LIT_CHARS ensure-temp-dir]} ) (= scope= flags=0 words=[] bindings=[('BOOTSTRAP_SCRIPT', {[DQ [VarSub KUBE_TEMP][LIT_CHARS /bootstrap-script]]})]) (Subshell (List (Com {[LIT_CHARS sed]} {[SQ ]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/gce/configure-vm.sh]]} ) (Com {[LIT_CHARS cat]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/templates/configure-vm-aws.sh]]} ) (Com {[LIT_CHARS cat]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/templates/format-disks.sh]]} ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[SQ ]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/gce/configure-vm.sh]]} ) ) ) ) ) (FunctionDef start-master [] (List (Com {[LIT_CHARS build-runtime-config]} ) (Com {[LIT_CHARS ensure-master-pd]} ) (Com {[LIT_CHARS ensure-master-ip]} ) (Com {[LIT_CHARS create-certs]} {[DQ [VarSub KUBE_MASTER_IP]]} {[DQ [VarSub MASTER_INTERNAL_IP]]} ) (= scope= flags=0 words=[] bindings=[('KUBECFG_CERT_BASE64', {[DQ ]})]) (= scope= flags=0 words=[] bindings=[('KUBECFG_KEY_BASE64', {[DQ ]})]) (Com {[LIT_CHARS write-master-env]} ) (Subshell (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "#! /bin/bash"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mkdir -p /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cd /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cat > kube_env.yaml << __EOF_MASTER_KUBE_ENV_YAML"]]} ) (Com {[LIT_CHARS cat]} {[VarSub KUBE_TEMP] [LIT_CHARS /master-kube-env.yaml]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "AUTO_UPGRADE: 'true'"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "DOCKER_STORAGE: "][ComSub (Com {[LIT_CHARS yaml-quote]} {[VarSub DOCKER_STORAGE test_op=VS_TEST_COLON_HYPHEN {}]})]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "API_SERVERS: "][ComSub (Com {[LIT_CHARS yaml-quote]} {[VarSub MASTER_INTERNAL_IP test_op=VS_TEST_COLON_HYPHEN {}]})]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS __EOF_MASTER_KUBE_ENV_YAML]]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "wget -O bootstrap "][VarSub BOOTSTRAP_SCRIPT_URL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "chmod +x bootstrap"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mkdir -p /etc/kubernetes"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mv kube_env.yaml /etc/kubernetes"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mv bootstrap /etc/kubernetes/"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cat > /etc/rc.local << EOF_RC_LOCAL"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "#!/bin/sh -e"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS /etc/kubernetes/bootstrap]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "exit 0"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS EOF_RC_LOCAL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS /etc/kubernetes/bootstrap]]} ) ) ) (Com {[LIT_CHARS gzip]} {[DQ [VarSub KUBE_TEMP][LIT_CHARS /master-user-data]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Starting Master"]]} ) (= scope= flags=0 words=[] bindings=[('master_id', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS run-instances]} {[LIT_CHARS --image-id]} {[VarSub AWS_IMAGE]} {[LIT_CHARS --iam-instance-profile]} {[LIT_VAR_LIKE "Name="] [VarSub IAM_PROFILE_MASTER] =} {[LIT_CHARS --instance-type]} {[VarSub MASTER_SIZE]} {[LIT_CHARS --subnet-id]} {[VarSub SUBNET_ID]} {[LIT_CHARS --private-ip-address]} {[VarSub MASTER_INTERNAL_IP]} {[LIT_CHARS --key-name]} {[VarSub AWS_SSH_KEY_NAME]} {[LIT_CHARS --security-group-ids]} {[VarSub MASTER_SG_ID]} {[LIT_CHARS --associate-public-ip-address]} {[LIT_CHARS --block-device-mappings]} {[DQ [VarSub MASTER_BLOCK_DEVICE_MAPPINGS]]} {[LIT_CHARS --user-data]} {[LIT_CHARS fileb] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_TEMP] [LIT_CHARS /master-user-data.gz]} {[LIT_CHARS --query]} {[LIT_CHARS Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .InstanceId]})]})]) (Com {[LIT_CHARS add-tag]} {[VarSub master_id]} {[LIT_CHARS Name]} {[VarSub MASTER_NAME]} ) (Com {[LIT_CHARS add-tag]} {[VarSub master_id]} {[LIT_CHARS Role]} {[VarSub MASTER_TAG]} ) (Com {[LIT_CHARS add-tag]} {[VarSub master_id]} {[LIT_CHARS KubernetesCluster]} {[VarSub CLUSTER_ID]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Waiting for master to be ready"]]} ) (= scope= flags=0 words=[] bindings=[('attempt', {[LIT_CHARS 0]})]) (While (Com {[LIT_CHARS true]} ) (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -n]} {[LIT_CHARS Attempt]} {[DQ [ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]]} {[LIT_CHARS to]} {[LIT_CHARS check]} {[LIT_CHARS for]} {[LIT_CHARS master]} {[LIT_CHARS node]} ) (= scope= flags=0 words=[] bindings=[('ip', {[ComSub (Com {[LIT_CHARS get_instance_public_ip]} {[VarSub master_id]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub ip]]}}) (If (DParen {A2 AS_OP_GREAT {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 30]}}}) (List (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_red][LIT_CHARS "master failed to start. Your cluster is unlikely"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "to work correctly. Please run ./cluster/kube-down.sh and re-create the"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS "cluster. (sorry!)"][VarSub color_norm]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (ElseTrue) (List (Com {[LIT_CHARS wait-for-instance-state]} {[VarSub master_id]} {[DQ [LIT_CHARS running]]} ) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER', {[VarSub MASTER_NAME]})]) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS " "][VarSub color_green][LIT_CHARS "[master running]"][VarSub color_norm]]} ) (Com {[LIT_CHARS attach-ip-to-instance]} {[VarSub KUBE_MASTER_IP]} {[VarSub master_id]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Attaching persistent data volume ("][VarSub MASTER_DISK_ID][LIT_CHARS ") to master"]]} ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS attach-volume]} {[LIT_CHARS --volume-id]} {[VarSub MASTER_DISK_ID]} {[LIT_CHARS --device]} {[LIT_CHARS /dev/sdb]} {[LIT_CHARS --instance-id]} {[VarSub master_id]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 10]} ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS create-route]} {[LIT_CHARS --route-table-id]} {[VarSub ROUTE_TABLE_ID]} {[LIT_CHARS --destination-cidr-block]} {[VarSub MASTER_IP_RANGE]} {[LIT_CHARS --instance-id]} {[VarSub master_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS break]} ) ) ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS " "][VarSub color_yellow][LIT_CHARS "[master not working yet]"][VarSub color_norm]]} ) (= scope= flags=0 words=[] bindings=[('attempt', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 10]} ) ) ) ) ) (FunctionDef start-minions [] (List (Com {[LIT_CHARS build-runtime-config]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating minion configuration"]]} ) (Com {[LIT_CHARS write-node-env]} ) (Subshell (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "#! /bin/bash"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mkdir -p /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cd /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cat > kube_env.yaml << __EOF_KUBE_ENV_YAML"]]} ) (Com {[LIT_CHARS cat]} {[VarSub KUBE_TEMP] [LIT_CHARS /node-kube-env.yaml]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "AUTO_UPGRADE: 'true'"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "DOCKER_STORAGE: "][ComSub (Com {[LIT_CHARS yaml-quote]} {[VarSub DOCKER_STORAGE test_op=VS_TEST_COLON_HYPHEN {}]})]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "API_SERVERS: "][ComSub (Com {[LIT_CHARS yaml-quote]} {[VarSub MASTER_INTERNAL_IP test_op=VS_TEST_COLON_HYPHEN {}]})]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS __EOF_KUBE_ENV_YAML]]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "wget -O bootstrap "][VarSub BOOTSTRAP_SCRIPT_URL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "chmod +x bootstrap"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mkdir -p /etc/kubernetes"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mv kube_env.yaml /etc/kubernetes"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mv bootstrap /etc/kubernetes/"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cat > /etc/rc.local << EOF_RC_LOCAL"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "#!/bin/sh -e"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS /etc/kubernetes/bootstrap]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "exit 0"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS EOF_RC_LOCAL]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS /etc/kubernetes/bootstrap]]} ) ) ) (Com {[LIT_CHARS gzip]} {[DQ [VarSub KUBE_TEMP][LIT_CHARS /node-user-data]]} ) (= scope= flags=0 words=[{[LIT_CHARS public_ip_option]}] bindings=[]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub ENABLE_NODE_PUBLIC_IP]]} {[DQ [LIT_CHARS true]]}}) (= scope= flags=0 words=[] bindings=[('public_ip_option', {[DQ [LIT_CHARS --associate-public-ip-address]]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('public_ip_option', {[DQ [LIT_CHARS --no-associate-public-ip-address]]})]) ) (= scope= flags=0 words=[{[LIT_CHARS spot_price_option]}] bindings=[]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub NODE_SPOT_PRICE test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('spot_price_option', {[DQ [LIT_CHARS "--spot-price "][VarSub NODE_SPOT_PRICE]]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('spot_price_option', {[DQ ]})]) ) (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS create-launch-configuration]} {[LIT_CHARS --launch-configuration-name]} {[VarSub ASG_NAME]} {[LIT_CHARS --image-id]} {[VarSub KUBE_NODE_IMAGE]} {[LIT_CHARS --iam-instance-profile]} {[VarSub IAM_PROFILE_NODE]} {[LIT_CHARS --instance-type]} {[VarSub NODE_SIZE]} {[LIT_CHARS --key-name]} {[VarSub AWS_SSH_KEY_NAME]} {[LIT_CHARS --security-groups]} {[VarSub NODE_SG_ID]} {[VarSub public_ip_option]} {[VarSub spot_price_option]} {[LIT_CHARS --block-device-mappings]} {[DQ [VarSub NODE_BLOCK_DEVICE_MAPPINGS]]} {[LIT_CHARS --user-data]} {[DQ [LIT_CHARS "fileb://"][VarSub KUBE_TEMP][LIT_CHARS /node-user-data.gz]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Creating autoscaling group"]]} ) (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS create-auto-scaling-group]} {[LIT_CHARS --auto-scaling-group-name]} {[VarSub ASG_NAME]} {[LIT_CHARS --launch-configuration-name]} {[VarSub ASG_NAME]} {[LIT_CHARS --min-size]} {[VarSub NUM_NODES]} {[LIT_CHARS --max-size]} {[VarSub NUM_NODES]} {[LIT_CHARS --vpc-zone-identifier]} {[VarSub SUBNET_ID]} {[LIT_CHARS --tags]} {[LIT_VAR_LIKE "ResourceId="] [VarSub ASG_NAME] [LIT_COMMA ","] [LIT_VAR_LIKE "ResourceType="] [LIT_CHARS auto-scaling-group] [LIT_COMMA ","] [LIT_VAR_LIKE "Key="] [LIT_CHARS Name] [LIT_COMMA ","] [LIT_VAR_LIKE "Value="] [VarSub NODE_INSTANCE_PREFIX] =} {[LIT_VAR_LIKE "ResourceId="] [VarSub ASG_NAME] [LIT_COMMA ","] [LIT_VAR_LIKE "ResourceType="] [LIT_CHARS auto-scaling-group] [LIT_COMMA ","] [LIT_VAR_LIKE "Key="] [LIT_CHARS Role] [LIT_COMMA ","] [LIT_VAR_LIKE "Value="] [VarSub NODE_TAG] =} {[LIT_VAR_LIKE "ResourceId="] [VarSub ASG_NAME] [LIT_COMMA ","] [LIT_VAR_LIKE "ResourceType="] [LIT_CHARS auto-scaling-group] [LIT_COMMA ","] [LIT_VAR_LIKE "Key="] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Value="] [VarSub CLUSTER_ID] =} ) ) ) (FunctionDef wait-minions [] (List (= scope= flags=0 words=[] bindings=[('attempt', {[LIT_CHARS 0]})]) (= scope= flags=0 words=[] bindings=[('max_attempts', {[LIT_CHARS 30]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub NODE_SPOT_PRICE test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('max_attempts', {[LIT_CHARS 90]})]) ) (While (Com {[LIT_CHARS true]} ) (List (Com {[LIT_CHARS detect-node-names]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub NODE_IDS bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]} {[VarSub NUM_NODES]}}) (List (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS " "][VarSub color_green][VarSub NODE_IDS bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]][LIT_CHARS " minions started; ready"][VarSub color_norm]]} ) (Com {[LIT_CHARS break]} ) ) ) (If (DParen {A2 AS_OP_GREAT {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[VarSub max_attempts]}}}) (List (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Expected number of minions did not start in time"]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_red][LIT_CHARS "Expected number of minions failed to start. Your cluster is unlikely"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "to work correctly. Please run ./cluster/kube-down.sh and re-create the"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS "cluster. (sorry!)"][VarSub color_norm]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS " "][VarSub color_yellow][VarSub NODE_IDS bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]][LIT_CHARS " minions started; waiting"][VarSub color_norm]]} ) (= scope= flags=0 words=[] bindings=[('attempt', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 10]} ) ) ) ) ) (FunctionDef wait-master [] (List (Com {[LIT_CHARS detect-master]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Waiting for cluster initialization."]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " This will continually check to see if the API for kubernetes is reachable."]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " This might loop forever if there was some uncaught error during start"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " up."]]} ) (Com {[LIT_CHARS echo]} ) (While (Com {[ComSub (Com {[LIT_CHARS curl]} {[LIT_CHARS --insecure]} {[LIT_CHARS --user]} {[VarSub KUBE_USER] [LIT_OTHER ":"] [VarSub KUBE_PASSWORD]} {[LIT_CHARS --max-time]} {[LIT_CHARS 5]} {[LIT_CHARS --fail]} {[LIT_CHARS --output]} {[VarSub LOG]} {[LIT_CHARS --silent]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //] [VarSub KUBE_MASTER_IP] [LIT_CHARS /healthz]})]} ) (List (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS .]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 2]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Kubernetes cluster created."]]} ) ) ) (FunctionDef build-config [] (List (= scope= flags=1 words=[] bindings=[('KUBE_CERT', {[DQ [VarSub CERT_DIR][LIT_CHARS /pki/issued/kubecfg.crt]]})]) (= scope= flags=1 words=[] bindings=[('KUBE_KEY', {[DQ [VarSub CERT_DIR][LIT_CHARS /pki/private/kubecfg.key]]})]) (= scope= flags=1 words=[] bindings=[('CA_CERT', {[DQ [VarSub CERT_DIR][LIT_CHARS /pki/ca.crt]]})]) (= scope= flags=1 words=[] bindings=[('CONTEXT', {[DQ [VarSub CONFIG_CONTEXT]]})]) (Subshell (List (Com {[LIT_CHARS umask]} {[LIT_CHARS 077]} ) (Com {[LIT_CHARS create-kubeconfig]} ) (Com {[LIT_CHARS create-kubeconfig-for-federation]} ) ) ) ) ) (FunctionDef check-cluster [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Sanity checking cluster..."]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 5]} ) (Com {[LIT_CHARS detect-nodes]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS e]} ) (= scope= flags=0 words=[{[LIT_CHARS rc]}] 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_LESS {A Atom NODE_ARITH_WORD {[VarSub i]}} {A Atom NODE_ARITH_WORD {[VarSub KUBE_NODE_IP_ADDRESSES bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub i]}} } (List (= scope= flags=0 words=[] bindings=[('attempt', {[LIT_CHARS 0]})]) (While (Com {[LIT_CHARS true]} ) (List (= scope= flags=0 words=[] bindings=[('minion_ip', {[VarSub KUBE_NODE_IP_ADDRESSES bracket_op=(Index {A Atom NODE_ARITH_WORD {[VarSub i]}})]})]) (Com {[LIT_CHARS echo]} {[LIT_CHARS -n]} {[DQ [LIT_CHARS "Attempt "][ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}][LIT_CHARS " to check Docker on node @ "][VarSub minion_ip][LIT_CHARS " ..."]]} ) (= scope= flags=0 words=[] bindings=[('output', {[ComSub (Com {[LIT_CHARS check-minion]} {[VarSub minion_ip]})]})]) (Com {[LIT_CHARS echo]} {[VarSub output]} ) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub output]]} {[DQ [LIT_CHARS working]]}}) (If (DParen {A2 AS_OP_GREAT {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 20]}}}) (List (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_red][LIT_CHARS "Your cluster is unlikely to work correctly."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Please run ./cluster/kube-down.sh and re-create the"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS "cluster. (sorry!)"][VarSub color_norm]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (ElseTrue) (Com {[LIT_CHARS break]} ) ) (= scope= flags=0 words=[] bindings=[('attempt', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub attempt]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 30]} ) ) ) ) ) (Com {[LIT_CHARS get-kubeconfig-basicauth]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_green][LIT_CHARS "Kubernetes cluster is running. The master is running at:"]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_yellow][LIT_CHARS " https://"][VarSub KUBE_MASTER_IP]]} ) (Com {[LIT_CHARS echo]} ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_green][LIT_CHARS "The user name and password to use is located in "][VarSub KUBECONFIG][LIT_CHARS .][VarSub color_norm]]} ) (Com {[LIT_CHARS echo]} ) ) ) (FunctionDef kube-down [] (List (= scope= flags=0 words=[] bindings=[('vpc_id', {[ComSub (Com {[LIT_CHARS get_vpc_id]})]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub vpc_id]]}}) (List (= scope= flags=0 words=[] bindings=[('elb_ids', {[ComSub (Com {[LIT_CHARS get_elbs_in_vpc]} {[VarSub vpc_id]})]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub elb_ids]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting ELBs in: "][VarSub vpc_id]]} ) (For elb_id [{[VarSub elb_ids]}]) (Com {[LIT_CHARS aws]} {[LIT_CHARS elb]} {[LIT_CHARS delete-load-balancer]} {[LIT_CHARS --load-balancer-name] [LIT_DBRACKET_LIKE "="] [VarSub elb_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Waiting for ELBs to be deleted"]]} ) (While (Com {[LIT_CHARS true]} ) (List (= scope= flags=0 words=[] bindings=[('elb_ids', {[ComSub (Com {[LIT_CHARS get_elbs_in_vpc]} {[VarSub vpc_id]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub elb_ids]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "All ELBs deleted"]]} ) (Com {[LIT_CHARS break]} ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "ELBs not yet deleted: "][VarSub elb_ids]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Sleeping for 3 seconds..."]]} ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 3]} ) ) ) ) ) ) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub KUBE_MASTER_ID test_op=VS_TEST_HYPHEN {}]]}}) (= scope= flags=0 words=[] bindings=[('KUBE_MASTER_ID', {[ComSub (Com {[LIT_CHARS get_instanceid_from_name]} {[VarSub MASTER_NAME]})]})]) ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub KUBE_MASTER_ID test_op=VS_TEST_HYPHEN {}]]}}) (Com {[LIT_CHARS delete-instance-alarms]} {[VarSub KUBE_MASTER_ID]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting instances in VPC: "][VarSub vpc_id]]} ) (= scope= flags=0 words=[] bindings=[('instance_ids', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS Reservations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .Instances] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .InstanceId]})]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub instance_ids]]}}) (List (= scope= flags=0 words=[] bindings=[('asg_groups', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-instances]} {[LIT_CHARS --query]} {[SQ ]} {[LIT_CHARS --instance-ids]} {[VarSub instance_ids]})]})]) (For asg_group [{[VarSub asg_groups]}]) (List (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS describe-auto-scaling-groups]} {[LIT_CHARS --auto-scaling-group-names]} {[VarSub asg_group]} {[LIT_CHARS --query]} {[LIT_CHARS AutoScalingGroups] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .AutoScalingGroupName]})]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting auto-scaling group: "][VarSub asg_group]]} ) (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS delete-auto-scaling-group]} {[LIT_CHARS --force-delete]} {[LIT_CHARS --auto-scaling-group-name]} {[VarSub asg_group]} ) ) ) (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS describe-launch-configurations]} {[LIT_CHARS --launch-configuration-names]} {[VarSub asg_group]} {[LIT_CHARS --query]} {[LIT_CHARS LaunchConfigurations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .LaunchConfigurationName]})]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting auto-scaling launch configuration: "][VarSub asg_group]]} ) (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS delete-launch-configuration]} {[LIT_CHARS --launch-configuration-name]} {[VarSub asg_group]} ) ) ) ) ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS terminate-instances]} {[LIT_CHARS --instance-ids]} {[VarSub instance_ids]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Waiting for instances to be deleted"]]} ) (For instance_id [{[VarSub instance_ids]}]) (Com {[LIT_CHARS wait-for-instance-state]} {[VarSub instance_id]} {[DQ [LIT_CHARS terminated]]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "All instances deleted"]]} ) ) ) (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS describe-launch-configurations]} {[LIT_CHARS --launch-configuration-names]} {[VarSub ASG_NAME]} {[LIT_CHARS --query]} {[LIT_CHARS LaunchConfigurations] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .LaunchConfigurationName]})]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Warning: default auto-scaling launch configuration "][VarSub ASG_NAME][LIT_CHARS " still exists, attempting to delete"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " (This may happen if kube-up leaves just the launch configuration but no auto-scaling group.)"]]} ) (AndOr OP_OR_IF (Com {[VarSub AWS_ASG_CMD]} {[LIT_CHARS delete-launch-configuration]} {[LIT_CHARS --launch-configuration-name]} {[VarSub ASG_NAME]} ) (Com {[LIT_CHARS true]} ) ) ) ) (Com {[LIT_CHARS find-master-pd]} ) (Com {[LIT_CHARS find-tagged-master-ip]} ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub KUBE_MASTER_IP test_op=VS_TEST_COLON_HYPHEN {}]]}}) (Com {[LIT_CHARS release-elastic-ip]} {[VarSub KUBE_MASTER_IP]} ) ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub MASTER_DISK_ID test_op=VS_TEST_COLON_HYPHEN {}]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting volume "][VarSub MASTER_DISK_ID]]} ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-volume]} {[LIT_CHARS --volume-id]} {[VarSub MASTER_DISK_ID]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cleaning up resources in VPC: "][VarSub vpc_id]]} ) (= scope= flags=0 words=[] bindings=[('default_sg_id', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-security-groups]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS group-name] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [LIT_CHARS default] =} {[LIT_CHARS --query]} {[LIT_CHARS SecurityGroups] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .GroupId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (= scope= flags=0 words=[] bindings=[('sg_ids', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-security-groups]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS SecurityGroups] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .GroupId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (For sg_id [{[VarSub sg_ids]}]) (List (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub sg_id]]} {[DQ [VarSub default_sg_id]]}}) (Com {[LIT_CHARS continue]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cleaning up security group: "][VarSub sg_id]]} ) (= scope= flags=0 words=[] bindings=[('other_sgids', {[ComSub (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-security-groups]} {[LIT_CHARS --group-id]} {[DQ [VarSub sg_id]]} {[LIT_CHARS --query]} {[LIT_CHARS SecurityGroups] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .IpPermissions] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .UserIdGroupPairs] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .GroupId]})]})]) (For other_sgid [{[VarSub other_sgids]}]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS revoke-security-group-ingress]} {[LIT_CHARS --group-id]} {[DQ [VarSub sg_id]]} {[LIT_CHARS --source-group]} {[DQ [VarSub other_sgid]]} {[LIT_CHARS --protocol]} {[LIT_CHARS all]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) ) (For sg_id [{[VarSub sg_ids]}]) (List (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub sg_id]]} {[DQ [VarSub default_sg_id]]}}) (Com {[LIT_CHARS continue]} ) ) (Com {[LIT_CHARS delete_security_group]} {[VarSub sg_id]} ) ) ) (= scope= flags=0 words=[] bindings=[('subnet_ids', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-subnets]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS Subnets] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .SubnetId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (For subnet_id [{[VarSub subnet_ids]}]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-subnet]} {[LIT_CHARS --subnet-id]} {[VarSub subnet_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) (= scope= flags=0 words=[] bindings=[('igw_ids', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-internet-gateways]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS attachment.vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_CHARS --query]} {[LIT_CHARS InternetGateways] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .InternetGatewayId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (For igw_id [{[VarSub igw_ids]}]) (List (Com {[VarSub AWS_CMD]} {[LIT_CHARS detach-internet-gateway]} {[LIT_CHARS --internet-gateway-id]} {[VarSub igw_id]} {[LIT_CHARS --vpc-id]} {[VarSub vpc_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-internet-gateway]} {[LIT_CHARS --internet-gateway-id]} {[VarSub igw_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) ) (= scope= flags=0 words=[] bindings=[('route_table_ids', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-route-tables]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS route.destination-cidr-block] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [LIT_CHARS 0.0.0.0/0] =} {[LIT_CHARS --query]} {[LIT_CHARS RouteTables] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .RouteTableId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (For route_table_id [{[VarSub route_table_ids]}]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-route]} {[LIT_CHARS --route-table-id]} {[VarSub route_table_id]} {[LIT_CHARS --destination-cidr-block]} {[LIT_CHARS 0.0.0.0/0]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) (= scope= flags=0 words=[] bindings=[('route_table_ids', {[ComSub (Pipeline (Com {[VarSub AWS_CMD]} {[LIT_CHARS describe-route-tables]} {[LIT_CHARS --filters]} {[LIT_VAR_LIKE "Name="] [LIT_CHARS vpc-id] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub vpc_id] =} {[LIT_VAR_LIKE "Name="] [LIT_CHARS tag] [LIT_OTHER ":"] [LIT_CHARS KubernetesCluster] [LIT_COMMA ","] [LIT_VAR_LIKE "Values="] [VarSub CLUSTER_ID] =} {[LIT_CHARS --query]} {[LIT_CHARS RouteTables] [LIT_DBRACKET_LIKE "[]"] [LIT_CHARS .RouteTableId]}) (Com {[LIT_CHARS tr]} {[DQ [\ LIT_ESCAPED_CHAR "\\t"]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]}) )]})]) (For route_table_id [{[VarSub route_table_ids]}]) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-route-table]} {[LIT_CHARS --route-table-id]} {[VarSub route_table_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting VPC: "][VarSub vpc_id]]} ) (Com {[VarSub AWS_CMD]} {[LIT_CHARS delete-vpc]} {[LIT_CHARS --vpc-id]} {[VarSub vpc_id]} < (FilenameRedirectNode filename={[VarSub LOG]} "> 1), > ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[LIT_CHARS -e]} {[DQ [VarSub color_red][LIT_CHARS "Cluster NOT deleted!"][VarSub color_norm]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "No VPC was found with tag KubernetesCluster="][VarSub CLUSTER_ID]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "If you are trying to delete a cluster in a shared VPC,"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "please consider using one of the methods in the kube-deploy repo."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "See: https://github.com/kubernetes/kube-deploy/blob/master/docs/delete_cluster.md"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ ]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Note: You may be seeing this message may be because the cluster was already deleted, or"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "has a name other than '"][VarSub CLUSTER_ID][LIT_CHARS "'."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Deleting IAM Instance profiles"]]} ) (Com {[LIT_CHARS delete-iam-profiles]} ) ) ) (FunctionDef kube-push [] (List (Com {[LIT_CHARS detect-master]} ) (Com {[LIT_CHARS find-release-tars]} ) (Com {[LIT_CHARS create-bootstrap-script]} ) (Com {[LIT_CHARS upload-server-tars]} ) (Pipeline (Subshell (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "#! /bin/bash"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "mkdir -p /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "cd /var/cache/kubernetes-install"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "readonly SERVER_BINARY_TAR_URL='"][VarSub SERVER_BINARY_TAR_URL][LIT_CHARS "'"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "readonly SALT_TAR_URL='"][VarSub SALT_TAR_URL][LIT_CHARS "'"]]} ) (Com {[LIT_CHARS grep]} {[LIT_CHARS -v]} {[DQ [LIT_CHARS "^#"]]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/templates/common.sh]]} ) (Com {[LIT_CHARS grep]} {[LIT_CHARS -v]} {[DQ [LIT_CHARS "^#"]]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/aws/templates/download-release.sh]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "echo Executing configuration"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "sudo salt '*' mine.update"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "sudo salt --force-color '*' state.highstate"]]} ) ) ) (Com {[LIT_CHARS ssh]} {[LIT_CHARS -oStrictHostKeyChecking] [LIT_DBRACKET_LIKE "="] [LIT_CHARS no]} {[LIT_CHARS -i]} {[DQ [VarSub AWS_SSH_KEY]]} {[VarSub SSH_USER] [LIT_OTHER "@"] [VarSub KUBE_MASTER_IP]} {[LIT_CHARS sudo]} {[LIT_CHARS bash]} ) ) (Com {[LIT_CHARS get-kubeconfig-basicauth]} ) (Com {[LIT_CHARS echo]} ) (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 " https://"][VarSub KUBE_MASTER_IP]]} ) (Com {[LIT_CHARS echo]} ) ) ) (FunctionDef test-build-release [] (Com {[DQ [VarSub KUBE_ROOT][LIT_CHARS /build-tools/release.sh]]} ) ) (FunctionDef test-setup [] (List (Com {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/kube-up.sh]]} ) (= scope= flags=0 words=[] bindings=[('VPC_ID', {[ComSub (Com {[LIT_CHARS get_vpc_id]})]})]) (Com {[LIT_CHARS detect-security-groups]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--protocol tcp --port 80 --cidr 0.0.0.0/0"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--protocol tcp --port 8080 --cidr 0.0.0.0/0"]]} ) (Com {[LIT_CHARS authorize-security-group-ingress]} {[DQ [VarSub NODE_SG_ID]]} {[DQ [LIT_CHARS "--protocol all --port 30000-32767 --cidr 0.0.0.0/0"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "test-setup complete"]]} ) ) ) (FunctionDef test-teardown [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Shutting down test cluster."]]} ) (Com {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/kube-down.sh]]} ) ) ) (FunctionDef get_ssh_hostname [] (List (= scope= flags=0 words=[] bindings=[('node', {[DQ [VarSub 1]]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub node]]} {[DQ [VarSub MASTER_NAME]]}}) (List (= scope= flags=0 words=[] bindings=[('node', {[ComSub (Com {[LIT_CHARS get_instanceid_from_name]} {[VarSub MASTER_NAME]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub node test_op=VS_TEST_HYPHEN {}]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (= scope= flags=0 words=[] bindings=[('ip', {[ComSub (Com {[LIT_CHARS get_instance_public_ip]} {[VarSub node]})]})]) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub ip]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Could not detect IP for "][VarSub node][LIT_CHARS .]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo]} {[VarSub ip]} ) ) ) (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=[] bindings=[('ip', {[ComSub (Com {[LIT_CHARS get_ssh_hostname]} {[VarSub node]})]})]) (For try [{[LIT_LBRACE "{"] [LIT_CHARS 1..5] [LIT_RBRACE "}"]}]) (List (If (Com {[LIT_CHARS ssh]} {[LIT_CHARS -oLogLevel] [LIT_DBRACKET_LIKE "="] [LIT_CHARS quiet]} {[LIT_CHARS -oConnectTimeout] [LIT_DBRACKET_LIKE "="] [LIT_CHARS 30]} {[LIT_CHARS -oStrictHostKeyChecking] [LIT_DBRACKET_LIKE "="] [LIT_CHARS no]} {[LIT_CHARS -i]} {[DQ [VarSub AWS_SSH_KEY]]} {[VarSub SSH_USER] [LIT_OTHER "@"] [VarSub ip]} {[DQ [LIT_CHARS "echo test > /dev/null"]]} ) (Com {[LIT_CHARS break]} ) ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 5]} ) ) ) (Com {[LIT_CHARS ssh]} {[LIT_CHARS -oLogLevel] [LIT_DBRACKET_LIKE "="] [LIT_CHARS quiet]} {[LIT_CHARS -oConnectTimeout] [LIT_DBRACKET_LIKE "="] [LIT_CHARS 30]} {[LIT_CHARS -oStrictHostKeyChecking] [LIT_DBRACKET_LIKE "="] [LIT_CHARS no]} {[LIT_CHARS -i]} {[DQ [VarSub AWS_SSH_KEY]]} {[VarSub SSH_USER] [LIT_OTHER "@"] [VarSub ip]} {[DQ [VarSub cmd]]} ) ) ) (FunctionDef prepare-e2e [] (Com {[LIT_CHARS return]} ) ) (FunctionDef get-tokens [] (List (= scope= flags=0 words=[] bindings=[('KUBELET_TOKEN', {[ComSub (Pipeline (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS dd]} {[LIT_VAR_LIKE "if="] [LIT_CHARS /dev/urandom] =} {[LIT_VAR_LIKE "bs="] [LIT_CHARS 128] =} {[LIT_VAR_LIKE "count="] [LIT_CHARS 1] =}) (Com {[LIT_CHARS base64]}) (Com {[LIT_CHARS tr]} {[LIT_CHARS -d]} {[DQ [LIT_CHARS "=+/"]]}) (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS dd]} {[LIT_VAR_LIKE "bs="] [LIT_CHARS 32] =} {[LIT_VAR_LIKE "count="] [LIT_CHARS 1] =}) )]})]) (= scope= flags=0 words=[] bindings=[('KUBE_PROXY_TOKEN', {[ComSub (Pipeline (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS dd]} {[LIT_VAR_LIKE "if="] [LIT_CHARS /dev/urandom] =} {[LIT_VAR_LIKE "bs="] [LIT_CHARS 128] =} {[LIT_VAR_LIKE "count="] [LIT_CHARS 1] =}) (Com {[LIT_CHARS base64]}) (Com {[LIT_CHARS tr]} {[LIT_CHARS -d]} {[DQ [LIT_CHARS "=+/"]]}) (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS dd]} {[LIT_VAR_LIKE "bs="] [LIT_CHARS 32] =} {[LIT_VAR_LIKE "count="] [LIT_CHARS 1] =}) )]})]) ) ) )