@@ -17,6 +17,7 @@ limitations under the License.
17
17
package v1beta2
18
18
19
19
import (
20
+ corev1 "k8s.io/api/core/v1"
20
21
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
22
22
23
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -45,37 +46,64 @@ type RosaMachinePoolSpec struct {
45
46
// +optional
46
47
AvailabilityZone string `json:"availabilityZone,omitempty"`
47
48
49
+ // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="subnet is immutable"
50
+ //
51
+ // +immutable
48
52
// +optional
49
53
Subnet string `json:"subnet,omitempty"`
50
54
51
55
// Labels specifies labels for the Kubernetes node objects
52
56
// +optional
53
57
Labels map [string ]string `json:"labels,omitempty"`
54
58
59
+ // Taints specifies the taints to apply to the nodes of the machine pool
60
+ // +optional
61
+ Taints []RosaTaint `json:"taints,omitempty"`
62
+
55
63
// AutoRepair specifies whether health checks should be enabled for machines
56
64
// in the NodePool. The default is false.
57
65
// +optional
58
66
// +kubebuilder:default=false
59
67
AutoRepair bool `json:"autoRepair,omitempty"`
60
68
69
+ // +kubebuilder:validation:Required
70
+ //
61
71
// InstanceType specifies the AWS instance type
62
- InstanceType string `json:"instanceType,omitempty "`
72
+ InstanceType string `json:"instanceType"`
63
73
64
74
// Autoscaling specifies auto scaling behaviour for this MachinePool.
65
75
// required if Replicas is not configured
66
76
// +optional
67
77
Autoscaling * RosaMachinePoolAutoScaling `json:"autoscaling,omitempty"`
68
78
69
- // TODO(alberto): Enable and propagate this API input .
70
- // Taints []*Taint `json:"taints,omitempty"`
71
- // TuningConfigs []string `json:"tuningConfigs,omitempty"`
72
- // Version *Version `json:"version ,omitempty"`
79
+ // TuningConfigs specifies the names of the tuning configs to be applied to this MachinePool .
80
+ // Tuning configs must already exist.
81
+ // +optional
82
+ TuningConfigs [] string `json:"tuningConfigs ,omitempty"`
73
83
74
84
// ProviderIDList contain a ProviderID for each machine instance that's currently managed by this machine pool.
75
85
// +optional
76
86
ProviderIDList []string `json:"providerIDList,omitempty"`
77
87
}
78
88
89
+ type RosaTaint struct {
90
+ // +kubebuilder:validation:Required
91
+ //
92
+ // The taint key to be applied to a node.
93
+ Key string `json:"key"`
94
+ // +kubebuilder:validation:Pattern:=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$`
95
+ //
96
+ // The taint value corresponding to the taint key.
97
+ // +optional
98
+ Value string `json:"value,omitempty"`
99
+ // +kubebuilder:validation:Required
100
+ // +kubebuilder:validation:Enum=NoSchedule;PreferNoSchedule;NoExecute
101
+ //
102
+ // The effect of the taint on pods that do not tolerate the taint.
103
+ // Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
104
+ Effect corev1.TaintEffect `json:"effect"`
105
+ }
106
+
79
107
// RosaMachinePoolAutoScaling specifies scaling options.
80
108
type RosaMachinePoolAutoScaling struct {
81
109
// +kubebuilder:validation:Minimum=1
0 commit comments