Description
New GKE Standard pools have auto-repair on by default, and Autopilot always uses it. To enable it explicitly in an Ansible creation task, set management.auto_repair: true.
Potential impact
Auto-repair can replace a node after repeated health-check failures. Workloads need to be able to run on other nodes during the repair.
Remediation
For an existing Standard pool, use gcloud container node-pools update with --enable-autorepair. Check the pool setting and node health in GKE. Keep alerts, a manual recovery procedure and backups for failures that persist. Use node upgrades for security patches.
Examples
Supply the prepared cluster resource, the project and the path to a protected service-account JSON file.
Before
- name: create a node pool
google.cloud.gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_service_account_file }}"
state: present
management:
auto_repair: no
- name: create a node pool3
google.cloud.gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_service_account_file }}"
state: present
The first task disables auto-repair on my-pool. The second example for the same pool omits management, so check its actual setting.
After
- name: create a node pool
google.cloud.gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_service_account_file }}"
state: present
management:
auto_repair: true