sparse-intern-71089
03/14/2020, 11:24 PMwhite-balloon-205
kubeconfig
property set to in your program (and in your state file)? It is expected to be a string, but it looks like perhaps you are passing an object?white-balloon-205
brave-ambulance-98491
03/15/2020, 8:40 PMkubeconfig
value, exported from another stack.brave-ambulance-98491
03/15/2020, 8:41 PMbrave-ambulance-98491
03/15/2020, 8:43 PMexport const eksKubeconfig = eksCluster.kubeconfig;
white-balloon-205
JSON.stringify
an object if passed in here.
What language are you using? I would have expected a type-error in your language even ahead of being able to reach this.
All of the occurences of kubeconfig:
in pulumi/examples show passing it a string (from various different sources), including this snippet in the aws-ts-eks
README:
const myk8s = new k8s.Provider("myk8s", {
kubeconfig: cluster.kubeconfig.apply(JSON.stringify),
});
brave-ambulance-98491
03/15/2020, 10:27 PMbrave-ambulance-98491
03/15/2020, 10:28 PMany
or something?
const providerKubeconfig = infraStack.requireOutput("eksClusterKubeconfig");
const eksProvider = new k8s.Provider("eks-k8s-provider", {
kubeconfig: providerKubeconfig
});
brave-ambulance-98491
03/15/2020, 10:30 PMbrave-ambulance-98491
03/15/2020, 10:30 PMbrave-ambulance-98491
03/15/2020, 10:31 PMargs
array to the returned cluster value, which is pretty dang ugly.white-balloon-205
requireOutput
returns any
. So unless you cast that explicitly into what you know it actually is - this won't get caught.white-balloon-205
there's actually a related feature request i'd love to submit where the kubeconfig builder function is exported from that moduleThat's a good idea. Mind opening an issue in
pulumi/eks
? I think this has come up before (and there may even already be an issue there?).brave-ambulance-98491
03/15/2020, 10:40 PMbrave-ambulance-98491
03/16/2020, 10:21 PMbrave-ambulance-98491
03/18/2020, 12:03 AMshy-tent-25663
03/25/2020, 2:50 PMkubeconfig
from another stack and receiving a panic when the config is consumed by the Provider
method. However, changes are applied to the stack with no other errors.
panic: interface conversion: interface {} is resource.PropertyMap, not string
exporting stack:
const clusterObj = cluster.create(controlPlaneSg, ngRole);
export const kubeconfig = clusterObj.kubeconfig;
consuming stack:
export const clusterStackRef = new pulumi.StackReference(`project/trips/${envName}`);
const clusterKubeconfig = clusterStackRef.requireOutput("kubeconfig");
const provider = new k8s.Provider("provider", { kubeconfig: clusterKubeconfig });
white-balloon-205
k8s.Provider( { kubeconfig: ... })
. Is your exported kubeconfig
a string or an object?
We should at least have a better error here, if not accept either a string or an object.white-balloon-205
shy-tent-25663
03/25/2020, 4:09 PMkubeconfig
as an object. I added JSON.stringify
but I get the same panic, even on preview.
const clusterKubeconfig = clusterStackRef.requireOutput("kubeconfig").apply(JSON.stringify);
const provider = new k8s.Provider("provider", { kubeconfig: clusterKubeconfig });
brave-ambulance-98491
03/25/2020, 4:11 PMshy-tent-25663
03/26/2020, 3:55 PM