sparse-intern-71089
11/30/2022, 11:53 PMpolite-zoo-26802
11/30/2022, 11:54 PMimport { local } from "@pulumi/command";
import * as eks from "@Pulumi/eks";
const cluster = new eks.Cluster("cluster", {});
const createKubernetesNamespace = new local.Command("createKubernetesNamespace", {
create: "kubectl create namespace test-namespace",
environment: {
KUBECONFIG: cluster.kubeconfig,
},
});
polite-zoo-26802
11/30/2022, 11:54 PMgorgeous-egg-16927
12/01/2022, 12:25 AMKUBECONFIG
env var is expecting a path, but the .kubeconfig
property is returning the kubeconfig as an object. This worked for me locally:
import { local } from "@pulumi/command";
new local.Command("createNamespace", {
create: "kubectl create namespace test-namespace",
delete: "kubectl delete namespace test-namespace",
environment: {
KUBECONFIG: `/Users/levi/.kube/config`,
}
});
polite-zoo-26802
12/07/2022, 11:19 PMpolite-zoo-26802
12/07/2022, 11:19 PMpolite-zoo-26802
12/07/2022, 11:20 PMpolite-zoo-26802
12/07/2022, 11:20 PMkubectl --config <(echo ${my_kubeconfig}) delete namespace test-namespace
,
});polite-zoo-26802
12/07/2022, 11:23 PM