From 5000b52a0d0786014275d9a69d347fd628276b43 Mon Sep 17 00:00:00 2001 From: "Scott S. Lowe" Date: Tue, 17 Oct 2023 15:12:36 -0600 Subject: [PATCH] Update Kubernetes on AWS (EKS) templates (#668) Update all Kubernetes on AWS (EKS) templates to use EKS >1.0 Update configuration values for private clusters for improved clarity Fixes broken Go template Closes #664 Signed-off-by: Scott Lowe --- kubernetes-aws-csharp/Program.cs | 6 +++--- kubernetes-aws-go/go.mod | 6 +++--- kubernetes-aws-go/main.go | 9 +++++---- kubernetes-aws-python/__main__.py | 6 +++--- kubernetes-aws-typescript/index.ts | 6 +++--- kubernetes-aws-yaml/Pulumi.yaml | 6 +++--- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/kubernetes-aws-csharp/Program.cs b/kubernetes-aws-csharp/Program.cs index 94f86b9fd..274eaf121 100644 --- a/kubernetes-aws-csharp/Program.cs +++ b/kubernetes-aws-csharp/Program.cs @@ -41,9 +41,9 @@ // Do not give the worker nodes public IP addresses NodeAssociatePublicIpAddress = false, - // Uncomment the next two lines for a private cluster (VPN access required) - // EndpointPrivateAccess = true, - // EndpointPublicAccess = false, + // Change these values for a private cluster (VPN access required) + EndpointPrivateAccess = false, + EndpointPublicAccess = true, }); // Export some values for use elsewhere diff --git a/kubernetes-aws-go/go.mod b/kubernetes-aws-go/go.mod index f511e9f0d..a2efc3bad 100644 --- a/kubernetes-aws-go/go.mod +++ b/kubernetes-aws-go/go.mod @@ -3,9 +3,9 @@ module ${PROJECT} go 1.20 require ( - github.com/pulumi/pulumi-awsx/sdk v1.0.0 - github.com/pulumi/pulumi-eks/sdk v0.41.0 - github.com/pulumi/pulumi/sdk/v3 v3.31.1 + github.com/pulumi/pulumi-awsx/sdk v1.0.6 + github.com/pulumi/pulumi-eks/sdk v1.0.3 + github.com/pulumi/pulumi/sdk/v3 v3.81.0 ) require ( diff --git a/kubernetes-aws-go/main.go b/kubernetes-aws-go/main.go index 8134788c9..038f2e5dd 100644 --- a/kubernetes-aws-go/main.go +++ b/kubernetes-aws-go/main.go @@ -42,6 +42,7 @@ func main() { } // Create a new EKS cluster + f := false eksCluster, err := eks.NewCluster(ctx, "eks-cluster", &eks.ClusterArgs{ // Put the cluster in the new VPC created earlier VpcId: eksVpc.VpcId, @@ -55,10 +56,10 @@ func main() { MinSize: pulumi.Int(minClusterSize), MaxSize: pulumi.Int(maxClusterSize), // Do not give the worker nodes a public IP address - NodeAssociatePublicIpAddress: pulumi.Bool(false), - // Uncomment the next two lines for a private cluster (VPN access required) - // EndpointPrivateAccess: pulumi.Bool(true), - // EndpointPublicAccess: pulumi.Bool(false), + NodeAssociatePublicIpAddress: &f, + // Change these values for a private cluster (VPN access required) + EndpointPrivateAccess: pulumi.Bool(false), + EndpointPublicAccess: pulumi.Bool(true), }) if err != nil { return err diff --git a/kubernetes-aws-python/__main__.py b/kubernetes-aws-python/__main__.py index 0b7515355..7d01f94b9 100644 --- a/kubernetes-aws-python/__main__.py +++ b/kubernetes-aws-python/__main__.py @@ -30,9 +30,9 @@ max_size=max_cluster_size, # Do not give worker nodes a public IP address node_associate_public_ip_address=False, - # Uncomment the next two lines for private cluster (VPN access required) - # endpoint_private_access=true, - # endpoint_public_access=false + # Change these values for a private cluster (VPN access required) + endpoint_private_access=False, + endpoint_public_access=True ) # Export values to use elsewhere diff --git a/kubernetes-aws-typescript/index.ts b/kubernetes-aws-typescript/index.ts index e4158e537..eda3ab5a9 100644 --- a/kubernetes-aws-typescript/index.ts +++ b/kubernetes-aws-typescript/index.ts @@ -31,9 +31,9 @@ const eksCluster = new eks.Cluster("eks-cluster", { maxSize: maxClusterSize, // Do not give the worker nodes public IP addresses nodeAssociatePublicIpAddress: false, - // Uncomment the next two lines for a private cluster (VPN access required) - // endpointPrivateAccess: true, - // endpointPublicAccess: false + // Change these values for a private cluster (VPN access required) + endpointPrivateAccess: false, + endpointPublicAccess: true, }); // Export some values for use elsewhere diff --git a/kubernetes-aws-yaml/Pulumi.yaml b/kubernetes-aws-yaml/Pulumi.yaml index 9f44329b3..f55146a84 100644 --- a/kubernetes-aws-yaml/Pulumi.yaml +++ b/kubernetes-aws-yaml/Pulumi.yaml @@ -62,9 +62,9 @@ resources: maxSize: ${maxClusterSize} # Do not give the worker nodes public IP addresses nodeAssociatePublicIpAddress: false - # Uncomment next two lines for private cluster access (VPN access required) - # endpointPrivateAccess: true - # endpointPublicAccess: false + # Change these values for a private cluster (VPN access required) + endpointPrivateAccess: false + endpointPublicAccess: true outputs: # Output the Kubeconfig for the cluster kubeconfig: ${eks-cluster.kubeconfig}