19
19
import io .kubernetes .client .informer .SharedInformer ;
20
20
import io .kubernetes .client .informer .SharedInformerFactory ;
21
21
import io .kubernetes .client .informer .cache .Lister ;
22
- import io .kubernetes .client .openapi .ApiClient ;
23
22
import io .kubernetes .client .openapi .models .V1Endpoints ;
24
23
import io .kubernetes .client .openapi .models .V1EndpointsList ;
25
24
import io .kubernetes .client .openapi .models .V1Node ;
26
25
import io .kubernetes .client .openapi .models .V1NodeList ;
27
26
import io .kubernetes .client .openapi .models .V1Pod ;
28
27
import io .kubernetes .client .openapi .models .V1PodList ;
29
- import io .kubernetes .client .spring .extended .controller .KubernetesInformerConfigurer ;
30
28
import io .kubernetes .client .spring .extended .controller .annotation .*;
31
29
import io .kubernetes .client .spring .extended .controller .factory .KubernetesControllerFactory ;
32
- import io .kubernetes .client .spring .extended .controller .metrics .PrometheusScrapeEndpoint ;
33
- import io .kubernetes .client .util .ClientBuilder ;
34
- import java .io .IOException ;
35
- import java .time .Duration ;
36
30
import org .springframework .beans .factory .annotation .Autowired ;
37
31
import org .springframework .beans .factory .annotation .Qualifier ;
38
32
import org .springframework .beans .factory .annotation .Value ;
@@ -66,14 +60,6 @@ public CommandLineRunner commandLineRunner(
66
60
};
67
61
}
68
62
69
- // *REQUIRED*
70
- // Configurer components that registers informers to the informer-factory in the context.
71
- @ Bean
72
- public KubernetesInformerConfigurer kubernetesInformerConfigurer (
73
- ApiClient apiClient , SharedInformerFactory sharedInformerFactory ) {
74
- return new KubernetesInformerConfigurer (apiClient , sharedInformerFactory );
75
- }
76
-
77
63
// *REQUIRED*
78
64
// factorybean to crete controller
79
65
@ Bean ("node-printing-controller" )
@@ -82,30 +68,12 @@ public KubernetesControllerFactory kubernetesReconcilerConfigurer(
82
68
return new KubernetesControllerFactory (sharedInformerFactory , reconciler );
83
69
}
84
70
85
- // *OPTIONAL*
86
- // Injecting and customize your ApiClient, if not specified, fallbacks to {@link
87
- // io.kubernetes.client.util.ClientBuilder#standard}
88
- @ Bean
89
- public ApiClient myApiClient () throws IOException {
90
- ApiClient apiClient = ClientBuilder .standard ().build ();
91
- return apiClient .setHttpClient (
92
- apiClient .getHttpClient ().newBuilder ().readTimeout (Duration .ZERO ).build ());
93
- }
94
-
95
71
// *REQUIRED*
96
72
// Injecting your SharedInformerFactory class annotated `@KubernetesInformers`
97
73
@ Bean ("sharedInformerFactory" )
98
74
public SharedInformerFactory sharedInformerFactory () {
99
75
return new MySharedInformerFactory ();
100
76
}
101
-
102
- // *OPTIONAL*
103
- // Enabling prometheus scraping endpoint at `/actuator/prometheus`
104
- // SHOULD set `management.endpoints.web.exposure.include=prometheus` property.
105
- @ Bean
106
- public PrometheusScrapeEndpoint prometheusScrapeEndpoint () {
107
- return new PrometheusScrapeEndpoint ();
108
- }
109
77
}
110
78
111
79
@ KubernetesInformers ({ // Defining what resources is the informer-factory actually watching.
0 commit comments