-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:pulumi/pulumi-eks into blampe/ci-…
…mgmt
- Loading branch information
Showing
257 changed files
with
4,987 additions
and
3,861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,59 @@ | ||
import * as aws from "@pulumi/aws"; | ||
import * as eks from "@pulumi/eks"; | ||
import * as k8s from "@pulumi/kubernetes"; | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as process from "process"; | ||
|
||
const projectName = pulumi.getProject(); | ||
|
||
// For CI testing only: used to set profileName to alternate AWS_PROFILE envvar. | ||
if (!process.env.ALT_AWS_PROFILE) { | ||
throw new Error("ALT_AWS_PROFILE must be set"); | ||
} | ||
|
||
if (!process.env.AWS_REGION) { | ||
throw new Error("AWS_REGION must be set"); | ||
throw new Error("AWS_REGION must be set"); | ||
} | ||
|
||
// AWS named profile to use. | ||
const profileName = process.env.ALT_AWS_PROFILE; | ||
const profileName = "aws-profile-node"; | ||
// AWS region to use. | ||
const region = pulumi.output(process.env.AWS_REGION as aws.types.enums.Region); | ||
|
||
// Create an AWS provider instance using the named profile creds | ||
// and current region. | ||
const awsProvider = new aws.Provider("aws-provider", { | ||
profile: profileName, | ||
region: region, | ||
profile: profileName, | ||
region: region, | ||
}); | ||
|
||
// Define the AWS provider credential opts to configure the cluster's | ||
// kubeconfig auth. | ||
const kubeconfigOpts: eks.KubeconfigOptions = {profileName: profileName}; | ||
const kubeconfigOpts: eks.KubeconfigOptions = { profileName: profileName }; | ||
|
||
// Create the cluster using the AWS provider and credential opts. | ||
const cluster = new eks.Cluster(`${projectName}`, { | ||
const cluster = new eks.Cluster( | ||
`${projectName}`, | ||
{ | ||
providerCredentialOpts: kubeconfigOpts, | ||
authenticationMode: eks.AuthenticationMode.Api, | ||
// TODO(#1475): bootstrapSelfManagedAddons: false, // To speed up the test. | ||
}, {provider: awsProvider}); | ||
corednsAddonOptions: { enabled: false }, // Speed up the test. | ||
}, | ||
{ provider: awsProvider } | ||
); | ||
|
||
// Export the cluster kubeconfig. | ||
export const kubeconfig = cluster.kubeconfig; | ||
|
||
// Export the cluster kubeconfig with the AWS_PROFILE set. | ||
export const kubeconfigWithProfile = cluster.getKubeconfig({profileName: profileName}).result; | ||
export const kubeconfigWithProfile = cluster.getKubeconfig({ | ||
profileName: profileName, | ||
}).result; | ||
|
||
const k8sProvider = new k8s.Provider("with-kubeconfig", { | ||
kubeconfig: kubeconfigWithProfile, | ||
}); | ||
|
||
// Deploy something into the cluster so upgrade tests can check for unexpected | ||
// replacements. | ||
new k8s.core.v1.ConfigMap( | ||
"cm", | ||
{ | ||
data: { foo: "bar" }, | ||
}, | ||
{ provider: k8sProvider } | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.