https://pulumi.com logo
b

better-shampoo-48884

03/23/2021, 8:38 AM
Trying to get the hang of the relationships between k8s and kx - I don't see how kx can set the context for the cluster in the kubeconfig things should be applied to, is the intention that I set up k8s.Provider first to lock down the context and then pass that as a provider: argument to kx?
b

brave-planet-10645

03/23/2021, 10:12 AM
Yes. So for example if I want to use the kx library to create a secret, I'd do the following:
Copy code
const provider = new k8s.Provider("provider", {
  kubeconfig: config.kubeconfig,
});

const mySecret = new kx.Secret("mySecret", {
  metadata: { namespace: "mynamespace" },
  stringData: { key: "secretdata" },
}, { provider });
b

better-shampoo-48884

03/23/2021, 10:27 AM
excellent - that seems very reasonable 🙂
b

brave-planet-10645

03/23/2021, 10:28 AM
We do like being reasonable 🙂
Basically, kubernetesx is an abstraction over the top of the kubernetes provider (similar to crosswalk / aws) to give you useful defaults so you can get started a lot quicker
4 Views