Skip to content

Commit 7461e0a

Browse files
author
Dominik Augustin
authored
Cleanup Queue Processor installation docs (#862)
1 parent 31b500a commit 7461e0a

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

BUILD.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ make build-docker-images
1919

2020
Under the hood, this passes each architecture as the `--platform` argument to `docker buildx build`, like this:
2121
```
22-
$ docker buildx create --use
23-
$ docker buildx build --load --platform "linux/amd64" -t ${USER}/aws-node-termination-handler-amd64:v1.0.0 .
24-
$ docker buildx build --load --platform "linux/arm64" -t ${USER}/aws-node-termination-handler-arm64:v1.0.0 .
22+
docker buildx create --use
23+
docker buildx build --load --platform "linux/amd64" -t ${USER}/aws-node-termination-handler-amd64:v1.0.0 .
24+
docker buildx build --load --platform "linux/arm64" -t ${USER}/aws-node-termination-handler-arm64:v1.0.0 .
2525
```
2626

2727
To push a multi-arch image, you can use the helper tool [manifest-tool](https://github.com/estesp/manifest-tool).
2828

2929
```
30-
$ cat << EOF > manifest.yaml
30+
cat << EOF > manifest.yaml
3131
image: ${USER}/aws-node-termination-handler:v1.0.0
3232
manifests:
3333
-
@@ -41,7 +41,7 @@ manifests:
4141
architecture: arm64
4242
os: linux
4343
EOF
44-
$ manifest-tool push from-spec manifest.yaml
44+
manifest-tool push from-spec manifest.yaml
4545
```
4646

4747
### Building for Windows

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Here is the AWS CLI command to create an SQS queue to hold termination events fr
216216

217217
```
218218
## Queue Policy
219-
$ QUEUE_POLICY=$(cat <<EOF
219+
QUEUE_POLICY=$(cat <<EOF
220220
{
221221
"Version": "2012-10-17",
222222
"Id": "MyQueuePolicy",
@@ -235,18 +235,18 @@ EOF
235235
)
236236
237237
## make sure the queue policy is valid JSON
238-
$ echo "$QUEUE_POLICY" | jq .
238+
echo "$QUEUE_POLICY" | jq .
239239
240240
## Save queue attributes to a temp file
241-
$ cat << EOF > /tmp/queue-attributes.json
241+
cat << EOF > /tmp/queue-attributes.json
242242
{
243243
"MessageRetentionPeriod": "300",
244244
"Policy": "$(echo $QUEUE_POLICY | sed 's/\"/\\"/g' | tr -d -s '\n' " ")",
245-
"SqsManagedSseEnabled": true
245+
"SqsManagedSseEnabled": "true"
246246
}
247247
EOF
248248
249-
$ aws sqs create-queue --queue-name "${SQS_QUEUE_NAME}" --attributes file:///tmp/queue-attributes.json
249+
aws sqs create-queue --queue-name "${SQS_QUEUE_NAME}" --attributes file:///tmp/queue-attributes.json
250250
```
251251

252252
If you are sending Lifecycle termination events from ASG directly to SQS, instead of through EventBridge, then you will also need to create an IAM service role to give Amazon EC2 Auto Scaling access to your SQS queue. Please follow [these linked instructions to create the IAM service role: link.](https://docs.aws.amazon.com/autoscaling/ec2/userguide/configuring-lifecycle-hook-notifications.html#sqs-notifications)
@@ -262,7 +262,7 @@ There are some caveats when using [server side encryption with SQS](https://docs
262262
Here is the AWS CLI command to create a termination lifecycle hook on an existing ASG when using EventBridge, although this should really be configured via your favorite infrastructure-as-code tool like CloudFormation or Terraform:
263263

264264
```
265-
$ aws autoscaling put-lifecycle-hook \
265+
aws autoscaling put-lifecycle-hook \
266266
--lifecycle-hook-name=my-k8s-term-hook \
267267
--auto-scaling-group-name=my-k8s-asg \
268268
--lifecycle-transition=autoscaling:EC2_INSTANCE_TERMINATING \
@@ -273,7 +273,7 @@ $ aws autoscaling put-lifecycle-hook \
273273
If you want to avoid using EventBridge and instead send ASG Lifecycle events directly to SQS, instead use the following command, using the ARNs from Step 1:
274274

275275
```
276-
$ aws autoscaling put-lifecycle-hook \
276+
aws autoscaling put-lifecycle-hook \
277277
--lifecycle-hook-name=my-k8s-term-hook \
278278
--auto-scaling-group-name=my-k8s-asg \
279279
--lifecycle-transition=autoscaling:EC2_INSTANCE_TERMINATING \
@@ -290,7 +290,7 @@ The value of the key does not matter.
290290

291291
To tag ASGs and propagate the tags to your instances (recommended):
292292
```
293-
$ aws autoscaling create-or-update-tags \
293+
aws autoscaling create-or-update-tags \
294294
--tags ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=aws-node-termination-handler/managed,Value=,PropagateAtLaunch=true
295295
```
296296

@@ -320,39 +320,39 @@ If we use ASG without capacity-rebalance enabled, then spot interruptions will c
320320
Here are AWS CLI commands to create Amazon EventBridge rules so that ASG termination events, Spot Interruptions, Instance state changes, Rebalance Recommendations, and AWS Health Scheduled Changes are sent to the SQS queue created in the previous step. This should really be configured via your favorite infrastructure-as-code tool like CloudFormation (template [here](docs/cfn-template.yaml)) or Terraform:
321321

322322
```
323-
$ aws events put-rule \
323+
aws events put-rule \
324324
--name MyK8sASGTermRule \
325325
--event-pattern "{\"source\":[\"aws.autoscaling\"],\"detail-type\":[\"EC2 Instance-terminate Lifecycle Action\"]}"
326326
327-
$ aws events put-targets --rule MyK8sASGTermRule \
327+
aws events put-targets --rule MyK8sASGTermRule \
328328
--targets "Id"="1","Arn"="arn:aws:sqs:us-east-1:123456789012:MyK8sTermQueue"
329329
330-
$ aws events put-rule \
330+
aws events put-rule \
331331
--name MyK8sSpotTermRule \
332332
--event-pattern "{\"source\": [\"aws.ec2\"],\"detail-type\": [\"EC2 Spot Instance Interruption Warning\"]}"
333333
334-
$ aws events put-targets --rule MyK8sSpotTermRule \
334+
aws events put-targets --rule MyK8sSpotTermRule \
335335
--targets "Id"="1","Arn"="arn:aws:sqs:us-east-1:123456789012:MyK8sTermQueue"
336336
337-
$ aws events put-rule \
337+
aws events put-rule \
338338
--name MyK8sRebalanceRule \
339339
--event-pattern "{\"source\": [\"aws.ec2\"],\"detail-type\": [\"EC2 Instance Rebalance Recommendation\"]}"
340340
341-
$ aws events put-targets --rule MyK8sRebalanceRule \
341+
aws events put-targets --rule MyK8sRebalanceRule \
342342
--targets "Id"="1","Arn"="arn:aws:sqs:us-east-1:123456789012:MyK8sTermQueue"
343343
344-
$ aws events put-rule \
344+
aws events put-rule \
345345
--name MyK8sInstanceStateChangeRule \
346346
--event-pattern "{\"source\": [\"aws.ec2\"],\"detail-type\": [\"EC2 Instance State-change Notification\"]}"
347347
348-
$ aws events put-targets --rule MyK8sInstanceStateChangeRule \
348+
aws events put-targets --rule MyK8sInstanceStateChangeRule \
349349
--targets "Id"="1","Arn"="arn:aws:sqs:us-east-1:123456789012:MyK8sTermQueue"
350350
351-
$ aws events put-rule \
351+
aws events put-rule \
352352
--name MyK8sScheduledChangeRule \
353353
--event-pattern "{\"source\": [\"aws.health\"],\"detail-type\": [\"AWS Health Event\"],\"detail\": {\"service\": [\"EC2\"],\"eventTypeCategory\": [\"scheduledChange\"]}}"
354354
355-
$ aws events put-targets --rule MyK8sScheduledChangeRule \
355+
aws events put-targets --rule MyK8sScheduledChangeRule \
356356
--targets "Id"="1","Arn"="arn:aws:sqs:us-east-1:123456789012:MyK8sTermQueue"
357357
```
358358

0 commit comments

Comments
 (0)