@@ -15,9 +15,9 @@ Build Kubernetes Operators in Java without hassle. Inspired by [operator-sdk](ht
15
15
16
16
#### Features
17
17
* Framework for handling Kubernetes API events
18
- * Registering Custom Resource watches
18
+ * Automatic registration of Custom Resource watches
19
19
* Retry action on failure
20
- * Smart event scheduling (only handle latest event for the same resource)
20
+ * Smart event scheduling (only handle the latest event for the same resource)
21
21
22
22
Check out this [ blog post] ( https://blog.container-solutions.com/a-deep-dive-into-the-java-operator-sdk )
23
23
about the non-trivial yet common problems needed to be solved for every operator.
@@ -52,6 +52,7 @@ Implemented with and without Spring Boot support. The two samples share the comm
52
52
* * webserver* : More realistic example creating an nginx webserver from a Custom Resource containing html code.
53
53
* * mysql-schema* : Operator managing schemas in a MySQL database
54
54
* * spring-boot-plain/auto-config* : Samples showing integration with Spring Boot.
55
+ * * quarkus* : Minimal application showing automatic configuration / injection of Operator / Controllers.
55
56
56
57
Add [ dependency] ( https://search.maven.org/search?q=a:operator-framework ) to your project with Maven:
57
58
@@ -89,7 +90,7 @@ public class Runner {
89
90
The Controller implements the business logic and describes all the classes needed to handle the CRD.
90
91
91
92
``` java
92
- @Controller ( crdName = " webservers.sample.javaoperatorsdk " )
93
+ @Controller
93
94
public class WebServerController implements ResourceController<WebServer > {
94
95
95
96
@Override
@@ -110,28 +111,9 @@ public class WebServerController implements ResourceController<WebServer> {
110
111
A sample custom resource POJO representation
111
112
112
113
``` java
113
- public class WebServer extends CustomResource {
114
-
115
- private WebServerSpec spec;
116
-
117
- private WebServerStatus status;
118
-
119
- public WebServerSpec getSpec () {
120
- return spec;
121
- }
122
-
123
- public void setSpec (WebServerSpec spec ) {
124
- this . spec = spec;
125
- }
126
-
127
- public WebServerStatus getStatus () {
128
- return status;
129
- }
130
-
131
- public void setStatus (WebServerStatus status ) {
132
- this . status = status;
133
- }
134
- }
114
+ @Group (" sample.javaoperatorsdk" )
115
+ @Version (" v1" )
116
+ public class WebServer extends CustomResource<WebServerSpec , WebServerStatus > {}
135
117
136
118
public class WebServerSpec {
137
119
@@ -183,7 +165,6 @@ public class QuarkusOperator implements QuarkusApplication {
183
165
public int run (String ... args ) throws Exception {
184
166
final var config = configuration. getConfigurationFor(new CustomServiceController (client));
185
167
System . out. println(" CR class: " + config. getCustomResourceClass());
186
- System . out. println(" Doneable class = " + config. getDoneableClass());
187
168
188
169
Quarkus . waitForExit();
189
170
return 0 ;
0 commit comments