From e090e118f01fb5775a52975fdfe1d44cc7411a55 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Mon, 18 Mar 2024 18:22:36 +0100 Subject: [PATCH] chore(kb/aws/eks): working creation process --- .markdownlint.yaml | 3 +- knowledge base/cloud computing/aws/README.md | 14 + knowledge base/cloud computing/aws/eks.md | 411 +++++++++++++++++-- 3 files changed, 382 insertions(+), 46 deletions(-) diff --git a/.markdownlint.yaml b/.markdownlint.yaml index b4d1dde..77840cf 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -2,6 +2,5 @@ # https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml default: true -MD013: - line_length: 120 +MD013: false MD033: false diff --git a/knowledge base/cloud computing/aws/README.md b/knowledge base/cloud computing/aws/README.md index 28a11e6..0f0ba97 100644 --- a/knowledge base/cloud computing/aws/README.md +++ b/knowledge base/cloud computing/aws/README.md @@ -3,6 +3,7 @@ 1. [Services](#services) 1. [CloudWatch](#cloudwatch) 1. [Resource constraints](#resource-constraints) +1. [Access control](#access-control) 1. [Further readings](#further-readings) 1. [Sources](#sources) @@ -32,10 +33,22 @@ This feature is automatically enabled by default when one starts using one of th | tag | key | Required name of the tag | The string value can be Unicode characters and cannot be prefixed with "aws:".
The string can contain only the set of Unicode letters, digits, white-space, `_`,' `.`, `/`, `=`, `+`, `-`, `:`, `@` (Java regex: `^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$`) | String | 1 to 128 | `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$` | Yes | | tag | value | The optional value of the tag | The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, `_`, `.`, `/`, `=`, `+`, `-`, `:`, `@` (Java regex: `^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"`) | String | 0 to 256 | `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$` | Yes | +## Access control + +From [Using service-linked roles]: + +> A _service role_ is an IAM role that a service assumes to perform actions on your behalf.
+> An IAM administrator can create, modify, and delete a service role from within IAM. +> +> A _service-linked role_ is a type of service role that is linked to an AWS service.
+> The service can assume the role to perform an action on your behalf.
+> Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. + ## Further readings - [EC2] - [Services that publish CloudWatch metrics] +- [Using service-linked roles] ### Sources @@ -55,3 +68,4 @@ This feature is automatically enabled by default when one starts using one of th [constraints tag]: https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html [services that publish cloudwatch metrics]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html [what is cloudwatch]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html +[using service-linked roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html diff --git a/knowledge base/cloud computing/aws/eks.md b/knowledge base/cloud computing/aws/eks.md index 768eee7..2c02710 100644 --- a/knowledge base/cloud computing/aws/eks.md +++ b/knowledge base/cloud computing/aws/eks.md @@ -3,22 +3,43 @@ 1. [TL;DR](#tldr) 1. [Requirements](#requirements) 1. [Creation procedure](#creation-procedure) +1. [Create worker nodes](#create-worker-nodes) + 1. [Create managed node groups](#create-managed-node-groups) + 1. [Schedule pods on Fargate](#schedule-pods-on-fargate) +1. [Secrets encryption through KMS](#secrets-encryption-through-kms) +1. [Troubleshooting](#troubleshooting) 1. [Further readings](#further-readings) 1. [Sources](#sources) ## TL;DR - +When one creates a [_cluster_][amazon eks clusters], one really creates just the cluster's control plane and its dedicated nodes.
+Pods can be scheduled on any combination of [self-managed nodes], [managed node groups] and [Fargate], depending on the cluster's properties. + +EKS automatically installs [self-managed add-ons][amazon eks add-ons] like the AWS VPC CNI plugin, `kube-proxy` and CoreDNS.
+Disable them in the cluster's definition. + +EKS [automatically creates a Security Group for the control plane][amazon eks security group requirements and considerations] upon cluster creation.
+This apparently cannot be avoided or customized in the cluster's definition (e.g. using IaC tools like [Pulumi] or [Terraform]): + +> ```txt +> error: aws:eks/cluster:Cluster resource 'cluster' has a problem: Value for unconfigurable attribute. Can't configure a value for "vpc_config.0.cluster_security_group_id": its value will be decided automatically based on the result of applying this configuration. +> ``` + +For some reason, giving resources a tag like `aks:eks:cluster-name` succeeds, but has no effect (it is not applied). - +[create worker nodes]: #create-worker-nodes +[requirements]: #requirements + +[kubernetes]: ../../kubernetes/README.md +[pulumi]: ../../pulumi.md +[terraform]: ../../pulumi.md + +[amazon eks add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html [amazon eks cluster iam role]: https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html +[amazon eks clusters]: https://docs.aws.amazon.com/eks/latest/userguide/clusters.html +[amazon eks security group requirements and considerations]: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html +[amazon eks troubleshooting]: https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html +[amazon eks vpc and subnet requirements and considerations]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html +[amazoneksclusterpolicy]: https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEKSClusterPolicy.html +[amazoneksservicepolicy]: https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEKSServicePolicy.html [aws eks create-cluster]: https://docs.aws.amazon.com/cli/latest/reference/eks/create-cluster.html +[aws eks create-nodegroup]: https://docs.aws.amazon.com/cli/latest/reference/eks/create-nodegroup.html +[choosing an amazon ec2 instance type]: https://docs.aws.amazon.com/eks/latest/userguide/choosing-instance-type.html +[eks workshop]: https://www.eksworkshop.com/ +[enabling secret encryption on an existing cluster]: https://docs.aws.amazon.com/eks/latest/userguide/enable-kms.html +[fargate]: https://docs.aws.amazon.com/eks/latest/userguide/fargate.html [getting started with amazon eks - aws management console and aws cli]: https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html +[managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html +[self-managed nodes]: https://docs.aws.amazon.com/eks/latest/userguide/worker.html [service-linked role permissions for amazon eks]: https://docs.aws.amazon.com/eks/latest/userguide/using-service-linked-roles-eks.html#service-linked-role-permissions-eks [using service-linked roles for amazon eks]: https://docs.aws.amazon.com/eks/latest/userguide/using-service-linked-roles.html -[amazoneksservicepolicy]: https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEKSServicePolicy.html -[amazoneksclusterpolicy]: https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEKSClusterPolicy.html -[amazon eks vpc and subnet requirements and considerations]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html -[amazon eks security group requirements and considerations]: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html