public static async Task Run(KubernetesClientConfiguration config) { var crd = new CustomResourceDefinition() { ApiVersion = "engineerd.dev/v1alpha1", PluralName = "examples", Kind = "Example", Namespace = "default" }; var controller = new Controller <ExampleCRD>( new Kubernetes(config), crd, (WatchEventType eventType, ExampleCRD example) => { Console.WriteLine("Event type: {0} for {1}", eventType, example.Metadata.Name); }); var cts = new CancellationTokenSource(); await controller.StartAsync(cts.Token).ConfigureAwait(false); }
public Controller(Kubernetes client, CustomResourceDefinition crd, Handle handle) { _client = client; _crd = crd; _handle = handle; }