Skip to content

Embed DeploymentSpec #2948

Closed Answered by camilamacedo86
ionut-maxim asked this question in Support
Discussion options

You must be logged in to vote

Hi @ionut-maxim ,

Embedding core Kubernetes types, like DeploymentSpec, inside your custom resource definition (CRD) is absolutely possible. However, when you do so, you need to be careful with how you structure the objects in your YAML files.

Your ApplicationSpec structure indicates that you are embedding the entire Deployment object and not just its spec:

appsv1 "k8s.io/api/apps/v1"

type ApplicationSpec struct {
	Deployment appsv1.Deployment `json:"deployment,omitempty"`
}

Because of this, the structure of your custom resource should match that of a Deployment when specifying it. However, the error you encountered implies you might have added or missed some fields.

If you intended to o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by camilamacedo86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants