Can Kubernetes CRD be used as a bundle of built-in resources?

2/24/2020

I'm new to Kubernetes CRD. My question is as below:

Usually we need to apply a bunch of built-in resources for an Kubernetes app, like few deployments, services, or ingress. Can they be bundled into a single CRD, without implementing any controllers?

For example, I have a myapp-deploy, myapp-service. Instead if applying them separately, I want to define a new CRD "myapp", similar like:

kind: myapp
spec:
  deployment: myapp-deploy
  service: my-service

Then apply this new CRD.

Is this supported directly in kubernetes, without implementing own controller?

I read the official document and googled as well, but didn't find the answer.

Thanks!

-- Wei Huang
kubernetes

1 Answer

2/24/2020

It is not possible without writing anything. As per your requirement, you need to use kubernetes operator (https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) which will help you to deploy all your resources using one crd.

-- anmol agrawal
Source: StackOverflow