<commit_before>data "google_client_config" "google-provider-configuration" {
}

resource "google_project_service" "kubernetes-engine-apis" {
  project = var.google_project_id
  service = "container.googleapis.com"

  disable_dependent_services = true
  disable_on_destroy         = true
}

data "google_container_engine_versions" "gke-version" {
  project        = var.google_project_id
  location       = var.google_region
  version_prefix = "1.17."
}

resource "google_container_cluster" "configuration-gke-cluster" {
  name         = "${var.google_project_id}-configuration"
  node_version = data.google_container_engine_versions.gke-version.latest_node_version
  project      = var.google_project_id
  provider     = google-beta
  location     = var.google_region

  # Create the smallest possible default node pool and then remove it
  # because we want to use a managed node pool
  remove_default_node_pool = true
  initial_node_count       = 1

  enable_intranode_visibility = true
  network                     = var.google_compute_network_vpc_name
  subnetwork                  = var.google_compute_subnetwork_vpc_name

  ip_allocation_policy {

  }

  master_auth {
    client_certificate_config {
      issue_client_certificate = false
    }
  }

  networking_mode = "VPC_NATIVE"
}

resource "google_container_node_pool" "configuration-gke-cluster-node-pool" {
  name       = "${google_container_cluster.configuration-gke-cluster.name}-node-pool"
  location   = var.google_region
  cluster    = google_container_cluster.configuration-gke-cluster.name
  node_count = var.configuration_gke_cluster_node_pool_size
  project    = var.google_project_id

  management {
    auto_repair  = true
    auto_upgrade = true
  }

  node_config {
    oauth_scopes = [
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
    ]

    labels = {
      env = var.google_project_id
    }

    machine_type = "n1-standard-1"
    tags         = ["gke-node", "${var.google_project_id}-gke"]

    metadata = {
      disable-legacy-endpoints = "true"
    }
  }
}

output "kubernetes_cluster_name" {
  value       = google_container_cluster.configuration-gke-cluster.name<commit_msg>Upgrade GKE node pool and master version to 1.17.9-gke.1504<commit_after>data "google_client_config" "google-provider-configuration" {
}

resource "google_project_service" "kubernetes-engine-apis" {
  project = var.google_project_id
  service = "container.googleapis.com"

  disable_dependent_services = true
  disable_on_destroy         = true
}

data "google_container_engine_versions" "gke-version" {
  project        = var.google_project_id
  location       = var.google_region
  version_prefix = "1.17.9-gke.1504"
}

resource "google_container_cluster" "configuration-gke-cluster" {
  min_master_version = data.google_container_engine_versions.gke-version.latest_node_version
  name               = "${var.google_project_id}-configuration"
  project            = var.google_project_id
  provider           = google-beta
  location           = var.google_region

  # Create the smallest possible default node pool and then remove it
  # because we want to use a managed node pool
  remove_default_node_pool = true
  initial_node_count       = 1

  enable_intranode_visibility = true
  network                     = var.google_compute_network_vpc_name
  subnetwork                  = var.google_compute_subnetwork_vpc_name

  ip_allocation_policy {

  }

  master_auth {
    client_certificate_config {
      issue_client_certificate = false
    }
  }

  networking_mode = "VPC_NATIVE"

  release_channel {
    channel = "REGULAR"
  }
}

resource "google_container_node_pool" "configuration-gke-cluster-node-pool" {
  name       = "${google_container_cluster.configuration-gke-cluster.name}-node-pool"
  location   = var.google_region
  cluster    = google_container_cluster.configuration-gke-cluster.name
  node_count = var.configuration_gke_cluster_node_pool_size
  project    = var.google_project_id
  version    = data.google_container_engine_versions.gke-version.latest_node_version

  management {
    auto_repair  = true
    auto_upgrade = false
  }

  node_config {
    oauth_scopes = [
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
    ]

    labels = {
      env = var.google_project_id
    }

    machine_type = "n1-standard-1"
    tags         = ["gke-node", "${var.google_project_id}-gke"]

    metadata = {
      disable-legacy-endpoints = "true"
    }
  }
}

output "kubernetes_cluster_name" {
  value       = google_container_cluster.configuration-gke-cluster.name
{'fraction_non_alphanumeric': 0.08613670452110564, 'fraction_numerical': 0.005356760231412042, 'mean_word_length': 3.251366120218579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785824', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1436, 'n_words': 232}