@@ -17,6 +17,7 @@ limitations under the License.
1717package v1beta2
1818
1919import (
20+ corev1 "k8s.io/api/core/v1"
2021 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
2223 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -45,37 +46,64 @@ type RosaMachinePoolSpec struct {
4546 // +optional
4647 AvailabilityZone string `json:"availabilityZone,omitempty"`
4748
49+ // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="subnet is immutable"
50+ //
51+ // +immutable
4852 // +optional
4953 Subnet string `json:"subnet,omitempty"`
5054
5155 // Labels specifies labels for the Kubernetes node objects
5256 // +optional
5357 Labels map [string ]string `json:"labels,omitempty"`
5458
59+ // Taints specifies the taints to apply to the nodes of the machine pool
60+ // +optional
61+ Taints []RosaTaint `json:"taints,omitempty"`
62+
5563 // AutoRepair specifies whether health checks should be enabled for machines
5664 // in the NodePool. The default is false.
5765 // +optional
5866 // +kubebuilder:default=false
5967 AutoRepair bool `json:"autoRepair,omitempty"`
6068
69+ // +kubebuilder:validation:Required
70+ //
6171 // InstanceType specifies the AWS instance type
62- InstanceType string `json:"instanceType,omitempty "`
72+ InstanceType string `json:"instanceType"`
6373
6474 // Autoscaling specifies auto scaling behaviour for this MachinePool.
6575 // required if Replicas is not configured
6676 // +optional
6777 Autoscaling * RosaMachinePoolAutoScaling `json:"autoscaling,omitempty"`
6878
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"`
7383
7484 // ProviderIDList contain a ProviderID for each machine instance that's currently managed by this machine pool.
7585 // +optional
7686 ProviderIDList []string `json:"providerIDList,omitempty"`
7787}
7888
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+
79107// RosaMachinePoolAutoScaling specifies scaling options.
80108type RosaMachinePoolAutoScaling struct {
81109 // +kubebuilder:validation:Minimum=1
0 commit comments