Questions tagged [kubebuilder]

Kubebuilder is a toolkit for building Kubernetes controllers in Go. Use this tag for questions about building custom Kubernetes controllers or operators using the Kubebuilder framework.

Kubebuilder is a toolkit for building Kubernetes controllers in . It provides several of the required parts of a controller, including a core event loop that can monitor changes to Kubernetes resources, freeing you to write only the object-reconciliation code.

In addition to the material in The Kubebuilder Book it will be helpful to understand core concepts, especially The Kubernetes API and the API reference documentation.

Questions about building custom controllers or operators using Kubebuilder should have the tag. These questions will also frequently be related to and . An operator frequently builds as well.

79 questions
9
votes
3 answers

How to trigger a Kubernetes controller reconciler for an arbitrary object?

Overview I am writing a Kubernetes controller for a VerticalScaler CRD that can vertically scale a Deployment in the cluster. My spec references an existing Deployment object in the cluster. I'd like to enqueue a reconcile request for a…
Adam Snyder
  • 405
  • 1
  • 5
  • 7
6
votes
2 answers

kubebuilder create webhook requires a previously created API

I'm trying to create a validating webhook kubebuilder create webhook batch \ --version v1 \ --kind Webhook \ --defaulting \ --programmatic-validation but it always gives me an error. failed to create…
alok verma
  • 97
  • 7
5
votes
2 answers

Watch event for specific object

We have an k8s operator (based on kubebuilder) which works as expected, now we need support for listening to secrets on the cluster. The following code is working however I got event for all the secrets in the cluster which is not efficient, I WANT…
PJEM
  • 557
  • 7
  • 33
5
votes
1 answer

K8s Operator listen to secret change with event filter

We have created a few month ago controller which runs great using kubebuilder. Few weeks ago we added a “listener” to a secret which when the secret is changing (secret properties) The reconcile should be invoked, the problem is that it is sometimes…
Jenney
  • 171
  • 6
  • 18
5
votes
2 answers

Getting the type of event, that triggered a controller in kubebuilder

I'm just getting started with kubebuilder and Golang to extend our Kubernetes-cluster with a custom resource. I would love to do different things in the reconciler-function based on the event, that actually called it. Was the resource created? Was…
Tim Hilt
  • 605
  • 5
  • 23
5
votes
1 answer

why admission webhook is not working in the CronJob example from kubebuilder book

I am following the CronJob example in KubeBuilder book: https://book.kubebuilder.io/cronjob-tutorial/cronjob-tutorial.html I directly use the code from…
DiveInto
  • 2,158
  • 3
  • 27
  • 50
4
votes
1 answer

kubebuilder debug web-hooks locally

We have a kubebuilder controller which is working as expected, now we need to create a webhooks , I follow the tutorial https://book.kubebuilder.io/reference/markers/webhook.html and now I want to run & debug it locally, however not sure what to do…
JME
  • 881
  • 2
  • 11
  • 23
3
votes
1 answer

I was trying to run kubebuilder and this error pops up everytime I try to Install Instances of Custom Resources

enter image description here This is the error that comes. I cannot find a way out. I am running linux command line on windows 10. And trying to run kubebuilder there. Is me running the linux shell in windows the problem.
NKHL
  • 31
  • 1
3
votes
1 answer

How to watch for external custom resource changes in kubebuilder without importing the external type

Suppose I have bellow code snippet which setups a reconciler that watches external resource "External": // SetupWithManager sets up the controller with the Manager. func (r *SomethingReconciler) SetupWithManager(mgr ctrl.Manager) error { return…
mammad
  • 175
  • 8
3
votes
2 answers

Controller not notified about final Job status

I'm building an app that spawns Jobs (batch/v1), I need to update my Custom Resource status with the Job status. I setup the controller with the following: func (r *JobsManagedByRequestedBackupActionObserver) SetupWithManager(mgr ctrl.Manager) error…
3
votes
1 answer

Controller Reconcile on object changes

Im trying to listen to secret change using the operator sdk The problem is that im not getting the reconcile event when I apply the secret with the labels that I define in the operator I did the following mgr, err :=…
PJEM
  • 557
  • 7
  • 33
3
votes
1 answer

k8s controller watch other controller CR

I’ve k8s operator which works as expected, I need to add a “watch” to other operator CRD (not mine), to make it simple lets call it extCR and our operator cr called inCR, I tried the following but there is an issue how its right to trigger the…
Jenney
  • 171
  • 6
  • 18
3
votes
1 answer

K8s operator read raw data

Im trying to get RAW data from operator CR and im getting an empty object . (all others value are working as expected ) I’ve created a minimal example for the issue, in the example im trying to read the infrastructureConfig object The tricky part…
JME
  • 881
  • 2
  • 11
  • 23
3
votes
1 answer

What is "domain" in kubebuilder scaffolding?

The kubebuilder scaffolding command includes a repo and domain e.g. kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project I found following text in kubebuilder book about "domain": domain: Store the domain of the…
Vikas Kaushik
  • 369
  • 2
  • 9
3
votes
1 answer

How to include the spec of a CRD into another CRD?

I am building an operator using Kubebuilder which will work with a CRD which contains a few custom fields and also all fields of an Argo WorkflowTemplate. The fields will be essentially all the fields of an Argo Workflow as the fields in the spec…
mbtamuli
  • 697
  • 1
  • 7
  • 19
1
2 3 4 5 6