Added kube-controlplane binary

This adds a custom binary which contains all Kubernetes control plane
components. This is necessary since every control plane binary by itself
is around 130MiB and this combined one is only around 150MiB. This
can be cut in half to around 70MiB as soon as Kubernetes can be built
providerless by Bazel.

I'm not entirely happy with the integration, we may need gazelle
exclusions and a plan to deal with go mod since it can't resolve the
dependencies in a reasonable way.

Test Plan: Manual test with kubectl (this by itself is not runnable)

Bug: T485

X-Origin-Diff: phab/D256
GitOrigin-RevId: d76702f2cd0d71463ff891e5a44eac7b66be07f0
diff --git a/core/cmd/kube-controlplane/BUILD b/core/cmd/kube-controlplane/BUILD
new file mode 100644
index 0000000..6ae215a
--- /dev/null
+++ b/core/cmd/kube-controlplane/BUILD
@@ -0,0 +1,44 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+# This is a hack to make go modules ignore all of kube-controlplane since Kubernetes is not importable
+# and we still need normal go mod tooling to work. Instead we're just depending on our own Kubernetes
+# which is already being built with Bazel and thus works fine as a dependency.
+
+genrule(
+    name = "hack_ignore",
+    srcs = [
+        "main.go",
+    ],
+    outs = [
+        "main_patched.go",
+    ],
+    cmd = """
+    sed '/+build ignore/d' $(location main.go) > "$@"
+    """,
+    visibility = ["//visibility:public"],
+)
+
+go_library(
+    name = "go_default_library",
+    srcs = [":main_patched.go"],
+    importpath = "git.monogon.dev/source/nexantic.git/core/cmd/kubemaster",
+    visibility = ["//visibility:private"],
+    deps = [
+        "@kubernetes//cmd/kube-apiserver/app:go_default_library",
+        "@kubernetes//cmd/kube-controller-manager/app:go_default_library",
+        "@kubernetes//cmd/kube-scheduler/app:go_default_library",
+        "@kubernetes//pkg/client/metrics/prometheus:go_default_library",
+        "@kubernetes//pkg/version/prometheus:go_default_library",
+        "@kubernetes//staging/src/k8s.io/component-base/cli/flag:go_default_library",
+        "@kubernetes//staging/src/k8s.io/component-base/logs:go_default_library",
+        "@kubernetes//vendor/github.com/spf13/cobra:go_default_library",
+        "@kubernetes//vendor/github.com/spf13/pflag:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "kube-controlplane",
+    embed = [":go_default_library"],
+    pure = "on",
+    visibility = ["//visibility:public"],
+)