Skip to content

Commit

Permalink
Pod Deletion Cost updater for Cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Jun 12, 2024
1 parent dabff32 commit d6eadf8
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 24 deletions.
6 changes: 6 additions & 0 deletions infrastructure/quick-deploy/aws/armonik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,10 @@ module "armonik" {
image_pull_secrets = var.metrics_exporter.pull_secrets
node_selector = var.metrics_exporter.node_selector
}

# Pod Deletion Cost updater
pod_deletion_cost = merge(var.pod_deletion_cost, {
image = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].image
tag = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].tag
})
}
1 change: 1 addition & 0 deletions infrastructure/quick-deploy/aws/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ locals {
var.partition_metrics_exporter == null ? null : [var.partition_metrics_exporter.image_name, var.partition_metrics_exporter.image_tag],
var.ingress == null ? null : [var.ingress.image, var.ingress.tag],
var.authentication == null ? null : [var.authentication.image, var.authentication.tag],
var.pod_deletion_cost == null ? null : [var.pod_deletion_cost.image, var.pod_deletion_cost.tag],
], [for k, v in var.compute_plane :
[v.polling_agent.image, v.polling_agent.tag]
], concat([for k, v in var.compute_plane :
Expand Down
57 changes: 45 additions & 12 deletions infrastructure/quick-deploy/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,37 @@ variable "authentication" {
default = {}
}

variable "pod_deletion_cost" {
description = "Configuration of Pod Deletion Cost updater"
type = object({
image = optional(string, "dockerhubaneo/armonik-pdc-update")
tag = optional(string)
image_pull_policy = optional(string, "IfNotPresent")
image_pull_secrets = optional(string, "")
node_selector = optional(any, {})
annotations = optional(any, {})
name = optional(string, "pdc-update")
label_app = optional(string, "armonik")
prometheus_url = optional(string)
metrics_name = optional(string)
period = optional(number)
ignore_younger_than = optional(number)
concurrency = optional(number)
granularity = optional(number)
extra_conf = optional(map(string), {})

limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
})
default = {}
}

variable "upload_images" {
description = "Whether the images are uploaded to the Artifact Registry or not"
type = bool
Expand All @@ -724,24 +755,26 @@ variable "upload_images" {
variable "armonik_versions" {
description = "Versions of all the ArmoniK components"
type = object({
infra = string
core = string
api = string
gui = string
extcsharp = string
samples = string
infra = string
infra_plugins = string
core = string
api = string
gui = string
extcsharp = string
samples = string
})
}

variable "armonik_images" {
description = "Image names of all the ArmoniK components"
type = object({
infra = set(string)
core = set(string)
api = set(string)
gui = set(string)
extcsharp = set(string)
samples = set(string)
infra = set(string)
infra_plugins = set(string)
core = set(string)
api = set(string)
gui = set(string)
extcsharp = set(string)
samples = set(string)
})
}

Expand Down
6 changes: 6 additions & 0 deletions infrastructure/quick-deploy/gcp/armonik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@ module "armonik" {
image_pull_secrets = var.metrics_exporter.pull_secrets
node_selector = var.metrics_exporter.node_selector
}

# Pod Deletion Cost updater
pod_deletion_cost = merge(var.pod_deletion_cost, {
image = local.docker_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].image
tag = local.docker_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].tag
})
}
1 change: 1 addition & 0 deletions infrastructure/quick-deploy/gcp/gar.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ locals {
] : null,
var.ingress != null ? [var.ingress.image, var.ingress.tag] : null,
var.authentication != null ? [var.authentication.image, var.authentication.tag] : null,
var.pod_deletion_cost != null ? [var.pod_deletion_cost.image, var.pod_deletion_cost.tag] : null,
], [
for k, v in var.compute_plane :
[v.polling_agent.image, v.polling_agent.tag]
Expand Down
57 changes: 45 additions & 12 deletions infrastructure/quick-deploy/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,27 @@ variable "gcs_os" {
variable "armonik_images" {
description = "Image names of all the ArmoniK components"
type = object({
infra = set(string)
core = set(string)
api = set(string)
gui = set(string)
extcsharp = set(string)
samples = set(string)
infra = set(string)
infra_plugins = set(string)
core = set(string)
api = set(string)
gui = set(string)
extcsharp = set(string)
samples = set(string)
})
}

# Versions of the ArmoniK docker images
variable "armonik_versions" {
description = "Versions of all the ArmoniK components"
type = object({
infra = string
core = string
api = string
gui = string
extcsharp = string
samples = string
infra = string
infra_plugins = string
core = string
api = string
gui = string
extcsharp = string
samples = string
})
}

Expand Down Expand Up @@ -469,6 +471,37 @@ variable "authentication" {
default = {}
}

variable "pod_deletion_cost" {
description = "Configuration of Pod Deletion Cost updater"
type = object({
image = optional(string, "dockerhubaneo/armonik-pdc-update")
tag = optional(string)
image_pull_policy = optional(string, "IfNotPresent")
image_pull_secrets = optional(string, "")
node_selector = optional(any, {})
annotations = optional(any, {})
name = optional(string, "pdc-update")
label_app = optional(string, "armonik")
prometheus_url = optional(string)
metrics_name = optional(string)
period = optional(number)
ignore_younger_than = optional(number)
concurrency = optional(number)
granularity = optional(number)
extra_conf = optional(map(string), {})

limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
})
default = {}
}

# Versions of Third-party docker images
variable "image_tags" {
description = "Tags of images used"
Expand Down

0 comments on commit d6eadf8

Please sign in to comment.