Open janakg opened 6 months ago
Hey @janakg, thanks for the suggestions! Unfortunately this is probably not the right place for them.
The pulumi linode provider is a wrapper around the terraform linode provider: https://github.com/linode/terraform-provider-linode maintained by linode themselves. We try to faithfully expose all of the functionality there for pulumi users.
You should raise the suggestions as feature requests on the upstream provider - they have the expertise to implement these.
As soon as they are available in the tf provider, we try to bring them over, usually within less then a week.
Thank you!
For anyone finding this ticket and wondering how one can add labels to the deployment. I will use C# but Kubernetes has API for all major platforms. But it's a shame that such basic configuration is not present in the pulumi nor in terraform client for linode.
Note this is pseudocode and you must adjust it to your case
// take kubeconfig from the cluster creation
var lkeCluster = new LkeCluster("lke-cluster", new LkeClusterArgs{...});
var kubeConfig = lkeCluster.Kubeconfig.Apply(s => Encoding.UTF8.GetString(Convert.FromBase64String(s)))
// login to kubernetes client (GetAsync is a wrapper for apply that waits for output for simplicity)
var kubeConfigStream = new MemoryStream(Encoding.UTF8.GetBytes(await kubeConfig.GetAsync()));
var kubeConfig = await KubernetesClientConfiguration.BuildConfigFromConfigFileAsync(kubeConfigStream);
var client = new Kubernetes(kubeConfig);
// do not do this during dryrun as the resource might not be created yet
if (!Deployment.Instance.IsDryRun)
return;
// get node name and fetch Node
var nodeName = await GetNodeId(int index);
var node = await client.ReadNodeAsync(nodeName);
// add label
node.Metadata.Labels.TryAdd(key, value);
// save
await client.ReplaceNodeAsync(node, node.Name())
private async Task<string> GetNodeId(int index = 0)
{
// i use nodepool instead of cluster, but it should be also possible from there
var cluster = await NodePool.ClusterId.GetAsync();
var nodes = await NodePool.Nodes.GetAsync();
var node = nodes[index];
var name = $"lke{cluster}-{node.Id}";
return name;
}
Hello Team!
Thanks for maintaining an active Github repo for pulumi and linode. We have started using LKE for deploying some of our compute workloads. It would be great if these features are prioritized as they are basic to Kube clusters
es-lke-node-
Most importantly [1] & [2] - has to work during autoscaling as well.
Please let me know if these are feasible or happy to learn the limitations.
Thanks