Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-apply "expose ipFamily" #888

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions nodejs/eks/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,14 @@ export function createCore(
let kubernetesNetworkConfig:
| pulumi.Output<aws.types.input.eks.ClusterKubernetesNetworkConfig>
| undefined;
if (args.kubernetesServiceIpAddressRange) {
kubernetesNetworkConfig = pulumi
.output(args.kubernetesServiceIpAddressRange)
.apply((serviceIpv4Cidr) => ({ serviceIpv4Cidr }));
}
if (args.kubernetesServiceIpAddressRange || args.ipFamily ) {
kubernetesNetworkConfig = pulumi.all([args.kubernetesServiceIpAddressRange, args.ipFamily]).apply(
([serviceIpv4Cidr, ipFamily = "ipv4"]) => ({
serviceIpv4Cidr: ipFamily === "ipv4" ? serviceIpv4Cidr : undefined, // only applicable for IPv4 IP family
ipFamily: ipFamily
}),
);
}

// Create the EKS cluster
const eksCluster = new aws.eks.Cluster(
Expand Down Expand Up @@ -1496,6 +1499,13 @@ export interface ClusterOptions {
* - Between /24 and /12.
*/
kubernetesServiceIpAddressRange?: pulumi.Input<string>;

/**
* The IP family used to assign Kubernetes pod and service addresses. Valid values are ipv4 (default) and ipv6.
* You can only specify an IP family when you create a cluster, changing this value will force
* a new cluster to be created.
*/
ipFamily?: pulumi.Input<string>;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"bugs": "https://github.com/pulumi/pulumi-eks/issues",
"dependencies": {
"@pulumi/aws": "5.31.0",
"@pulumi/kubernetes": "^3.20.2",
"@pulumi/kubernetes": "^3.25.0",
"@pulumi/pulumi": "^3.47.0",
"https-proxy-agent": "^5.0.1",
"js-yaml": "^4.1.0",
Expand Down
8 changes: 4 additions & 4 deletions nodejs/eks/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@
read-package-tree "^5.2.1"
resolve "^1.7.1"

"@pulumi/kubernetes@^3.20.2":
version "3.23.0"
resolved "https://registry.yarnpkg.com/@pulumi/kubernetes/-/kubernetes-3.23.0.tgz#43091d72706826cb0b1561081bb2eac860d2e956"
integrity sha512-BKtBMBaS8WwM6REwi9+CkE7NvFshJ4jsWXyCfMNWGdiPFL0ho37JVDu01aY23sXCGM186SbPCrmkKOd93ytLqQ==
"@pulumi/kubernetes@^3.25.0":
version "3.29.1"
resolved "https://registry.yarnpkg.com/@pulumi/kubernetes/-/kubernetes-3.29.1.tgz#a7273d2e0bb19dd6a8b5eed9e0b64982c9ac3534"
integrity sha512-0IDCtOHP2eeVM6Ls2a3x2kv9C7RYWHW+ZLf8dBxIEfsl8kz1jI44uaND3/rTdTuy8t1WEfdlezwVCxAqJL2r1Q==
dependencies:
"@pulumi/pulumi" "^3.25.0"
"@types/glob" "^5.0.35"
Expand Down
10 changes: 8 additions & 2 deletions provider/cmd/pulumi-gen-eks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,18 @@ func generateSchema() schema.PackageSpec {
"See for more details:\n" +
"- https://aws.amazon.com/about-aws/whats-new/2020/03/amazon-eks-adds-envelope-encryption-for-secrets-with-aws-kms/",
},
"ipFamily": {
TypeSpec: schema.TypeSpec{Type: "string"},
Description: "The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.\n" +
"You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.",
ReplaceOnChanges: true,
},
"kubernetesServiceIpAddressRange": {
TypeSpec: schema.TypeSpec{Type: "string"},
Description: "The CIDR block to assign Kubernetes service IP addresses from. If you don't\n" +
"specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or\n" +
"172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap\n" +
"with resources in other networks that are peered or connected to your VPC. You can only specify\n" +
"172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block\n" +
"that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify\n" +
"a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.\n\n" +
"The block must meet the following requirements:\n" +
"- Within one of the following private IP address blocks: 10.0.0.0/8, 172.16.0.0.0/12, or 192.168.0.0/16.\n" +
Expand Down
7 changes: 6 additions & 1 deletion provider/cmd/pulumi-resource-eks/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,14 @@
"type": "string",
"description": "The instance type to use for the cluster's nodes. Defaults to \"t2.medium\"."
},
"ipFamily": {
"type": "string",
"description": "The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.\nYou can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.",
"replaceOnChanges": true
},
"kubernetesServiceIpAddressRange": {
"type": "string",
"description": "The CIDR block to assign Kubernetes service IP addresses from. If you don't\nspecify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or\n172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap\nwith resources in other networks that are peered or connected to your VPC. You can only specify\na custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.\n\nThe block must meet the following requirements:\n- Within one of the following private IP address blocks: 10.0.0.0/8, 172.16.0.0.0/12, or 192.168.0.0/16.\n- Doesn't overlap with any CIDR block assigned to the VPC that you selected for VPC.\n- Between /24 and /12."
"description": "The CIDR block to assign Kubernetes service IP addresses from. If you don't\nspecify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or\n172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block\nthat does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify\na custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.\n\nThe block must meet the following requirements:\n- Within one of the following private IP address blocks: 10.0.0.0/8, 172.16.0.0.0/12, or 192.168.0.0/16.\n- Doesn't overlap with any CIDR block assigned to the VPC that you selected for VPC.\n- Between /24 and /12."
},
"maxSize": {
"type": "integer",
Expand Down
11 changes: 9 additions & 2 deletions sdk/dotnet/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,18 @@ public InputList<Pulumi.Aws.Iam.Role> InstanceRoles
[Input("instanceType")]
public Input<string>? InstanceType { get; set; }

/// <summary>
/// The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.
/// You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.
/// </summary>
[Input("ipFamily")]
public Input<string>? IpFamily { get; set; }

/// <summary>
/// The CIDR block to assign Kubernetes service IP addresses from. If you don't
/// specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or
/// 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap
/// with resources in other networks that are peered or connected to your VPC. You can only specify
/// 172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block
/// that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify
/// a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.
///
/// The block must meet the following requirements:
Expand Down
14 changes: 10 additions & 4 deletions sdk/go/eks/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 49 additions & 8 deletions sdk/java/src/main/java/com/pulumi/eks/ClusterArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,28 @@ public Optional<Output<String>> instanceType() {
return Optional.ofNullable(this.instanceType);
}

/**
* The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.
* You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.
*
*/
@Import(name="ipFamily")
private @Nullable Output<String> ipFamily;

/**
* @return The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.
* You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.
*
*/
public Optional<Output<String>> ipFamily() {
return Optional.ofNullable(this.ipFamily);
}

/**
* The CIDR block to assign Kubernetes service IP addresses from. If you don&#39;t
* specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or
* 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap
* with resources in other networks that are peered or connected to your VPC. You can only specify
* 172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block
* that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify
* a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.
*
* The block must meet the following requirements:
Expand All @@ -367,8 +384,8 @@ public Optional<Output<String>> instanceType() {
/**
* @return The CIDR block to assign Kubernetes service IP addresses from. If you don&#39;t
* specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or
* 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap
* with resources in other networks that are peered or connected to your VPC. You can only specify
* 172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block
* that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify
* a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.
*
* The block must meet the following requirements:
Expand Down Expand Up @@ -961,6 +978,7 @@ private ClusterArgs(ClusterArgs $) {
this.instanceRole = $.instanceRole;
this.instanceRoles = $.instanceRoles;
this.instanceType = $.instanceType;
this.ipFamily = $.ipFamily;
this.kubernetesServiceIpAddressRange = $.kubernetesServiceIpAddressRange;
this.maxSize = $.maxSize;
this.minSize = $.minSize;
Expand Down Expand Up @@ -1467,11 +1485,34 @@ public Builder instanceType(String instanceType) {
return instanceType(Output.of(instanceType));
}

/**
* @param ipFamily The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.
* You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.
*
* @return builder
*
*/
public Builder ipFamily(@Nullable Output<String> ipFamily) {
$.ipFamily = ipFamily;
return this;
}

/**
* @param ipFamily The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`.
* You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created.
*
* @return builder
*
*/
public Builder ipFamily(String ipFamily) {
return ipFamily(Output.of(ipFamily));
}

/**
* @param kubernetesServiceIpAddressRange The CIDR block to assign Kubernetes service IP addresses from. If you don&#39;t
* specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or
* 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap
* with resources in other networks that are peered or connected to your VPC. You can only specify
* 172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block
* that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify
* a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.
*
* The block must meet the following requirements:
Expand All @@ -1490,8 +1531,8 @@ public Builder kubernetesServiceIpAddressRange(@Nullable Output<String> kubernet
/**
* @param kubernetesServiceIpAddressRange The CIDR block to assign Kubernetes service IP addresses from. If you don&#39;t
* specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or
* 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap
* with resources in other networks that are peered or connected to your VPC. You can only specify
* 172.20.0.0/16 CIDR blocks. This setting only applies to IPv4 clusters. We recommend that you specify a block
* that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify
* a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created.
*
* The block must meet the following requirements:
Expand Down
Loading