Disabling VPN-only access
This page shows how to open the Kubernetes API of a cluster to the internet again. It's the reverse of Enabling VPN-only access.
You usually need it only before deleting a cluster: the VPN is deleted together with the cluster, and OpenTofu would lose the connection to the cluster halfway. Open the API only for as long as you need it.
With OpenTofu
In terraform/main.tf, find the block of the cluster, module "cluster_<cluster>", and change the access settings to:
module "cluster_<cluster>" {
# ...
#cluster_endpoint_public_access = false
cluster_endpoint_public_access = true
cluster_endpoint_public_access_cidrs = ["0.0.0.0/0"]
# ...
}Instead of 0.0.0.0/0, you can list only the IP ranges you trust.
Stay connected to the VPN, and apply:
cd /src/terraform
tofu applyEKS takes a few minutes to apply the change. After that, you can work with the cluster without the VPN.
In the AWS Console
If the VPN doesn't work, tofu apply can't reach the cluster either. Open the API in the AWS Console instead:
- Open EKS > Clusters > your cluster, in the region of the cluster.
- On the Networking tab, click Manage endpoint access.
- Choose Public and private, and save.
The next tofu apply closes the API again, unless you also change main.tf as shown above.