curved-kitchen-24115
03/28/2023, 6:26 PM@pulumi/kubernetes
and @pulumi/command
to delete some CRDs when a specific helm chart is deleted. I'd like to be able to write:
new local.Command("name", {
delete: "kubectl delete thing"
}, { provider: k8sProvider});
However that yields: unrecognized resource type: "command:local:Command" for this provider
The error message suggests that somehow makeKubeProvider can be made aware of other providers - but it's really opaque to me as to how this happens. I'm also pulling a blank searching for docs on how this works. Does anyone have any pointers?pulumi.all([clusterCore.kubeconfig]).apply(([config]) => {
// this leaves some trash around; gitignore manages this.
// not clear if this is nasty; but without updating k8sProvider
// to understand local.Command
const filename = `kubeconfig.${hash(stack)}.json`;
writeFileSync(filename, JSON.stringify(config));
[
"<http://alertmanagerconfigs.monitoring.coreos.com|alertmanagerconfigs.monitoring.coreos.com>",
"<http://alertmanagers.monitoring.coreos.com|alertmanagers.monitoring.coreos.com>",
"<http://podmonitors.monitoring.coreos.com|podmonitors.monitoring.coreos.com>",
"<http://probes.monitoring.coreos.com|probes.monitoring.coreos.com>",
"<http://prometheuses.monitoring.coreos.com|prometheuses.monitoring.coreos.com>",
"<http://prometheusrules.monitoring.coreos.com|prometheusrules.monitoring.coreos.com>",
"<http://servicemonitors.monitoring.coreos.com|servicemonitors.monitoring.coreos.com>",
"<http://thanosrulers.monitoring.coreos.com|thanosrulers.monitoring.coreos.com>",
].forEach(
(crd) =>
new local.Command(
`${stack}-cleanupcrd-${hash(crd)}`,
{
delete: `kubectl delete crd ${crd}`,
environment: {
KUBECONFIG: filename,
},
}
)
);
});
clusterCore is an eks.ClusterCore
type from the @pulumi/eks
package.stocky-restaurant-98004
03/28/2023, 6:50 PMcommand.local.Command
can only take an explicit CommandProvider, not a K8s provider.curved-kitchen-24115
03/28/2023, 8:02 PMstocky-restaurant-98004
03/29/2023, 4:05 PMcurved-kitchen-24115
04/02/2023, 10:09 PM