Operator works fine against a cluster, testing framework fails.
Tracked it down and the test call to create my Custom Resource wipes the TypeMeta off it. But...why?
Operator works fine against a cluster, testing framework fails.
Tracked it down and the test call to create my Custom Resource wipes the TypeMeta off it. But...why?
Started wrangling this test framework and the moment I got past just getting it working it revealed a bug to me.
Now that's instant gratification.
Decided to use my morning quiet/productive hour to start test writing for my operator.
Immediately hit a brick wall as the provided test harness falls over before even running any tests
Perhaps we will try again tomorrow.
I'm making an operator that manages arbitrary resources at runtime using `runtime.RawExtension`
I'd like the resource to be owned using `controllerutil.SetControllerReference` but it takes `metav1.Object` interface, which is understandably broad.
Is there any way around implementing metav1.Object wrapping basically `[]byte` of JSON?
Should I be using `runtime.Scheme` here? Any examples anyone knows of?
Explanation of details and the _why_ of the 10h default resync interval on Kubebuilder.
https://github.com/kubernetes-sigs/controller-runtime/issues/521
DEVops: Разрабатываем свой Kubernetes оператор с кастомными ресурсами на Go
Используете готовые операторы в Kubernetes? Я тоже... Но с какого-то момента я начал задаваться вопросом: "а как люди их пишут?". И я нашел ответ! В этой статье я наглядно покажу, как создать свой кастомный оператор в Kubernetes на Go при помощи kubebuilder. Оператор позволит отслеживать изменения ресурсов в кластере, а затем отправлять уведомления в Telegram или другие мессенджеры. Какие ресурсы "трекать" будем описывать через кастомные ресурсы (Custom Resource). Погнали!
https://habr.com/ru/articles/866766/
#golang #devops #kubernetes #operators #custom_resource_definition #telegram_api #kubebuilder
Getting kubebuilder Makefile to build and deploy using ko
change IMG variable at the top to:
IMG ?= ko://go.app.domain/cmd
and add a target
.PHONY: deploy-local
deploy-local: manifests kustomize
env KO_DOCKER_REPO=localhost:5000 KUBECONFIG=${HOME}/.kube/config.kind make deploy
this deploy to a local registry and using a kubeconfig that is deployed for kind but customize thing as you wish there
Love running random curl commands to install shit from the internet. Always makes me feel like I'm living life to the extreme.
Oh, hey! I was thinking about #kubebuilder, but looks like someone else has already written a #python way to do this: