@@ -24,11 +24,17 @@ import (
24
24
25
25
// ControllerConfigurationSpec defines the desired state of GenericControllerConfiguration
26
26
type ControllerConfigurationSpec struct {
27
- // SyncPeriod returns the SyncPeriod
27
+ // SyncPeriod determines the minimum frequency at which watched resources are
28
+ // reconciled. A lower period will correct entropy more quickly, but reduce
29
+ // responsiveness to change if there are many watched resources. Change this
30
+ // value only if you know what you are doing. Defaults to 10 hours if unset.
31
+ // there will a 10 percent jitter between the SyncPeriod of all controllers
32
+ // so that all controllers will not send list requests simultaneously.
28
33
// +optional
29
34
SyncPeriod * metav1.Duration `json:"syncPeriod,omitempty"`
30
35
31
- // LeaderElection returns the LeaderElection config
36
+ // LeaderElection is the LeaderElection config to be used when configuring
37
+ // the manager.Manager leader election
32
38
// +optional
33
39
LeaderElection * configv1alpha1.LeaderElectionConfiguration `json:"leaderElection,omitempty"`
34
40
@@ -41,45 +47,66 @@ type ControllerConfigurationSpec struct {
41
47
// +optional
42
48
CacheNamespace string `json:"cacheNamespace,omitempty"`
43
49
44
- // MetricsBindAddress returns the bind address for the metrics server
50
+ // GracefulShutdownTimeout is the duration given to runnable to stop before the manager actually returns on stop.
51
+ // To disable graceful shutdown, set to time.Duration(0)
52
+ // To use graceful shutdown without timeout, set to a negative duration, e.G. time.Duration(-1)
53
+ // The graceful shutdown is skipped for safety reasons in case the leadere election lease is lost.
54
+ GracefulShutdownTimeout * metav1.Duration `json:"gracefulShutDown,omitempty"`
55
+
56
+ // Metrics contains thw controller metrics configuration
45
57
// +optional
46
- MetricsBindAddress string `json:"metricsBindAddress ,omitempty"`
58
+ Metrics ControllerMetrics `json:"metrics ,omitempty"`
47
59
48
- // Health contains the controller health information
60
+ // Health contains the controller health configuration
49
61
// +optional
50
62
Health ControllerHealth `json:"health,omitempty"`
51
63
52
- // Webhook contains the controllers webhook information
64
+ // Webhook contains the controllers webhook configuration
53
65
// +optional
54
66
Webhook ControllerWebhook `json:"webhook,omitempty"`
55
67
}
56
68
69
+ // ControllerMetrics defines the metrics configs
70
+ type ControllerMetrics struct {
71
+ // BindAddress is the TCP address that the controller should bind to
72
+ // for serving prometheus metrics.
73
+ // It can be set to "0" to disable the metrics serving.
74
+ // +optional
75
+ BindAddress string `json:"BindAddress,omitempty"`
76
+ }
77
+
57
78
// ControllerHealth defines the health configs
58
79
type ControllerHealth struct {
59
- // HealthProbeBindAddress returns the bind address for the health probe
80
+ // HealthProbeBindAddress is the TCP address that the controller should bind to
81
+ // for serving health probes
60
82
// +optional
61
83
HealthProbeBindAddress string `json:"healthProbeBindAddress,omitempty"`
62
84
63
- // ReadinessEndpointName returns the readiness endpoint name
85
+ // ReadinessEndpointName, defaults to "readyz"
64
86
// +optional
65
87
ReadinessEndpointName string `json:"readinessEndpointName,omitempty"`
66
88
67
- // LivenessEndpointName returns the liveness endpoint name
89
+ // LivenessEndpointName, defaults to "healthz"
68
90
// +optional
69
91
LivenessEndpointName string `json:"livenessEndpointName,omitempty"`
70
92
}
71
93
72
94
// ControllerWebhook defines the webhook server for the controller
73
95
type ControllerWebhook struct {
74
- // Port returns the Port for the server
96
+ // Port is the port that the webhook server serves at.
97
+ // It is used to set webhook.Server.Port.
75
98
// +optional
76
99
Port * int `json:"port,omitempty"`
77
100
78
- // Host returns the Host for the server
101
+ // Host is the hostname that the webhook server binds to.
102
+ // It is used to set webhook.Server.Host.
79
103
// +optional
80
104
Host string `json:"host,omitempty"`
81
105
82
- // CertDir returns the CertDir
106
+ // CertDir is the directory that contains the server key and certificate.
107
+ // if not set, webhook server would look up the server key and certificate in
108
+ // {TempDir}/k8s-webhook-server/serving-certs. The server key and certificate
109
+ // must be named tls.key and tls.crt, respectively.
83
110
// +optional
84
111
CertDir string `json:"certDir,omitempty"`
85
112
}
0 commit comments