From 93623d47f24fef0d149fa006678b61e3182ef771 Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 20 Apr 2021 09:45:49 -0400 Subject: [PATCH] docs: update AWS instructions This PR adds some docs changes where we had incorrect commands in the AWS docs. Signed-off-by: Spencer Smith --- .../content/docs/v0.10/Cloud Platforms/aws.md | 14 ++++++++----- .../content/docs/v0.8/Cloud Platforms/aws.md | 20 ++++++++++++++----- .../content/docs/v0.9/Cloud Platforms/aws.md | 20 ++++++++++++++----- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/website/content/docs/v0.10/Cloud Platforms/aws.md b/website/content/docs/v0.10/Cloud Platforms/aws.md index e7c807b4f6..5ce60f4a70 100644 --- a/website/content/docs/v0.10/Cloud Platforms/aws.md +++ b/website/content/docs/v0.10/Cloud Platforms/aws.md @@ -99,7 +99,6 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol all \ --port 0 \ - --group-id $SECURITY_GROUP \ --source-group $SECURITY_GROUP ``` @@ -111,15 +110,14 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 6443 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 + aws ec2 authorize-security-group-ingress \ --region $REGION \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 50000-50001 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 ``` ### Create a Load Balancer @@ -148,7 +146,10 @@ created join.yaml created talosconfig ``` +Take note that the generated configs are too long for AWS userdata field if the `--with-examples` and `--with-docs` flags are not passed. + At this point, you can modify the generated configs to your liking. + Optionally, you can specify `--config-patch` with RFC6902 jsonpatch which will be applied during the config generation. #### Validate the Configuration Files @@ -178,6 +179,7 @@ aws ec2 run-instances \ --user-data file://init.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-0}]" ``` @@ -194,6 +196,7 @@ while [[ "$CP_COUNT" -lt 3 ]]; do --user-data file://controlplane.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-$CP_COUNT}]" ((CP_COUNT++)) done @@ -223,6 +226,7 @@ aws elbv2 create-target-group \ --name talos-aws-tutorial-tg \ --protocol TCP \ --port 6443 \ + --target-type ip \ --vpc-id $VPC ``` diff --git a/website/content/docs/v0.8/Cloud Platforms/aws.md b/website/content/docs/v0.8/Cloud Platforms/aws.md index dcaf8ae7a0..e4c46574b6 100644 --- a/website/content/docs/v0.8/Cloud Platforms/aws.md +++ b/website/content/docs/v0.8/Cloud Platforms/aws.md @@ -99,7 +99,6 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol all \ --port 0 \ - --group-id $SECURITY_GROUP \ --source-group $SECURITY_GROUP ``` @@ -111,15 +110,14 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 6443 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 + aws ec2 authorize-security-group-ingress \ --region $REGION \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 50000-50001 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 ``` ### Create a Load Balancer @@ -148,6 +146,15 @@ created join.yaml created talosconfig ``` +Take note that in this version of Talos, the generated configs are too long for AWS userdata field. +Comments can be removed to workaround this with a sed command like: + +```bash +cat init.yaml | sed 's/ #.//' > temp.yaml; mv temp.yaml init.yaml + +cat controlplane.yaml | sed 's/ #.//' > temp.yaml; mv temp.yaml controlplane.yaml +``` + At this point, you can modify the generated configs to your liking. #### Validate the Configuration Files @@ -177,6 +184,7 @@ aws ec2 run-instances \ --user-data file://init.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-0}]" ``` @@ -193,6 +201,7 @@ while [[ "$CP_COUNT" -lt 3 ]]; do --user-data file://controlplane.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-$CP_COUNT}]" ((CP_COUNT++)) done @@ -222,6 +231,7 @@ aws elbv2 create-target-group \ --name talos-aws-tutorial-tg \ --protocol TCP \ --port 6443 \ + --target-type ip \ --vpc-id $VPC ``` diff --git a/website/content/docs/v0.9/Cloud Platforms/aws.md b/website/content/docs/v0.9/Cloud Platforms/aws.md index dcaf8ae7a0..e4c46574b6 100644 --- a/website/content/docs/v0.9/Cloud Platforms/aws.md +++ b/website/content/docs/v0.9/Cloud Platforms/aws.md @@ -99,7 +99,6 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol all \ --port 0 \ - --group-id $SECURITY_GROUP \ --source-group $SECURITY_GROUP ``` @@ -111,15 +110,14 @@ aws ec2 authorize-security-group-ingress \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 6443 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 + aws ec2 authorize-security-group-ingress \ --region $REGION \ --group-name talos-aws-tutorial-sg \ --protocol tcp \ --port 50000-50001 \ - --cidr 0.0.0.0/0 \ - --group-id $SECURITY_GROUP + --cidr 0.0.0.0/0 ``` ### Create a Load Balancer @@ -148,6 +146,15 @@ created join.yaml created talosconfig ``` +Take note that in this version of Talos, the generated configs are too long for AWS userdata field. +Comments can be removed to workaround this with a sed command like: + +```bash +cat init.yaml | sed 's/ #.//' > temp.yaml; mv temp.yaml init.yaml + +cat controlplane.yaml | sed 's/ #.//' > temp.yaml; mv temp.yaml controlplane.yaml +``` + At this point, you can modify the generated configs to your liking. #### Validate the Configuration Files @@ -177,6 +184,7 @@ aws ec2 run-instances \ --user-data file://init.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-0}]" ``` @@ -193,6 +201,7 @@ while [[ "$CP_COUNT" -lt 3 ]]; do --user-data file://controlplane.yaml \ --subnet-id $SUBNET \ --security-group-ids $SECURITY_GROUP \ + --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=talos-aws-tutorial-cp-$CP_COUNT}]" ((CP_COUNT++)) done @@ -222,6 +231,7 @@ aws elbv2 create-target-group \ --name talos-aws-tutorial-tg \ --protocol TCP \ --port 6443 \ + --target-type ip \ --vpc-id $VPC ```