Skip to content

Commit 68ee4af

Browse files
authored
Merge pull request #88 from frankkoornstra/docs/spring-boot-quickstart
Add documentation for Spring Boot in Readme
2 parents 538bbfd + 22dd271 commit 68ee4af

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,36 @@ public class WebServerSpec {
111111
}
112112
```
113113

114+
### Spring Boot
115+
116+
You can also let Spring Boot wire your application together and automatically register the controllers.
117+
118+
Add [this dependency](https://search.maven.org/search?q=a:spring-boot-operator-framework-starter) to your project:
119+
120+
```xml
121+
<dependency>
122+
<groupId>com.github.containersolutions</groupId>
123+
<artifactId>spring-boot-operator-framework-starter</artifactId>
124+
<version>{see https://search.maven.org/search?q=a:spring-boot-operator-framework-starter for latest version}</version>
125+
</dependency>
126+
```
127+
128+
Create an Application
129+
```java
130+
@SpringBootApplication
131+
public class Application {
132+
public static void main(String[] args) {
133+
SpringApplication.run(Application.class, args);
134+
}
135+
}
136+
```
137+
138+
And add Spring's `@Service` annotation to your controller classes so they will be automatically registered as resource controllers.
139+
140+
The Operator's Spring Boot integration leverages [Spring's configuration mechanisms](https://docs.spring.io/spring-boot/docs/1.0.1.RELEASE/reference/html/boot-features-external-config.html) to configure
141+
- [The Kubernetes client](spring-boot-starter/src/main/java/com/github/containersolutions/operator/spingboot/starter/OperatorProperties.java)
142+
- [Retries](spring-boot-starter/src/main/java/com/github/containersolutions/operator/spingboot/starter/RetryProperties.java)
143+
114144
## Implementation / Design details
115145

116146
This library relies on the amazing [kubernetes-client](https://github.com/fabric8io/kubernetes-client) from fabric8.

0 commit comments

Comments
 (0)