Skip to content

Commit c920c44

Browse files
authored
Describe how to create a cluster without node pools (#849)
* draft of create cluster without built in node pools * add role example
1 parent f116a37 commit c920c44

File tree

4 files changed

+102
-6
lines changed

4 files changed

+102
-6
lines changed

latest/ug/automode/create-node-class.adoc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,60 @@ kubectl apply -f nodeclass.yaml
4545

4646
Next, reference the Node Class in your Node Pool configuration. For more information, see <<create-node-pool>>.
4747

48+
[#auto-node-access-entry]
49+
== Create node class access entry
50+
51+
If you create a custom node class, you need to create an EKS Access Entry to permit the nodes to join the cluster. EKS automatically creates access entries when you use the built-in node class and node pools.
52+
53+
For information about how Access Entries work, see <<access-entries>>.
54+
55+
When creating access entries for EKS Auto Mode node classes, you need to use the `EC2` access entry type.
56+
57+
=== Create access entry with CLI
58+
59+
*To create an access entry for EC2 nodes and associate the EKS Auto Node Policy:*
60+
61+
Update the following CLI commands with your cluster name, and node role ARN. The node role ARN is specified in the node class YAML.
62+
63+
[source,bash]
64+
----
65+
# Create the access entry for EC2 nodes
66+
aws eks create-access-entry \
67+
--cluster-name <cluster-name> \
68+
--principal-arn <node-role-arn> \
69+
--type EC2
70+
71+
# Associate the auto node policy
72+
aws eks associate-access-policy \
73+
--cluster-name <cluster-name> \
74+
--principal-arn <node-role-arn> \
75+
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSAutoNodePolicy \
76+
--access-scope cluster
77+
----
78+
79+
=== Create access entry with CloudFormation
80+
81+
*To create an access entry for EC2 nodes and associate the EKS Auto Node Policy:*
82+
83+
Update the following CloudFormation with your cluster name, and node role ARN. The node role ARN is specified in the node class YAML.
84+
85+
[source,yaml]
86+
----
87+
EKSAutoNodeRoleAccessEntry:
88+
Type: AWS::EKS::AccessEntry
89+
Properties:
90+
ClusterName: <cluster-name>
91+
PrincipalArn: <node-role-arn>
92+
Type: "EC2"
93+
AccessPolicies:
94+
- AccessScope:
95+
Type: cluster
96+
PolicyArn: arn:aws:eks::aws:cluster-access-policy/AmazonEKSAutoNodePolicy
97+
DependsOn: [ <cluster-name> ] # previously defined in CloudFormation
98+
----
99+
100+
For information about deploying CloudFormation stacks, see link:AWSCloudFormation/latest/UserGuide/GettingStarted.html["Getting started with CloudFormation", type="documentation"]
101+
48102
== Node Class Specification
49103

50104
[source,yaml]
@@ -88,6 +142,11 @@ spec:
88142
size: "80Gi" # Range: 1-59000Gi or 1-64000G or 1-58Ti or 1-64T
89143
iops: 3000 # Range: 3000-16000
90144
throughput: 125 # Range: 125-1000
145+
146+
# IAM role to use for EC2 instance role
147+
# If unspecified, EKS will create a role
148+
# If specified, role requires access entry described above
149+
role: arn:aws:iam::123456789012:role/MyNodeRole
91150
92151
# Optional: Additional EC2 tags
93152
tags:

latest/ug/automode/create-node-pool.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,34 @@ spec:
178178
** `node.kubernetes.io/windows-build`
179179
** `kubernetes.io/os`
180180

181+
== Disable built-in node pools
182+
183+
If you create custom node pools, you can disable the built-in node pools. For more information, see <<set-builtin-node-pools>>.
184+
185+
== Cluster without built-in node pools
186+
187+
You can create a cluster without the built-in node pools. This is helpful when your organization has created customized node pools.
188+
189+
*Overview:*
190+
191+
. Create an EKS cluster with the both `nodePools` and `nodeRoleArn` values empty.
192+
** Sample eksctl `autoModeConfig`:
193+
+
194+
[source,yaml]
195+
----
196+
autoModeConfig:
197+
enabled: true
198+
nodePools: []
199+
# Do not set a nodeRoleARN
200+
----
201+
+
202+
For more information, see <<automode-get-started-eksctl>>
203+
. Create a custom node class with a node role ARN
204+
** For more information, see <<create-node-class>>
205+
. Create an access entry for the custom node class
206+
** For more information, see <<auto-node-access-entry>>
207+
. Create a custom node pool, as described above.
208+
181209
== Disruption
182210

183211
You can configure EKS Auto Mode to disrupt Nodes through your NodePool in multiple ways. You can use `spec.disruption.consolidationPolicy`, `spec.disruption.consolidateAfter`, or `spec.template.spec.expireAfter`. You can also rate limit EKS Auto Mode's disruption through the NodePool’s `spec.disruption.budgets`. You can also control the time windows and number of simultaneous Nodes disrupted. For instructions on configuring this behavior, see https://karpenter.sh/docs/concepts/disruption/[Disruption] in the Karpenter Documentation.

latest/ug/automode/set-builtin-node-pools.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ Both built-in NodePools:
2323
* Use the C, M, and R EC2 instance families
2424
* Require generation 5 or newer EC2 instances
2525

26-
## Prerequisites
26+
== Procedure
27+
28+
=== Prerequisites
2729

2830
* The latest version of the {aws} Command Line Interface ({aws} CLI) installed and configured on your device. To check your current version, use `aws --version`. To install the latest version, see link:cli/latest/userguide/getting-started-install.html["Installing",type="documentation"] and link:cli/latest/userguide/cli-chap-configure.html#cli-configure-quickstart-config["Quick configuration",type="documentation"] with aws configure in the {aws} Command Line Interface User Guide.
2931
** Login to the CLI with sufficent IAM permissions to create {aws} resources including IAM Policies, IAM Roles, and EKS Clusters.
3032

31-
== Enable with {aws} CLI
33+
=== Enable with {aws} CLI
3234

3335
Use the following command to enable both built-in NodePools:
3436

@@ -45,7 +47,7 @@ aws eks update-cluster-config \
4547

4648
You can modify the command to selectively enable the NodePools.
4749

48-
== Disable with {aws} CLI
50+
=== Disable with {aws} CLI
4951

5052
Use the following command to disable both built-in NodePools:
5153

@@ -55,3 +57,4 @@ aws eks update-cluster-config \
5557
--name <cluster-name> \
5658
--compute-config '{"nodePools": []}'
5759
----
60+

latest/ug/manage-access/k8s-access/access-entries.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,15 @@ Before creating access entries, consider the following:
142142
** If the type of the access entry is anything other than `STANDARD` (see next consideration about types), the ARN must be in the same {aws} account that your cluster is in. If the type is `STANDARD`, the ARN can be in the same, or different, {aws} account than the account that your cluster is in.
143143
** You can't change the IAM principal after the access entry is created.
144144
** If you ever delete the IAM principal with this ARN, the access entry isn't automatically deleted. We recommend that you delete the access entry with an ARN for an IAM principal that you delete. If you don't delete the access entry and ever recreate the IAM principal, even if it has the same ARN, the access entry won't work. This is because even though the ARN is the same for the recreated IAM principal, the `roleID` or `userID` (you can see this with the `aws sts get-caller-identity` {aws} CLI command) is different for the recreated IAM principal than it was for the original IAM principal. Even though you don't see the IAM principal's `roleID` or `userID` for an access entry, Amazon EKS stores it with the access entry.
145-
* Each access entry has a _type_. You can specify `EC2_LINUX` (for an IAM role used with Linux or Bottlerocket self-managed nodes), `EC2_Windows` (for an IAM role used with Windows self-managed nodes), `FARGATE_LINUX` (for an IAM role used with {aws} Fargate (Fargate)), `HYBRID_LINUX` (for an IAM role used with hybrid nodes) or `STANDARD` as a type. If you don't specify a type, Amazon EKS automatically sets the type to `STANDARD`. It's unnecessary to create an access entry for an IAM role that's used for a managed node group or a Fargate profile. EKS will create access entries (if enabled), or update the auth config map (if access entries are unavailable).
146-
+
147-
You can't change the type after the access entry is created.
145+
* Each access entry has a _type_. If you don't specify a type, Amazon EKS automatically sets the type to `STANDARD`
146+
** `EC2_LINUX` - For an IAM role used with Linux or Bottlerocket self-managed nodes
147+
** `EC2_WINDOWS` - For an IAM role used with Windows self-managed nodes
148+
** `FARGATE_LINUX` - For an IAM role used with {aws} Fargate (Fargate)
149+
** `HYBRID_LINUX` - For an IAM role used with hybrid nodes
150+
** `STANDARD` - Default type if none specified
151+
** `EC2` - For EKS Auto Mode custom node classes. For more information, see <<auto-node-access-entry>>.
152+
** You can't change the type after the access entry is created.
153+
* It's unnecessary to create an access entry for an IAM role that's used for a managed node group or a Fargate profile. EKS will create access entries (if enabled), or update the auth config map (if access entries are unavailable)
148154
* If the type of the access entry is `STANDARD`, you can specify a _username_ for the access entry. If you don't specify a value for username, Amazon EKS sets one of the following values for you, depending on the type of the access entry and whether the IAM principal that you specified is an IAM role or IAM user. Unless you have a specific reason for specifying your own username, we recommend that don't specify one and let Amazon EKS auto-generate it for you. If you specify your own username:
149155
+
150156
** It can't start with `system:`, `eks:`, `aws:`, `amazon:`, or `iam:`.

0 commit comments

Comments
 (0)