// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // namespace k8s.Models { using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// /// Node affinity is a group of node affinity scheduling rules. /// public partial class V1NodeAffinity { /// /// Initializes a new instance of the V1NodeAffinity class. /// public V1NodeAffinity() { CustomInit(); } /// /// Initializes a new instance of the V1NodeAffinity class. /// /// The /// scheduler will prefer to schedule pods to nodes that satisfy the /// affinity expressions specified by this field, but it may choose a /// node that violates one or more of the expressions. The node that is /// most preferred is the one with the greatest sum of weights, i.e. /// for each node that meets all of the scheduling requirements /// (resource request, requiredDuringScheduling affinity expressions, /// etc.), compute a sum by iterating through the elements of this /// field and adding "weight" to the sum if the node matches the /// corresponding matchExpressions; the node(s) with the highest sum /// are the most preferred. /// If the /// affinity requirements specified by this field are not met at /// scheduling time, the pod will not be scheduled onto the node. If /// the affinity requirements specified by this field cease to be met /// at some point during pod execution (e.g. due to an update), the /// system may or may not try to eventually evict the pod from its /// node. public V1NodeAffinity(IList preferredDuringSchedulingIgnoredDuringExecution = default(IList), V1NodeSelector requiredDuringSchedulingIgnoredDuringExecution = default(V1NodeSelector)) { PreferredDuringSchedulingIgnoredDuringExecution = preferredDuringSchedulingIgnoredDuringExecution; RequiredDuringSchedulingIgnoredDuringExecution = requiredDuringSchedulingIgnoredDuringExecution; CustomInit(); } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); /// /// Gets or sets the scheduler will prefer to schedule pods to nodes /// that satisfy the affinity expressions specified by this field, but /// it may choose a node that violates one or more of the expressions. /// The node that is most preferred is the one with the greatest sum of /// weights, i.e. for each node that meets all of the scheduling /// requirements (resource request, requiredDuringScheduling affinity /// expressions, etc.), compute a sum by iterating through the elements /// of this field and adding "weight" to the sum if the node matches /// the corresponding matchExpressions; the node(s) with the highest /// sum are the most preferred. /// [JsonProperty(PropertyName = "preferredDuringSchedulingIgnoredDuringExecution")] public IList PreferredDuringSchedulingIgnoredDuringExecution { get; set; } /// /// Gets or sets if the affinity requirements specified by this field /// are not met at scheduling time, the pod will not be scheduled onto /// the node. If the affinity requirements specified by this field /// cease to be met at some point during pod execution (e.g. due to an /// update), the system may or may not try to eventually evict the pod /// from its node. /// [JsonProperty(PropertyName = "requiredDuringSchedulingIgnoredDuringExecution")] public V1NodeSelector RequiredDuringSchedulingIgnoredDuringExecution { get; set; } /// /// Validate the object. /// /// /// Thrown if validation fails /// public virtual void Validate() { if (PreferredDuringSchedulingIgnoredDuringExecution != null) { foreach (var element in PreferredDuringSchedulingIgnoredDuringExecution) { if (element != null) { element.Validate(); } } } if (RequiredDuringSchedulingIgnoredDuringExecution != null) { RequiredDuringSchedulingIgnoredDuringExecution.Validate(); } } } }