Skip to content

Commit

Permalink
fix(gke-cluster): update gke-cluster config
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <[email protected]>
Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
verbotenj committed Dec 19, 2024
1 parent ac2db83 commit 9af42a1
Show file tree
Hide file tree
Showing 13 changed files with 361 additions and 154 deletions.
88 changes: 70 additions & 18 deletions common/defaults-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,47 @@ vpc_cidr: "10.6.0.0/16"
dmtr_namespace: dmtr-system
dmtr_context: k3d-dmtr-cluster
managed_node_groups:
# GKE
- name: gke-system-az1
labels:
gke-managed-components: "true"
instance_type: n4-standard-2
min_size: 1
max_size: 1
desired_capacity: 1
disk_size_gb: 40
taints:
- key: components.gke.io/gke-managed-components
value: "true"
effect: NO_SCHEDULE
availability_zones: us-central1-a

- name: gke-system-az2
labels:
gke-managed-components: "true"
instance_type: n4-standard-2
min_size: 1
max_size: 1
desired_capacity: 1
disk_size_gb: 40
taints:
- key: components.gke.io/gke-managed-components
value: "true"
effect: NO_SCHEDULE
availability_zones: us-central1-b

# Consistent
- name: co-ad-x86-az1
labels:
demeter.run/availability-sla: consistent
demeter.run/compute-profile: admin
demeter.run/compute-arch: x86
demeter.run/availability-zone: az1
instance_type: n2-standard-2
instance_type: n4-standard-2
min_size: 1
max_size: 2
desired_capacity: 1
disk_size_gb: 40
disk_type: pd-standard
taints:
- key: demeter.run/availability-sla
value: "consistent"
Expand All @@ -39,12 +67,11 @@ managed_node_groups:
demeter.run/compute-profile: admin
demeter.run/compute-arch: x86
demeter.run/availability-zone: az2
instance_type: n2-standard-2
instance_type: n4-standard-2
min_size: 0
max_size: 1
desired_capacity: 0
disk_size_gb: 40
disk_type: pd-standard
taints:
- key: demeter.run/availability-sla
value: "consistent"
Expand All @@ -63,7 +90,7 @@ managed_node_groups:
demeter.run/compute-profile: general-purpose
demeter.run/compute-arch: x86
demeter.run/availability-zone: az1
instance_type: n2-standard-8
instance_type: n4-standard-8
min_size: 0
max_size: 1
desired_capacity: 0
Expand All @@ -86,7 +113,7 @@ managed_node_groups:
demeter.run/compute-profile: general-purpose
demeter.run/compute-arch: x86
demeter.run/availability-zone: az1
instance_type: n2-standard-8
instance_type: n4-standard-8
min_size: 0
max_size: 1
desired_capacity: 0
Expand All @@ -109,7 +136,7 @@ managed_node_groups:
demeter.run/compute-profile: general-purpose
demeter.run/compute-arch: arm64
demeter.run/availability-zone: az1
instance_type: t2a-standard-8
instance_type: c4a-standard-8
min_size: 0
max_size: 1
desired_capacity: 0
Expand All @@ -132,7 +159,7 @@ managed_node_groups:
demeter.run/compute-profile: mem-intensive
demeter.run/compute-arch: x86
demeter.run/availability-zone: az1
instance_type: n2-highmem-8
instance_type: n4-highmem-8
min_size: 0
max_size: 1
desired_capacity: 0
Expand All @@ -155,7 +182,7 @@ managed_node_groups:
demeter.run/compute-profile: mem-intensive
demeter.run/compute-arch: arm64
demeter.run/availability-zone: az1
instance_type: t2a-standard-16
instance_type: c4a-highmem-8
min_size: 0
max_size: 1
desired_capacity: 0
Expand All @@ -172,50 +199,75 @@ managed_node_groups:
effect: NO_SCHEDULE
availability_zones: us-central1-a

# Best Effort
- name: be-gp-x86-az1
- name: co-mem-arm64-az2
labels:
demeter.run/availability-sla: consistent
demeter.run/compute-profile: mem-intensive
demeter.run/compute-arch: arm64
demeter.run/availability-zone: az2
instance_type: c4a-highmem-8
min_size: 0
max_size: 1
desired_capacity: 0
disk_size_gb: 100
taints:
- key: demeter.run/availability-sla
value: "consistent"
effect: NO_SCHEDULE
- key: demeter.run/compute-profile
value: "mem-intensive"
effect: NO_SCHEDULE
- key: demeter.run/compute-arch
value: "arm64"
effect: NO_SCHEDULE
availability_zones: us-central1-b

