Skip to content

Commit

Permalink
Fix outdated coredns version (#1447)
Browse files Browse the repository at this point in the history
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes

<!--Give us a brief description of what you've done and what it solves.
-->

Backport 3.x changes that make examples compute the latest coredns addon
version instead of using an outdated version and failing.

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->

Fixes #1444
Fixes #1437
  • Loading branch information
t0yv0 authored Oct 16, 2024
1 parent b764d99 commit 12f77e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/cluster-py/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@
### EKS Addons ###
##########################

coredns_version = aws.eks.get_addon_version_output(addon_name="coredns",
kubernetes_version=cluster3.eks_cluster.version,
most_recent=True)

coredns = eks.Addon(
f"{project_name}-cluster3-coredns",
cluster=cluster3,
addon_name="coredns",
addon_version="v1.11.1-eksbuild.9",
addon_version=coredns_version.version,
resolve_conflicts_on_update="PRESERVE",
configuration_values={
"replicaCount": 4,
Expand Down
9 changes: 8 additions & 1 deletion examples/cluster/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";

Expand Down Expand Up @@ -62,11 +63,17 @@ const cluster4 = new eks.Cluster(`${projectName}-4`, {
/// EKS Addons ///
//////////////////////////

const corednsVersion = aws.eks.getAddonVersionOutput({
addonName: "coredns",
kubernetesVersion: cluster3.eksCluster.version,
mostRecent: true,
});

// Test that we can create a coredns addon within cluster3.
const coredns = new eks.Addon("coredns", {
cluster: cluster3,
addonName: "coredns",
addonVersion: "v1.11.1-eksbuild.9",
addonVersion: corednsVersion.version,
resolveConflictsOnUpdate: "PRESERVE",
configurationValues: {
replicaCount: 4,
Expand Down
1 change: 1 addition & 0 deletions examples/cluster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/awsx": "^2.0.2",
"@pulumi/aws": "^6.56.0",
"@pulumi/eks": "latest"
},
"scripts": {
Expand Down

0 comments on commit 12f77e2

Please sign in to comment.