Skip to content

Apply CRDs on startup of operator #807

Open
@dennisfischer

Description

@dennisfischer

CRDs can be generated by using io.fabric8:crd-generator-apt as an annotationProcessor. The CRDs need to be applied manually to the cluster every time they change. This results in a bad development experience.

The quarkus-operator-sdk already deals with both tasks (Generating CRDs, Applying CRDs) and provides a configuration property to enable/disable CRD installation.

Workaround Gradle

A simple workaround could be to create an additional task. The task could be structured like the following (will fail with Kubernetes 1.22+):

task applyCrds(type: Exec) {
    commandLine = ["kubectl", "apply", "-f", "$buildDir/classes/java/main/META-INF/fabric8/"]

    tasks.compileJava.finalizedBy(tasks.applyCrds)
}

Metadata

Metadata

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.needs-discussionIssue needs to be discussed more before working on it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions