|
| 1 | +/* |
| 2 | +The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package config |
| 18 | + |
| 19 | +import ( |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | + |
| 22 | + configv1alpha1 "k8s.io/component-base/config/v1alpha1" |
| 23 | +) |
| 24 | + |
| 25 | +// ControllerConfiguration defines the desired state of GenericControllerConfiguration |
| 26 | +type ControllerConfiguration struct { |
| 27 | + // SyncPeriod returns the SyncPeriod |
| 28 | + // +optional |
| 29 | + SyncPeriod *metav1.Duration `json:"syncPeriod,omitempty"` |
| 30 | + |
| 31 | + // LeaderElection returns the LeaderElection config |
| 32 | + // +optional |
| 33 | + LeaderElection configv1alpha1.LeaderElectionConfiguration `json:"leaderElection,omitempty"` |
| 34 | + |
| 35 | + // Namespace returns the namespace for the controller |
| 36 | + // +optional |
| 37 | + Namespace string `json:"namespace,omitempty"` |
| 38 | + |
| 39 | + // MetricsBindAddress returns the bind address for the metrics server |
| 40 | + // +optional |
| 41 | + MetricsBindAddress string `json:"metricsBindAddress,omitempty"` |
| 42 | + |
| 43 | + // MetricsBindAddress returns the bind address for the metrics server |
| 44 | + // +optional |
| 45 | + Health ControllerHealth `json:"health,omitempty"` |
| 46 | + |
| 47 | + // Port returns the Port for the server |
| 48 | + // +optional |
| 49 | + Port *int `json:"port,omitempty"` |
| 50 | + |
| 51 | + // Host returns the Host for the server |
| 52 | + // +optional |
| 53 | + Host string `json:"host,omitempty"` |
| 54 | + |
| 55 | + // CertDir returns the CertDir |
| 56 | + // +optional |
| 57 | + CertDir string `json:"certDir,omitempty"` |
| 58 | +} |
| 59 | + |
| 60 | +// ControllerHealth defines the health configs |
| 61 | +type ControllerHealth struct { |
| 62 | + // HealthProbeBindAddress returns the bind address for the health probe |
| 63 | + // +optional |
| 64 | + HealthProbeBindAddress string `json:"healthProbeBindAddress,omitempty"` |
| 65 | + |
| 66 | + // ReadinessEndpointName returns the readiness endpoint name |
| 67 | + // +optional |
| 68 | + ReadinessEndpointName string `json:"readinessEndpointName,omitempty"` |
| 69 | + |
| 70 | + // LivenessEndpointName returns the liveness endpoint name |
| 71 | + // +optional |
| 72 | + LivenessEndpointName string `json:"livenessEndpointName,omitempty"` |
| 73 | +} |
| 74 | + |
| 75 | +// +kubebuilder:object:root=true |
| 76 | + |
| 77 | +// ControllerRuntimeConfiguration is the Schema for the GenericControllerConfigurations API |
| 78 | +type ControllerRuntimeConfiguration struct { |
| 79 | + metav1.TypeMeta `json:",inline"` |
| 80 | + |
| 81 | + // ControllerConfiguration returns the contfigurations for controllers |
| 82 | + ControllerConfiguration `json:",inline"` |
| 83 | +} |
0 commit comments