Making kubectl private in AWS-EKS cluster

11/17/2021

I want to create a cluster which is very similar to this one where they are using azure. Link to the tutorial

Whatever tutorials i have gone through for AWS-EKS are blocking it bi directional. But I need a bastion host and don't want the application to be inaccessible via www.

Is there a possible solution for this problem.

-- Snehlata Giri
amazon-eks
amazon-web-services
azure-aks
kubectl
kubernetes

1 Answer

11/17/2021

The AKS tutorial you posted aim to create completely Private Azure Kubernetes Service (AKS).

Anyway, either case you can use eksctl to easily create one, here's a quick example where public access to control plane is disabled and allow node group to use NAT for Internet access. You can replace <> with your own preference:

cat << EOF | eksctl create cluster -f - 
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: <my cluster name>
  region: <my region name>
vpc:
  clusterEndpoints:
    privateAccess: true
    publicAccess: false
nodeGroups:
  - name: <my self-managed node group name>
    instanceType: <t3a.medium>
    desiredCapacity: 1
EOF
-- gohm&#39;c
Source: StackOverflow