kubernetes-the-hard-way-aws icon indicating copy to clipboard operation
kubernetes-the-hard-way-aws copied to clipboard

An error occurred (MissingParameter) when calling the CreateRoute operation

Open dominopetter opened this issue 6 years ago • 3 comments

Running part 11 (https://github.com/prabhatsharma/kubernetes-the-hard-way-aws/blob/master/docs/11-pod-network-routes.md) and running into this message. Probably missing something really dumb that I did myself.

root@ip-172-31-38-108:/home/ubuntu# for instance in worker-0 worker-1 worker-2; do
   instance_id_ip="$(aws ec2 describe-instances \
     --filters "Name=tag:Name,Values=${instance}" \
     --output text --query 'Reservations[].Instances[].[InstanceId,PrivateIpAddress]')"
   instance_id="$(echo "${instance_id_ip}" | cut -f1)"
   instance_ip="$(echo "${instance_id_ip}" | cut -f2)"
   pod_cidr="$(aws ec2 describe-instance-attribute \
     --instance-id "${instance_id}" \
     --attribute userData \
     --output text --query 'UserData.Value' \
     | base64 --decode | tr "|" "\n" | grep "^pod-cidr" | cut -d'=' -f2)"
   echo "${instance_ip} ${pod_cidr}"

   aws ec2 create-route \
     --route-table-id "${ROUTE_TABLE_ID}" \
     --destination-cidr-block "${pod_cidr}" \
     --instance-id "${instance_id}"
 done
10.240.0.20 10.200.0.0/24

An error occurred (MissingParameter) when calling the CreateRoute operation: The request must contain the parameter routeTableId
10.240.0.21 10.200.1.0/24

An error occurred (MissingParameter) when calling the CreateRoute operation: The request must contain the parameter routeTableId
10.240.0.22 10.200.2.0/24

An error occurred (MissingParameter) when calling the CreateRoute operation: The request must contain the parameter routeTableId
root@ip-172-31-38-108:/home/ubuntu#```

dominopetter avatar May 23 '19 12:05 dominopetter

Hi, Probably you have closed/change your terminal/console. You will need to set up again variables which point to your routing table:

VPC_ID=$(aws ec2 describe-vpcs --filters Name=tag:Name,Values=kubernetes-the-hard-way --output text --query 'Vpcs[0].VpcId') ROUTE_TABLE_ID=$(aws ec2 create-route-table --vpc-id ${VPC_ID} --output text --query 'RouteTable.RouteTableId')

tstachlewski avatar Mar 29 '20 09:03 tstachlewski

I just hit the same issue as ROUTE_TABLE_ID does not appear to be defined. At least in the script in that section on setting up the routing.

I'll check your suggestion tstachlewski - thanks

youngy99 avatar Dec 10 '20 02:12 youngy99

You can query for the route table id again with this command: aws ec2 describe-route-tables --filters 'Name=tag:Name,Values=kubernetes' --query 'RouteTables[].Associations[].RouteTableId'

olaekdahl avatar Jul 07 '22 19:07 olaekdahl