Skip to content

Commit

Permalink
feat!: (IAC-1234) Update binaries & Terraform providers/modules (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpat authored Mar 1, 2024
1 parent c9e76ce commit b01f91a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright © 2021-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

ARG TERRAFORM_VERSION=1.7.0
ARG GCP_CLI_VERSION=460.0.0
ARG TERRAFORM_VERSION=1.7.3
ARG GCP_CLI_VERSION=464.0.0

FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
FROM google/cloud-sdk:$GCP_CLI_VERSION-alpine
ARG KUBECTL_VERSION=1.27.8
ARG KUBECTL_VERSION=1.27.10
ARG ENABLE_GKE_GCLOUD_AUTH_PLUGIN=True
ARG INSTALL_COMPONENTS=""

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Operational knowledge of

- Terraform or Docker
- #### Terraform
- [Terraform](https://www.terraform.io/downloads.html) - v1.7.0
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.27.8
- [Terraform](https://www.terraform.io/downloads.html) - v1.7.3
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.27.10
- [jq](https://stedolan.github.io/jq/) - v1.6
- [gcloud CLI](https://cloud.google.com/sdk/gcloud) - (optional - useful as an alternative to the Google Cloud Platform Portal) - v460.0.0
- [gcloud CLI](https://cloud.google.com/sdk/gcloud) - (optional - useful as an alternative to the Google Cloud Platform Portal) - v464.0.0
- [gke-gcloud-auth-plugin](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin) - (optional - only for provider based Kubernetes configuration files) - >= v1.26
- #### Docker
- [Docker](https://docs.docker.com/get-docker/)
Expand Down
1 change: 1 addition & 0 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The application of a Kubernetes version in GCP has some limitations when assigni
| enable_cluster_autoscaling | Per-cluster configuration of [Node Auto-Provisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning) with Cluster Autoscaler to automatically adjust the size of the cluster and create/delete node pools based on the current needs of the cluster's workload | bool | false | This is different from node autoscaling which is controlled by `max_node` & `min_node` in your [node pool definitions](#Nodepools)|
| cluster_autoscaling_max_cpu_cores | MAX number of cores in the cluster | number | 500 | |
| cluster_autoscaling_max_memory_gb | MAX number of gb of memory in the cluster | number | 10000 | |
| cluster_autoscaling_profile | Configuration options for the [Autoscaling profile](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#autoscaling_profiles) feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability when deciding to remove nodes from a cluster | string | "BALANCED" | |
| create_static_kubeconfig | Allows the user to create a provider / service account based kube config file | bool | true | A value of `false` will default to using the cloud providers mechanism for generating the kubeconfig file. A value of `true` will create a static kubeconfig which utilizes a `Service Account` and `Cluster Role Binding` to provide credentials. |
| regional | Create a regional GKE control plane | bool | true | If false a zonal GKE control plane is created. **WARNING: changing this after cluster creation is destructive** |
| create_jump_vm | Create bastion host | bool | true | |
Expand Down
18 changes: 10 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ data "google_container_engine_versions" "gke-version" {

module "gke" {
source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
version = "~> 29.0.0"
version = "~> 30.0.0"
project_id = var.project
name = "${var.prefix}-gke"
region = local.region
Expand Down Expand Up @@ -135,18 +135,20 @@ module "gke" {
max_memory_gb : var.cluster_autoscaling_max_memory_gb,
min_cpu_cores : 1,
min_memory_gb : 1,
gpu_resources = [],
auto_repair = (var.kubernetes_channel == "UNSPECIFIED") ? false : true,
auto_upgrade = (var.kubernetes_channel == "UNSPECIFIED") ? false : true
gpu_resources = [],
auto_repair = (var.kubernetes_channel == "UNSPECIFIED") ? false : true,
auto_upgrade = (var.kubernetes_channel == "UNSPECIFIED") ? false : true
autoscaling_profile = var.cluster_autoscaling_profile
} : {
enabled : false,
max_cpu_cores : 0,
max_memory_gb : 0,
min_cpu_cores : 0,
min_memory_gb : 0,
gpu_resources = [],
auto_repair = (var.kubernetes_channel == "UNSPECIFIED") ? false : true,
auto_upgrade = (var.kubernetes_channel == "UNSPECIFIED") ? false : true
gpu_resources = [],
auto_repair = (var.kubernetes_channel == "UNSPECIFIED") ? false : true,
auto_upgrade = (var.kubernetes_channel == "UNSPECIFIED") ? false : true
autoscaling_profile = var.cluster_autoscaling_profile
}

master_authorized_networks = concat([
Expand Down Expand Up @@ -239,7 +241,7 @@ resource "local_file" "kubeconfig" {
# Module Registry - https://registry.terraform.io/modules/GoogleCloudPlatform/sql-db/google/12.0.0/submodules/postgresql
module "postgresql" {
source = "GoogleCloudPlatform/sql-db/google//modules/postgresql"
version = "~> 18.2.0"
version = "~> 19.0.0"
project_id = var.project

for_each = local.postgres_servers != null ? length(local.postgres_servers) != 0 ? local.postgres_servers : {} : {}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ variable "cluster_autoscaling_max_memory_gb" {
default = 10000
}

variable "cluster_autoscaling_profile" {
description = "Configuration options for the Autoscaling profile feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability when deciding to remove nodes from a cluster"
type = string
default = "BALANCED"
}

# PostgreSQL

# Defaults
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "5.12.0"
version = "5.16.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "5.12.0"
version = "5.16.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down

0 comments on commit b01f91a

Please sign in to comment.