Review GKE node image selection

Choose node images that meet workload OS requirements and support policies.

Description

On GKE Standard, config.image_type selects the node operating system. Run Windows containers on a Windows pool. COS_CONTAINERD suits Linux services that need no extra host packages.

Potential impact

An unsupported image can miss security updates. Containers built for a different OS may not start.

Remediation

Choose an image supported by your GKE version and keep the nodes updated. When changing operating systems, create a new pool with a different name and sufficient capacity. Test that workloads built for the new OS run there before migrating them.

Examples

The two tasks are alternative Windows and Linux configurations for my-pool. A Windows pool requires a VPC-native cluster with a Linux pool for system components. Supply the cluster result object and project, and replace /tmp/auth.pem with the path to a service account JSON file.

Before

yaml
- name: 노드 풀 생성
  google.cloud.gcp_container_node_pool:
    name: my-pool
    initial_node_count: 4
    cluster: "{{ cluster }}"
    location: us-central1-a
    project: test_project
    auth_kind: serviceaccount
    service_account_file: /tmp/auth.pem
    state: present
    config:
      image_type: WINDOWS_LTSC_CONTAINERD

After

yaml
- name: 노드 풀 생성
  google.cloud.gcp_container_node_pool:
    name: my-pool
    initial_node_count: 4
    cluster: "{{ cluster }}"
    location: us-central1-a
    project: test_project
    auth_kind: serviceaccount
    service_account_file: /tmp/auth.pem
    state: present
    config:
      image_type: COS_CONTAINERD

References