Skip to content

Commit ffc0762

Browse files
authored
feat(ext-kupo): add support for node affinity (#208)
Signed-off-by: Ales Verbic <[email protected]>
1 parent de72433 commit ffc0762

File tree

3 files changed

+77
-3
lines changed

3 files changed

+77
-3
lines changed

common/defaults-gcp.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ managed_node_groups:
113113
demeter.run/availability-sla: consistent
114114
demeter.run/compute-profile: general-purpose
115115
demeter.run/compute-arch: x86
116-
demeter.run/availability-zone: az1
116+
demeter.run/availability-zone: az2
117117
instance_type: n4-standard-8
118118
min_size: 0
119119
max_size: 1

stage3/kupo.tf

+28-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "ext_cardano_kupo_crds" {
4040
}
4141

4242
module "ext_cardano_kupo" {
43-
source = "git::https://github.com/demeter-run/ext-cardano-kupo.git//bootstrap?ref=61017ea"
43+
source = "git::https://github.com/demeter-run/ext-cardano-kupo.git//bootstrap?ref=c196b08"
4444
for_each = toset([for n in toset(["v1"]) : n if var.enable_cardano_kupo])
4545
namespace = "ftr-kupo-${each.key}"
4646
cloud_provider = var.cloud_provider
@@ -114,6 +114,15 @@ module "ext_cardano_kupo" {
114114
value = "arm64"
115115
}
116116
]
117+
node_affinity = {
118+
required_during_scheduling_ignored_during_execution = {
119+
node_selector_term = [
120+
{
121+
match_expressions = var.kupo_v1_cell1_preview_node_affinity
122+
}
123+
]
124+
}
125+
}
117126
}
118127
}
119128
}
@@ -167,6 +176,15 @@ module "ext_cardano_kupo" {
167176
value = "arm64"
168177
}
169178
]
179+
node_affinity = {
180+
required_during_scheduling_ignored_during_execution = {
181+
node_selector_term = [
182+
{
183+
match_expressions = var.kupo_v1_cell2_preprod_node_affinity
184+
}
185+
]
186+
}
187+
}
170188
}
171189
}
172190
}
@@ -220,9 +238,17 @@ module "ext_cardano_kupo" {
220238
value = "arm64"
221239
}
222240
]
241+
node_affinity = {
242+
required_during_scheduling_ignored_during_execution = {
243+
node_selector_term = [
244+
{
245+
match_expressions = var.kupo_v1_cell3_mainnet_node_affinity
246+
}
247+
]
248+
}
249+
}
223250
}
224251
}
225252
}
226253
}
227254
}
228-

stage3/variables.tf

+48
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,54 @@ variable "kupo_v1_api_key_salt" {
134134
default = ""
135135
}
136136

137+
variable "kupo_v1_cell1_preview_node_affinity" {
138+
description = "node affinity match_expressions for kupo cell1 preview instance"
139+
type = list(object({
140+
key = string
141+
operator = string
142+
values = list(string)
143+
}))
144+
default = [
145+
{
146+
key = "cloud.google.com/gke-nodepool"
147+
operator = "In"
148+
values = ["co-di-arm64-az1"]
149+
}
150+
]
151+
}
152+
153+
variable "kupo_v1_cell2_preprod_node_affinity" {
154+
description = "node affinity match_expressions for kupo cell2 preprod instance"
155+
type = list(object({
156+
key = string
157+
operator = string
158+
values = list(string)
159+
}))
160+
default = [
161+
{
162+
key = "cloud.google.com/gke-nodepool"
163+
operator = "In"
164+
values = ["co-di-arm64-az1"]
165+
}
166+
]
167+
}
168+
169+
variable "kupo_v1_cell3_mainnet_node_affinity" {
170+
description = "node affinity match_expressions for kupo cell3 mainnet instance"
171+
type = list(object({
172+
key = string
173+
operator = string
174+
values = list(string)
175+
}))
176+
default = [
177+
{
178+
key = "cloud.google.com/gke-nodepool"
179+
operator = "In"
180+
values = ["co-di-arm64-az1"]
181+
}
182+
]
183+
}
184+
137185
variable "kupo_v1_storage_size_preview" {
138186
description = "size of the storage for the kupo extension"
139187
default = "50Gi"

0 commit comments

Comments
 (0)