Class AgentPoolUpgradeSettings

java.lang.Object
com.azure.resourcemanager.containerservice.models.AgentPoolUpgradeSettings
All Implemented Interfaces:
com.azure.json.JsonSerializable<AgentPoolUpgradeSettings>

public final class AgentPoolUpgradeSettings extends Object implements com.azure.json.JsonSerializable<AgentPoolUpgradeSettings>
Settings for upgrading an agentpool.
  • Constructor Details

    • AgentPoolUpgradeSettings

      public AgentPoolUpgradeSettings()
      Creates an instance of AgentPoolUpgradeSettings class.
  • Method Details

    • maxSurge

      public String maxSurge()
      Get the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster.
      Returns:
      the maxSurge value.
    • withMaxSurge

      public AgentPoolUpgradeSettings withMaxSurge(String maxSurge)
      Set the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 10%. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster.
      Parameters:
      maxSurge - the maxSurge value to set.
      Returns:
      the AgentPoolUpgradeSettings object itself.
    • maxUnavailable

      public String maxUnavailable()
      Get the maxUnavailable property: The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 0. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster.
      Returns:
      the maxUnavailable value.
    • withMaxUnavailable

      public AgentPoolUpgradeSettings withMaxUnavailable(String maxUnavailable)
      Set the maxUnavailable property: The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 0. For more information, including best practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster.
      Parameters:
      maxUnavailable - the maxUnavailable value to set.
      Returns:
      the AgentPoolUpgradeSettings object itself.
    • drainTimeoutInMinutes

      public Integer drainTimeoutInMinutes()
      Get the drainTimeoutInMinutes property: The drain timeout for a node. The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.
      Returns:
      the drainTimeoutInMinutes value.
    • withDrainTimeoutInMinutes

      public AgentPoolUpgradeSettings withDrainTimeoutInMinutes(Integer drainTimeoutInMinutes)
      Set the drainTimeoutInMinutes property: The drain timeout for a node. The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.
      Parameters:
      drainTimeoutInMinutes - the drainTimeoutInMinutes value to set.
      Returns:
      the AgentPoolUpgradeSettings object itself.
    • nodeSoakDurationInMinutes

      public Integer nodeSoakDurationInMinutes()
      Get the nodeSoakDurationInMinutes property: The soak duration for a node. The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.
      Returns:
      the nodeSoakDurationInMinutes value.
    • withNodeSoakDurationInMinutes

      public AgentPoolUpgradeSettings withNodeSoakDurationInMinutes(Integer nodeSoakDurationInMinutes)
      Set the nodeSoakDurationInMinutes property: The soak duration for a node. The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.
      Parameters:
      nodeSoakDurationInMinutes - the nodeSoakDurationInMinutes value to set.
      Returns:
      the AgentPoolUpgradeSettings object itself.
    • undrainableNodeBehavior

      public UndrainableNodeBehavior undrainableNodeBehavior()
      Get the undrainableNodeBehavior property: Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.
      Returns:
      the undrainableNodeBehavior value.
    • withUndrainableNodeBehavior

      public AgentPoolUpgradeSettings withUndrainableNodeBehavior(UndrainableNodeBehavior undrainableNodeBehavior)
      Set the undrainableNodeBehavior property: Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.
      Parameters:
      undrainableNodeBehavior - the undrainableNodeBehavior value to set.
      Returns:
      the AgentPoolUpgradeSettings object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AgentPoolUpgradeSettings>
      Throws:
      IOException
    • fromJson

      public static AgentPoolUpgradeSettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AgentPoolUpgradeSettings from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AgentPoolUpgradeSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the AgentPoolUpgradeSettings.