Questions tagged [kubernetes-custom-resources]

123 questions
57
votes
6 answers

How to list applied Custom Resource Definitions in kubernetes with kubectl

I recently applied this CRD file https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml With kubectl apply to install this: https://hub.helm.sh/charts/jetstack/cert-manager I think I managed to apply it…
xetra11
  • 7,671
  • 14
  • 84
  • 159
12
votes
2 answers

How to kubectl wait for crd creation?

What is the best method for checking to see if a custom resource definition exists before running a script, using only kubectl command line? We have a yaml file that contains definitions for a NATS cluster ServiceAccount, Role, ClusterRoleBinding…
NealR
  • 10,189
  • 61
  • 159
  • 299
9
votes
2 answers

How to ensure that CRDs defined in a Helm subchart are stored before being used?

I have a helm chart A which depends on a third-party subchart B. Chart B defines some CRDs which are used by chart A. However, when I install chart A (hence B too), I get an error saying that the CRDs are not recognized. It seems that the CRs are…
gtato
  • 400
  • 2
  • 11
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…
8
votes
1 answer

Kubernetes: create events for custom resources

I have created a custom resource definition (CRD) and a custom resource (CR) in my Kubernetes cluster, but in my CR controller, how do I create Kubernetes events which are attached to my custom resource? I hope with events, users will be able to see…
Dagang
  • 24,586
  • 26
  • 88
  • 133
7
votes
1 answer

Error while applying JSON Patch to Kubernetes Custom Resource

I have an instance of a Kubernetes Custom Resource that I want to patch via the Kubernetes API using a JSON patch. This is my PATCH request: PATCH /apis/example.com/v1alpha1/namespaces/default/mycrd/test HTTP/1.1 Accept:…
helmbert
  • 35,797
  • 13
  • 82
  • 95
6
votes
1 answer

Kubernetes: validating update requests to custom resource

I created a custom resource definition (CRD) and its controller in my cluster, now I can create custom resources, but how do I validate update requests to the CR? e.g., only certain fields can be updated.
Dagang
  • 24,586
  • 26
  • 88
  • 133
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

Kubernetes Operators: Informers vs. reconcile loop

I recently got started with building a Kubernetes operator. I'm using the Fabric8 Java Kubernetes Client but I think my question is more general and also applies to other programming languages and libraries. When reading through blog posts,…
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
3 answers

How to access kubernetes CRD using client-go?

I have few CRDs, but I am not exactly sure how to query kube-apiserver to get list of CRs. Can anyone please provide any sample code?
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?
5
votes
1 answer

Kubernetes Custom CRD: "Failed to list ...: the server could not find the requested resource"

I am trying to create a kubernetes Custom Resource Definition (named Block) but keep hitting the following error: Failed to list *v1alpha1.Block: the server could not find the requested resource (get blocks.kubechain.com). This issue is raised…
Nimrodshn
  • 859
  • 3
  • 13
  • 29
5
votes
1 answer

Why are Kubernetes Custom Resource Definitions cluster wide

Hello StackOverflow users, I've started working in the Kubernetes space recently and saw that Custom Resource Definitions(CRDs) types are not namespaced and are available to to all namespaces. I was wondering why it isn't possible to make a CRD type…
awgreene
  • 65
  • 1
  • 5
4
votes
1 answer

Requeue a kubernetes event in a non-blocking reconcile loop

We have a kubernetes cluster, where a reconcile is triggered in response to a custom event. Implemented in Golang using the following format: type reconciler struct {} func (reconciler) Reconcile(ctx context.Context, o reconcile.Request)…
J.Cage
  • 369
  • 2
  • 18
1
2 3
8 9