A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/kubernetes-engine/docs/how-to/extended-duration-pods below:

Extend the run time of Autopilot Pods | Google Kubernetes Engine (GKE)

Extend the run time of Autopilot Pods

Stay organized with collections Save and categorize content based on your preferences.

This page shows you how to request extended run times for Pods before they're evicted by Google Kubernetes Engine (GKE).

About GKE-initiated Pod eviction

Pod evictions are a normal part of running workloads on Kubernetes. GKE evicts workloads during scheduled events, such as automatic node upgrades and autoscaling scale-downs, to ensure that your nodes are up-to-date and optimized for efficient resource usage. By default, GKE sends a termination signal to the container as soon as the event occurs, after which the container has a grace period to terminate before Kubernetes evicts the Pod. For automatic node upgrades, the grace period can be up to one hour. For scale-down events, the grace period can be up to 10 minutes.

Kubernetes has built-in features that containers can use to gracefully handle evictions, such as PodDisruptionBudgets and graceful termination periods. However, some workloads, such as batch queues or multiplayer game servers, need to run for a longer period of time before being evicted. The default grace period that GKE grants during GKE-initiated evictions might not be enough for these workloads. In these situations, you can tell Autopilot to avoid evicting specific workloads for up to 7 days.

Use cases

Some situations in which you might want to tell GKE to avoid evicting workloads include the following:

Pricing

You can request extended run times for your Pods at no additional charge. However, consider the following behavioral changes that might impact your pricing:

For pricing details, see Autopilot pricing.

Before you begin

Before you start, make sure that you have performed the following tasks:

Limitations Request extended run time

To request extended run time for a Pod, set the Kubernetes cluster-autoscaler.kubernetes.io/safe-to-evict annotation to false in the Pod specification.

  1. Save the following manifest as extended-deployment.yaml:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: extended-pods
      labels:
        duration: extended
    spec:
      selector:
        matchLabels:
          duration: extended
      template:
        metadata:
          annotations:
            cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
          labels:
            duration: extended
        spec:
          containers:
          - name: example-container
            image: registry.k8s.io/pause
            resources:
              requests:
                cpu: 200m
    
  2. Create the Deployment:

    kubectl create -f extended-deployment.yaml
    

The Pods continue to run for at least 7 days before a scale-down or a node auto-upgrade can occur.

Considerations and recommendations

When you use this functionality, consider the following:

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-12 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-12 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4