Search code examples
c#kubernetes.net-coredocker-desktopnuke-build

How do I use Nuke.Build to apply .yml files to a local kubernetes cluster (docker desktop)?


I am trying to create a Target in Nuke that will apply a .yml file to my local Kubernetes instance (the one that comes with Docker Desktop).

I can see that there are CLI task classes for Kubernetes as they're listed here (under the exhaustive list of supported tools): https://nuke.build/docs/common/cli-tools/

But I can't find any examples of how to use those methods. How do I use them? Are there any examples anywhere?


Solution

  • I worked it out with a lot of trial and error.

    Target ApplySomething => _ => _
            .Executes(() =>
            {
                KubernetesApply(_ => _
                    .AddFilename("C:\\full-path\\your-deployment.yml")
                );
            });