Questions tagged [operator-sdk]

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding. https://github.com/operator-framework/operator-sdk/

107 questions
9
votes
1 answer

Kubernetes Operator (Operator SDK, Kubebuilder VERSUS Kubernetes Client Libraries)

I am sorry if this question has been answered but after trying many different ways of googling for an answer, I have failed to get a definitive explanation so I am trying to seek clarifications here. I am familiar with the operator/controller…
KSheng
  • 147
  • 2
  • 9
9
votes
1 answer

Kubernetes Ansible Operators - Patch an Existing Kubernetes Resource

With ansible: is it possible to patch resources with json or yaml snippets? I basically want to be able to accomplish the same thing as kubectl patch --type='merge' -p='{"spec":{ "test":"hello }}', to append/modify resource…
7
votes
1 answer

List custom resources from caching client with custom fieldSelector

I'm using the Operator SDK to build a custom Kubernetes operator. I have created a custom resource definition and a controller using the respective Operator SDK commands: operator-sdk add api --api-version example.com/v1alpha1…
helmbert
  • 35,797
  • 13
  • 82
  • 95
5
votes
0 answers

Cannot update status field of the custom resource

I'm building a GO-based operator using Operator-sdk to manage my custom resource called Module which owns a deployment. My _types.go looks like…
5
votes
1 answer

Is it okay when two K8S controllers modify same resource at the same time?

I have a few CRDs and each of them supposed to make edit Container.Spec's across the cluster. Like ENVs, Labels, etc... Is it okay, if the resource is managed by more that one controller? What are the possible pitfalls of this approach?
4
votes
1 answer

What is the use for CRD status?

I'm currently writing a kubernetes operator in go using the operator-sdk. This operator creates two StatefulSet and two Service, with some business logic around it. I'm wondering what CRD status is about ? In my reconcile method I use the default…
JesusTheHun
  • 1,217
  • 1
  • 10
  • 19
4
votes
1 answer

Operator controller could not delete correlated resources

In Kubernetes and Operator-sdk, we can define CRD (Custom Resource Definition) and CR (Custom Resource). In my operator controller, when a CR is initialized, then I create a new Deployment and service. When we delete a CR object, then the correlated…
Joe
  • 623
  • 7
  • 16
4
votes
1 answer

kubernetes Operator-sdk test with envTest

I am a newbie for operator-sdk. Now I am writing test for operator with envtest framework, so I had a fake control-plane for environments. Inside controller reconcile loop, once I initialize a CR, then controller will pull down an image for pod and…
Joe
  • 623
  • 7
  • 16
4
votes
2 answers

How to access 3rd-party Custom Resource Definition?

I am working on Opersator-SDK. In my operator controller, I try to create an Istio Custom resource -- virtualservices. The definition of virtualservices looks like as following: kind: CustomResourceDefinition apiVersion:…
Joe
  • 307
  • 1
  • 11
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

Kubernetes operator-sdk : How to delete controller?

We have developed a bunch of controllers and APIs, we need to delete some controllers but we are unable to find a way to delete the API and controllers. We looked at the available options but no flag to delete the apis. operator-sdk --help CLI tool…
drifter
  • 389
  • 1
  • 5
  • 17
3
votes
1 answer

Kubernetes operator create Deployment using yaml template

I am trying my hands on creating my own kubernetes operator by following this link. In the Reconcile function, I need to create multiple Deployments and each will vary in some attributes (like name for e.g.) and the configuration is huge. Instead of…
Vishal
  • 549
  • 3
  • 13
3
votes
0 answers

Scheme is Nil when testing an operator scaffolded with operator-sdk

I'm working on an early iteration of an operator, which I've scaffolded using operator-sdk. I've tried my best to follow the examples from the Operator SDK Golang Tutorial and the Kubebuilder book. I've found that I can deploy and run my operator to…
Jeff Rosenberg
  • 3,522
  • 1
  • 18
  • 38
3
votes
1 answer

How to display a kubectl column using a fraction format (i.e. X/Y) for a Custom Resource

In Kubernetes, is it possible to display a column using a fraction format (i.e. X/Y) using the "additionalPrinterColumns" field of a CRD? More precisely, I would like kubectl to display the description of a CR field using the same format than the…
3
votes
2 answers

Operator SDK controller failed to update Custom Resource status

I'm following this tutorial to create my first Custom Resource named PodSet and currently at step 6 of 7 to test my CR. Here is my Operator SDK controller Go code: package controllers import ( "context" "reflect" …
Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98
1
2 3 4 5 6 7 8