Skip to content

Commit

Permalink
Add option to specify GKE release channel (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
iameskild authored May 4, 2023
1 parent fc18977 commit 6de26fa
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions nebari/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
DEFAULT_TRAEFIK_IMAGE_TAG = "2.9.1"

HIGHEST_SUPPORTED_K8S_VERSION = "1.24.13"
DEFAULT_GKE_RELEASE_CHANNEL = "UNSPECIFIED"

DEFAULT_NEBARI_DASK_VERSION = "2023.4.1"
DEFAULT_NEBARI_IMAGE_TAG = "2023.4.1"
Expand Down
1 change: 1 addition & 0 deletions nebari/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class GoogleCloudPlatformProvider(Base):
zone: typing.Optional[str] # No longer used
availability_zones: typing.Optional[typing.List[str]] # Genuinely optional
kubernetes_version: str
release_channel: typing.Optional[str]
node_groups: typing.Dict[str, NodeGroup]
terraform_overrides: typing.Any

Expand Down
9 changes: 8 additions & 1 deletion nebari/stages/input_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import tempfile
from urllib.parse import urlencode

from nebari.constants import DEFAULT_CONDA_STORE_IMAGE_TAG, DEFAULT_TRAEFIK_IMAGE_TAG
from nebari.constants import (
DEFAULT_CONDA_STORE_IMAGE_TAG,
DEFAULT_GKE_RELEASE_CHANNEL,
DEFAULT_TRAEFIK_IMAGE_TAG,
)


def stage_01_terraform_state(stage_outputs, config):
Expand Down Expand Up @@ -65,6 +69,9 @@ def stage_02_infrastructure(stage_outputs, config):
"region": config["google_cloud_platform"]["region"],
"project_id": config["google_cloud_platform"]["project"],
"kubernetes_version": config["google_cloud_platform"]["kubernetes_version"],
"release_channel": config.get("google_cloud_platform", {}).get(
"release_channel", DEFAULT_GKE_RELEASE_CHANNEL
),
"node_groups": [
{
"name": key,
Expand Down
1 change: 1 addition & 0 deletions nebari/template/stages/02-infrastructure/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ module "kubernetes" {
master_authorized_networks_config = var.master_authorized_networks_config
private_cluster_config = var.private_cluster_config
kubernetes_version = var.kubernetes_version
release_channel = var.release_channel
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "google_container_cluster" "main" {
}

release_channel {
channel = "UNSPECIFIED"
channel = var.release_channel
}

networking_mode = var.networking_mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ variable "kubernetes_version" {
type = string
}

variable "release_channel" {
description = "The cadence of GKE version upgrades"
type = string
}

variable "node_groups" {
description = "Node groups to add to GCP Kubernetes Cluster"
type = any
Expand Down
5 changes: 5 additions & 0 deletions nebari/template/stages/02-infrastructure/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ variable "kubernetes_version" {
type = string
}

variable "release_channel" {
description = "The cadence of GKE version upgrades"
type = string
}

variable "networking_mode" {
description = "Determines whether alias IPs or routes will be used for pod IPs in the cluster. Options are VPC_NATIVE or ROUTES."
type = string
Expand Down

0 comments on commit 6de26fa

Please sign in to comment.