Skip to content

Commit c2c91ab

Browse files
author
cpu1
committed
Add documentation for utils update-cluster-vpc-config
1 parent 79b271e commit c2c91ab

File tree

5 files changed

+142
-5
lines changed

5 files changed

+142
-5
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# An example config for updating API server endpoint access, public access CIDRs, and control plane subnets and security groups.
2+
# To perform the update, run `eksctl utils update-cluster-vpc-config -f 38-cluster-subnets-sgs.yaml`
3+
4+
apiVersion: eksctl.io/v1alpha5
5+
kind: ClusterConfig
6+
metadata:
7+
name: cluster-38
8+
region: us-west-2
9+
10+
iam:
11+
withOIDC: true
12+
13+
vpc:
14+
controlPlaneSubnetIDs: [subnet-1234, subnet-5678]
15+
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678]
16+
clusterEndpoints:
17+
publicAccess: true
18+
privateAccess: true
19+
publicAccessCIDRs: ["1.1.1.1/32"]
20+
21+
managedNodeGroups:
22+
- name: mng1

userdocs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ nav:
179179
- usage/vpc-configuration.md
180180
- usage/vpc-subnet-settings.md
181181
- usage/vpc-cluster-access.md
182+
- usage/cluster-subnets-security-groups.md
182183
- usage/vpc-ip-family.md
183184
- IAM:
184185
- usage/minimum-iam-policies.md

userdocs/src/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Getting started
22

33
!!! tip "New for 2023"
4+
`eksctl` now supports [updating the subnets and security groups](/usage/cluster-subnets-security-groups) associated with the EKS control plane.
5+
46
`eksctl` now supports creating fully private clusters on [AWS Outposts](/usage/outposts).
57

68
`eksctl` now supports new ISO regions `us-iso-east-1` and `us-isob-east-1`.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Updating control plane subnets and security groups
2+
3+
## Updating control plane subnets
4+
When a cluster is created with eksctl, a set of public and private subnets are created and passed to the EKS API.
5+
EKS creates 2 to 4 cross-account elastic network interfaces (ENIs) in those subnets to enable communication between the EKS
6+
managed Kubernetes control plane and your VPC.
7+
8+
To update the subnets used by the EKS control plane, run:
9+
10+
```console
11+
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-subnet-ids=subnet-1234,subnet-5678
12+
```
13+
14+
To update the setting using a config file:
15+
16+
```yaml
17+
apiVersion: eksctl.io/v1alpha5
18+
kind: ClusterConfig
19+
metadata:
20+
name: cluster
21+
region: us-west-2
22+
23+
vpc:
24+
controlPlaneSubnetIDs: [subnet-1234, subnet-5678]
25+
```
26+
27+
```console
28+
eksctl utils update-cluster-vpc-config -f config.yaml
29+
```
30+
31+
Without the `--approve` flag, eksctl only logs the proposed changes. Once you are satisfied with the proposed changes, rerun the command with
32+
the `--approve` flag.
33+
34+
## Updating control plane security groups
35+
To manage traffic between the control plane and worker nodes, EKS supports passing additional security groups that are applied to the cross-account network interfaces
36+
provisioned by EKS. To update the security groups for the EKS control plane, run:
37+
38+
```console
39+
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-security-group-ids=sg-1234,sg-5678 --approve
40+
```
41+
42+
To update the setting using a config file:
43+
44+
```yaml
45+
apiVersion: eksctl.io/v1alpha5
46+
kind: ClusterConfig
47+
metadata:
48+
name: cluster
49+
region: us-west-2
50+
51+
vpc:
52+
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678]
53+
```
54+
55+
```console
56+
eksctl utils update-cluster-vpc-config -f config.yaml
57+
```
58+
59+
To update both control plane subnets and security groups for a cluster, run:
60+
61+
```console
62+
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-subnet-ids=<> --control-plane-security-group-ids=<> --approve
63+
```
64+
65+
To update both fields using a config file:
66+
67+
```yaml
68+
apiVersion: eksctl.io/v1alpha5
69+
kind: ClusterConfig
70+
metadata:
71+
name: cluster
72+
region: us-west-2
73+
74+
vpc:
75+
controlPlaneSubnetIDs: [subnet-1234, subnet-5678]
76+
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678]
77+
```
78+
79+
```console
80+
eksctl utils update-cluster-vpc-config -f config.yaml
81+
```
82+
83+
For a complete example, refer to [https://github.com/eksctl-io/eksctl/blob/main/examples/38-cluster-subnets-sgs.yaml](cluster-subnets-sgs.yaml).

userdocs/src/usage/vpc-cluster-access.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ There are some additional caveats when configuring Kubernetes API endpoint acces
3333

3434
The following is an example of how one could configure the Kubernetes API endpoint access using the `utils` sub-command:
3535

36+
```console
37+
eksctl utils update-cluster-vpc-config --cluster=<clustername> --private-access=true --public-access=false
3638
```
37-
eksctl utils update-cluster-endpoints --name=<clustername> --private-access=true --public-access=false
38-
```
39+
40+
!!! warning
41+
`eksctl utils update-cluster-endpoints` has been deprecated in favour of `eksctl utils update-cluster-vpc-config`
42+
and will be removed soon.
3943

4044
To update the setting using a `ClusterConfig` file, use:
4145

4246
```console
43-
eksctl utils update-cluster-endpoints -f config.yaml --approve
47+
eksctl utils update-cluster-vpc-config -f config.yaml --approve
4448
```
4549

4650
Note that if you don't pass a flag, it will keep the current value. Once you are satisfied with the proposed changes,
@@ -59,13 +63,17 @@ vpc:
5963
To update the restrictions on an existing cluster, use:
6064

6165
```console
62-
eksctl utils set-public-access-cidrs --cluster=<cluster> 1.1.1.1/32,2.2.2.0/24
66+
eksctl utils update-cluster-vpc-config --cluster=<cluster> 1.1.1.1/32,2.2.2.0/24
6367
```
6468

69+
!!! warning
70+
`eksctl utils set-public-access-cidrs` has been deprecated in favour of `eksctl utils update-cluster-vpc-config`
71+
and will be removed soon.
72+
6573
To update the restrictions using a `ClusterConfig` file, set the new CIDRs in `vpc.publicAccessCIDRs` and run:
6674

6775
```console
68-
eksctl utils set-public-access-cidrs -f config.yaml
76+
eksctl utils update-cluster-vpc-config -f config.yaml
6977
```
7078

7179
!!! warning
@@ -81,3 +89,24 @@ eksctl utils set-public-access-cidrs -f config.yaml
8189
the internet. (Source: https://github.com/aws/containers-roadmap/issues/108#issuecomment-552766489)
8290

8391
Implementation notes: https://github.com/aws/containers-roadmap/issues/108#issuecomment-552698875
92+
93+
94+
To update both API server endpoint access and public access CIDRs for a cluster in a single command, run:
95+
96+
```console
97+
eksctl utils update-cluster-vpc-config --cluster=<cluster> --public-access=true --private-access=true --public-access-cidrs=1.1.1.1/32,2.2.2.0/24
98+
```
99+
100+
To update the setting using a config file:
101+
102+
```yaml
103+
vpc:
104+
clusterEndpoints:
105+
publicAccess: <true|false>
106+
privateAccess: <true|false>
107+
publicAccessCIDRs: ["1.1.1.1/32"]
108+
```
109+
110+
```console
111+
eksctl utils update-cluster-vpc-config --cluster=<cluster> -f config.yaml
112+
```

0 commit comments

Comments
 (0)