# Disk Intensive
- name: be-di-x86-az1
labels:
demeter.run/availability-sla: best-effort
demeter.run/compute-profile: general-purpose
demeter.run/compute-arch: x86
demeter.run/availability-zone: az1
instance_type: n2-standard-8
instance_type: n2-standard-4
min_size: 0
max_size: 1
desired_capacity: 1
disk_size_gb: 100
disk_type: pd-ssd
spot: true
taints:
- key: demeter.run/availability-sla
value: "best-effort"
value: "consistent"
effect: NO_SCHEDULE
- key: demeter.run/compute-profile
value: "general-purpose"
value: "disk-intensive"
effect: NO_SCHEDULE
- key: demeter.run/compute-arch
value: "x86"
effect: NO_SCHEDULE
availability_zones: us-central1-a

- name: be-gp-arm64-az1
- name: be-di-arm64-az1
labels:
demeter.run/availability-sla: best-effort
demeter.run/compute-profile: general-purpose
demeter.run/compute-arch: arm64
demeter.run/availability-zone: az1
# Google supports one instance type per node group
instance_type: t2a-standard-8
instance_type: t2a-standard-4
min_size: 0
max_size: 1
desired_capacity: 1
disk_size_gb: 100
disk_type: pd-ssd
spot: true
taints:
- key: demeter.run/availability-sla
value: "best-effort"
value: "consistent"
effect: NO_SCHEDULE
- key: demeter.run/compute-profile
value: "general-purpose"
value: "disk-intensive"
effect: NO_SCHEDULE
- key: demeter.run/compute-arch
value: "arm64"
Expand Down
8 changes: 4 additions & 4 deletions modules/common/cert-manager/stage2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ resource "helm_release" "cert-manager" {

set {
name = "tolerations[2].value"
value = "admin"
value = "consistent"
}

set {
Expand Down Expand Up @@ -113,7 +113,7 @@ resource "helm_release" "cert-manager" {

set {
name = "webhook.tolerations[2].value"
value = "admin"
value = "consistent"
}

set {
Expand Down Expand Up @@ -163,7 +163,7 @@ resource "helm_release" "cert-manager" {

set {
name = "cainjector.tolerations[2].value"
value = "admin"
value = "consistent"
}

set {
Expand Down Expand Up @@ -213,7 +213,7 @@ resource "helm_release" "cert-manager" {

set {
name = "startupapicheck.tolerations[2].value"
value = "admin"
value = "consistent"
}

# set {
Expand Down
45 changes: 45 additions & 0 deletions modules/gcp/storage-classes/stage1/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,48 @@ resource "kubernetes_storage_class" "gp" {
"type" = "pd-balanced"
}
}

resource "kubernetes_storage_class" "fast" {
metadata {
name = "fast"
}

allow_volume_expansion = true
storage_provisioner = "pd.csi.storage.gke.io"
reclaim_policy = "Delete"
volume_binding_mode = "Immediate"

parameters = {
"type" = "pd-balanced"
}
}

resource "kubernetes_storage_class" "hyperdisk-balanced" {
metadata {
name = "hyperdisk-balanced"
}

allow_volume_expansion = true
storage_provisioner = "pd.csi.storage.gke.io"
reclaim_policy = "Delete"
volume_binding_mode = "WaitForFirstConsumer"

parameters = {
"type" = "hyperdisk-balanced"
}
}

resource "kubernetes_storage_class" "hyperdisk-balanced-immediate" {
metadata {
name = "hyperdisk-balanced-immediate"
}

allow_volume_expansion = true
storage_provisioner = "pd.csi.storage.gke.io"
reclaim_policy = "Delete"
volume_binding_mode = "Immediate"

parameters = {
"type" = "hyperdisk-balanced"
}
}
34 changes: 18 additions & 16 deletions stage0/gcp-terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion stage0/gcp-terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module "gke" {
min_count = np.min_size
max_count = np.max_size
disk_size_gb = np.disk_size_gb
disk_type = try(np.disk_type, "pd-ssd")
disk_type = try(np.disk_type, "hyperdisk-balanced")
auto_repair = true
auto_upgrade = true
service_account = data.google_service_account.existing.email
Expand Down
2 changes: 1 addition & 1 deletion stage0/gcp-terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "6.10.0"
version = "6.11.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
28 changes: 14 additions & 14 deletions stage2/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9af42a1

Please sign in to comment.