early-musician-41645
11/05/2018, 7:06 PMaws-node
.
I thought that it was managed outside the pulumi stack and raising the error, but that's not the case. I've now confirmed that it's failing even if the entire stack is managed by Pulumi.
I first destroyed all the resources, then I pulumi up
which creates an EKS cluster and a helm chart. The helm chart has a ServiceAccount and it fails with this:
Diagnostics:
kubernetes:core:ServiceAccount (kube-system/aws-node):
error: Plan apply failed: serviceaccounts "aws-node" already exists
The expected behavior is that the existing ServiceAccount would not raise an error and instead would get treated as a no-op.creamy-potato-29402
11/05/2018, 7:18 PMearly-musician-41645
11/05/2018, 7:19 PMpulumi up
throws an error.creamy-potato-29402
11/05/2018, 7:20 PMearly-musician-41645
11/05/2018, 7:20 PMnew eks.Cluster
. One of the things created by that is the SAcreamy-potato-29402
11/05/2018, 7:21 PMearly-musician-41645
11/05/2018, 7:22 PMcreamy-potato-29402
11/05/2018, 7:22 PMearly-musician-41645
11/05/2018, 7:22 PMcreamy-potato-29402
11/05/2018, 7:22 PMearly-musician-41645
11/05/2018, 7:22 PMcreamy-potato-29402
11/05/2018, 7:22 PMmicroscopic-florist-22719
creamy-potato-29402
11/05/2018, 7:24 PMmicroscopic-florist-22719
creamy-potato-29402
11/05/2018, 7:26 PMearly-musician-41645
11/05/2018, 7:57 PMWARM_IP_TARGET
and deploy it after the cluster is created. I'm trying to add that chart as part of the Pulumi project but it's failing with no particular workaround I can find other than deploying it outside the Pulumi stackmicroscopic-florist-22719
early-musician-41645
11/05/2018, 9:10 PMCNIArgs
to the new eks.Cluster
that I'm already using.eks.Cluster
to avoid getting into the weeds of cluster and worker group creation. There's just a small change I need for the CNI plugin that I want to orchestrate along with cluster creationmicroscopic-florist-22719
// create the EKS cluster and its other core resources
const core = new eks.Core(...);
// deploy additional k8s resources
// create the EKS worker pool
const workers = new eks.WorkerPool(...);
// deploy the k8s dashboard
const dashboard = new eks.Dashboard(...);
early-musician-41645
11/05/2018, 9:23 PMCNIPluginArgs
to one of those (the WorkerPool?)kubectl apply -f aws-k8s-cni.yaml
and that solve the issue. Is there an equivalent to kubectl apply
from a local file I can use with Pulumi?microscopic-florist-22719
// deploy additional k8s resources
), but from what you've described I think that we can do better hereearly-musician-41645
11/05/2018, 9:24 PMmicroscopic-florist-22719
Is there an equivalent tofrom a local file I can use with Pulumi?kubectl apply
early-musician-41645
11/05/2018, 9:26 PMkubectl apply
, and then update a 2nd projectmicroscopic-florist-22719
kubectl
from within Pulumibig-piano-35669
pulumi up
command that works like apply -f $path_to_file
?you could also shell out toThat shouldn't be necessary.from within Pulumikubectl
microscopic-florist-22719
early-musician-41645
11/05/2018, 9:29 PMkubectl apply
. I'd love to do with inside.new eks.Cluster
.big-piano-35669
const k = new k8s.ConfigFile(
"foo", { file: "config/foo.yml" });
to deploy a single Kubernetes YAML file, or
const ks = new k8s.ConfigGroup(
"foos", { files: "config/*.yaml" });
to deploy a collection of them.early-musician-41645
11/05/2018, 9:30 PMconst cni = new k8s.ConfigFile("aws-k8s-cni", { file: "aws-k8s-cni.yaml", });
Diagnostics:
pulumi:pulumi:Stack (eks-cluster-online-vnext-10az):
error: Running program '/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster' failed with an unhandled exception:
error: TSError: ⨯ Unable to compile TypeScript:
index.ts(89,21): error TS2339: Property 'ConfigFile' does not exist on type 'typeof import("/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/@pulumi/kubernetes/index")'.
at createTSError (/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/ts-node/src/index.ts:261:12)
at getOutput (/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/ts-node/src/index.ts:367:40)
at Object.compile (/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/ts-node/src/index.ts:558:11)
at Module.m._compile (/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/ts-node/src/index.ts:439:43)
at Module._extensions..js (module.js:586:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/ts-node/src/index.ts:442:12)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
error: an unhandled error occurred: Program exited with non-zero exit code: 1
creamy-potato-29402
11/05/2018, 9:33 PMearly-musician-41645
11/05/2018, 9:34 PMkubectl apply -f aws-k8s-cni.yaml
does work, and it reports things as unchanged
kubectl
under the hood, I'd expect similar resultscreamy-potato-29402
11/05/2018, 9:34 PMpreview
apply
every time you pulumi up
microscopic-florist-22719
early-musician-41645
11/05/2018, 9:36 PMerror: TSError: ⨯ Unable to compile TypeScript:
index.ts(89,21): error TS2339: Property 'ConfigFile' does not exist on type 'typeof import("/home/tsi.lan/eshamay/git/mustang/sdp-mustang-terraform/pulumi/eks-cluster/node_modules/@pulumi/kubernetes/index")'.
const cni = new k8s.ConfigFile("aws-k8s-cni", { file: "aws-k8s-cni.yaml", });
creamy-potato-29402
11/05/2018, 9:39 PMk8s
here should refer to @pulumi/kubernetes
early-musician-41645
11/05/2018, 9:41 PMimport * as k8s from "@pulumi/kubernetes";
creamy-potato-29402
11/05/2018, 9:42 PMk8s.yaml.ConfigFile
early-musician-41645
11/05/2018, 9:43 PMcreamy-potato-29402
11/05/2018, 9:51 PMearly-musician-41645
11/05/2018, 9:53 PMcreamy-potato-29402
11/05/2018, 9:54 PMearly-musician-41645
11/05/2018, 9:54 PMcreamy-potato-29402
11/05/2018, 10:00 PMearly-musician-41645
11/05/2018, 10:01 PMbig-piano-35669
apply -f
? Or do you prefer an opt-in mechanism? Or just keep doing what we do now?microscopic-florist-22719
early-musician-41645
11/05/2018, 10:13 PMaws-nodes
ServiceAccount (i.e. via the EKS cluster and worker group) then it should tolerate the request to create it again, e.g. as an unchanged resourcekubectl apply
would handle it. It would just report unchanged
.creamy-potato-29402
11/05/2018, 10:19 PMkubectl apply
-ish model here.early-musician-41645
11/05/2018, 10:21 PMthe general problem of patching system resources that you didn't create.The original issue arose because of the
aws-nodes
SA. I did create the SA because I did a new eks.Cluster
. Does that fall into "resources that you didn't create"?creamy-potato-29402
11/05/2018, 10:22 PMearly-musician-41645
11/05/2018, 10:24 PMcreamy-potato-29402
11/05/2018, 10:25 PMearly-musician-41645
11/05/2018, 10:26 PMcreamy-potato-29402
11/05/2018, 10:28 PM