-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for
utils update-cluster-vpc-config
- Loading branch information
cpu1
committed
Oct 24, 2023
1 parent
79b271e
commit c2c91ab
Showing
5 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# An example config for updating API server endpoint access, public access CIDRs, and control plane subnets and security groups. | ||
# To perform the update, run `eksctl utils update-cluster-vpc-config -f 38-cluster-subnets-sgs.yaml` | ||
|
||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
metadata: | ||
name: cluster-38 | ||
region: us-west-2 | ||
|
||
iam: | ||
withOIDC: true | ||
|
||
vpc: | ||
controlPlaneSubnetIDs: [subnet-1234, subnet-5678] | ||
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678] | ||
clusterEndpoints: | ||
publicAccess: true | ||
privateAccess: true | ||
publicAccessCIDRs: ["1.1.1.1/32"] | ||
|
||
managedNodeGroups: | ||
- name: mng1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Updating control plane subnets and security groups | ||
|
||
## Updating control plane subnets | ||
When a cluster is created with eksctl, a set of public and private subnets are created and passed to the EKS API. | ||
EKS creates 2 to 4 cross-account elastic network interfaces (ENIs) in those subnets to enable communication between the EKS | ||
managed Kubernetes control plane and your VPC. | ||
|
||
To update the subnets used by the EKS control plane, run: | ||
|
||
```console | ||
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-subnet-ids=subnet-1234,subnet-5678 | ||
``` | ||
|
||
To update the setting using a config file: | ||
|
||
```yaml | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
metadata: | ||
name: cluster | ||
region: us-west-2 | ||
|
||
vpc: | ||
controlPlaneSubnetIDs: [subnet-1234, subnet-5678] | ||
``` | ||
```console | ||
eksctl utils update-cluster-vpc-config -f config.yaml | ||
``` | ||
|
||
Without the `--approve` flag, eksctl only logs the proposed changes. Once you are satisfied with the proposed changes, rerun the command with | ||
the `--approve` flag. | ||
|
||
## Updating control plane security groups | ||
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 | ||
provisioned by EKS. To update the security groups for the EKS control plane, run: | ||
|
||
```console | ||
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-security-group-ids=sg-1234,sg-5678 --approve | ||
``` | ||
|
||
To update the setting using a config file: | ||
|
||
```yaml | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
metadata: | ||
name: cluster | ||
region: us-west-2 | ||
|
||
vpc: | ||
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678] | ||
``` | ||
```console | ||
eksctl utils update-cluster-vpc-config -f config.yaml | ||
``` | ||
|
||
To update both control plane subnets and security groups for a cluster, run: | ||
|
||
```console | ||
eksctl utils update-cluster-vpc-config --cluster=<cluster> --control-plane-subnet-ids=<> --control-plane-security-group-ids=<> --approve | ||
``` | ||
|
||
To update both fields using a config file: | ||
|
||
```yaml | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
metadata: | ||
name: cluster | ||
region: us-west-2 | ||
|
||
vpc: | ||
controlPlaneSubnetIDs: [subnet-1234, subnet-5678] | ||
controlPlaneSecurityGroupIDs: [sg-1234, sg-5678] | ||
``` | ||
```console | ||
eksctl utils update-cluster-vpc-config -f config.yaml | ||
``` | ||
|
||
For a complete example, refer to [https://github.com/eksctl-io/eksctl/blob/main/examples/38-cluster-subnets-sgs.yaml](cluster-subnets-sgs.yaml). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters