Skip to content

Commit

Permalink
test(mc): Create helm-release module (#1303)
Browse files Browse the repository at this point in the history
# Description

* create helm-release module
* delete retina and prometheus modules
* refactor integration tests as needed

## Related Issue

#1267 

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

![Screenshot 2025-02-04
093852](https://github.com/user-attachments/assets/d8c806cc-307a-4956-bdea-c12caf33315c)
![Screenshot 2025-02-04
114057](https://github.com/user-attachments/assets/fb46b254-0623-4fa8-9a96-f5abf67c56c0)

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
  • Loading branch information
SRodi authored Feb 5, 2025
1 parent a1beefd commit dec4e39
Show file tree
Hide file tree
Showing 22 changed files with 359 additions and 121 deletions.
9 changes: 7 additions & 2 deletions test/multicloud/examples/integration/prometheus-kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ module "kind" {
}

module "prometheus" {
depends_on = [module.kind]
source = "../../../modules/prometheus"
depends_on = [module.kind]
source = "../../../modules/helm-release"
release_name = var.prometheus_release_name
repository_url = var.prometheus_repository_url
chart_version = var.prometheus_chart_version
chart_name = var.prometheus_chart_name
values = var.prometheus_values
}
42 changes: 42 additions & 0 deletions test/multicloud/examples/integration/prometheus-kind/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,45 @@ variable "prefix" {
type = string
default = "mc"
}

variable "prometheus_release_name" {
description = "The name of the Helm release."
type = string
default = "prometheus"
}

variable "prometheus_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "https://prometheus-community.github.io/helm-charts"
}

variable "prometheus_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "68.4.3"
}

variable "prometheus_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "kube-prometheus-stack"
}

variable "prometheus_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "global.prometheus.enabled"
value = "true"
},
{
name = "global.grafana.enabled"
value = "true"
}
]
}
11 changes: 7 additions & 4 deletions test/multicloud/examples/integration/retina-gke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ module "gke" {
}

module "retina" {
depends_on = [module.gke]
source = "../../../modules/retina"
retina_version = var.retina_version
values = var.values
depends_on = [module.gke]
source = "../../../modules/helm-release"
release_name = var.retina_release_name
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = var.retina_values
}
39 changes: 36 additions & 3 deletions test/multicloud/examples/integration/retina-gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,48 @@ variable "machine_type" {
default = "e2-standard-4"
}

variable "retina_version" {
description = "The tag to apply to all resources."
variable "retina_release_name" {
description = "The name of the Helm release."
type = string
default = "retina"
}

variable "values" {
variable "retina_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "oci://ghcr.io/microsoft/retina/charts"
}

variable "retina_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "v0.0.24"
}

variable "retina_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "retina"
}

variable "retina_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "image.tag"
value = "v0.0.24"
},
{
name = "operator.tag"
value = "v0.0.24"
},
{
name = "logLevel"
value = "info"
}
]
}
8 changes: 6 additions & 2 deletions test/multicloud/examples/integration/retina-kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module "kind" {

module "retina" {
depends_on = [module.kind]
source = "../../../modules/retina"
retina_version = var.retina_version
source = "../../../modules/helm-release"
release_name = var.retina_release_name
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = var.retina_values
}
46 changes: 43 additions & 3 deletions test/multicloud/examples/integration/retina-kind/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,48 @@ variable "prefix" {
default = "mc"
}

variable "retina_version" {
description = "The tag to apply to all resources."
variable "retina_release_name" {
description = "The name of the Helm release."
type = string
default = "v0.0.23"
default = "retina"
}

variable "retina_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "oci://ghcr.io/microsoft/retina/charts"
}

variable "retina_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "v0.0.24"
}

variable "retina_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "retina"
}

variable "retina_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "image.tag"
value = "v0.0.24"
},
{
name = "operator.tag"
value = "v0.0.24"
},
{
name = "logLevel"
value = "info"
}
]
}
9 changes: 7 additions & 2 deletions test/multicloud/live/retina-aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ module "aks" {
}

module "retina" {
depends_on = [module.aks]
source = "../../modules/retina"
depends_on = [module.aks]
source = "../../modules/helm-release"
release_name = var.retina_release_name
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = var.retina_values
}

output "kubeconfig_command" {
Expand Down
50 changes: 47 additions & 3 deletions test/multicloud/live/retina-aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,51 @@ variable "prefix" {
variable "labels" {
description = "A map of labels to add to all resources."
type = map(string)
default = {
"env" = "test"
}
default = {}
}

variable "retina_release_name" {
description = "The name of the Helm release."
type = string
default = "retina"
}

variable "retina_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "oci://ghcr.io/microsoft/retina/charts"
}

variable "retina_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "v0.0.24"
}

variable "retina_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "retina"
}

variable "retina_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "image.tag"
value = "v0.0.24"
},
{
name = "operator.tag"
value = "v0.0.24"
},
{
name = "logLevel"
value = "info"
}
]
}
9 changes: 7 additions & 2 deletions test/multicloud/live/retina-gke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module "gke" {
}

module "retina" {
depends_on = [module.gke]
source = "../../modules/retina"
depends_on = [module.gke]
source = "../../modules/helm-release"
release_name = var.retina_release_name
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = var.retina_values
}
46 changes: 46 additions & 0 deletions test/multicloud/live/retina-gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,49 @@ variable "machine_type" {
type = string
default = "e2-standard-4"
}

variable "retina_release_name" {
description = "The name of the Helm release."
type = string
default = "retina"
}

variable "retina_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "oci://ghcr.io/microsoft/retina/charts"
}

variable "retina_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "v0.0.24"
}

variable "retina_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "retina"
}

variable "retina_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "image.tag"
value = "v0.0.24"
},
{
name = "operator.tag"
value = "v0.0.24"
},
{
name = "logLevel"
value = "info"
}
]
}
9 changes: 7 additions & 2 deletions test/multicloud/live/retina-kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ module "kind" {
}

module "retina" {
depends_on = [module.kind]
source = "../../modules/retina"
depends_on = [module.kind]
source = "../../modules/helm-release"
release_name = var.retina_release_name
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = var.retina_values
}
48 changes: 47 additions & 1 deletion test/multicloud/live/retina-kind/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,50 @@ variable "prefix" {
description = "A prefix to add to all resources."
type = string
default = "mc"
}
}

variable "retina_release_name" {
description = "The name of the Helm release."
type = string
default = "retina"
}

variable "retina_repository_url" {
description = "The URL of the Helm repository."
type = string
default = "oci://ghcr.io/microsoft/retina/charts"
}

variable "retina_chart_version" {
description = "The version of the Helm chart to install."
type = string
default = "v0.0.24"
}

variable "retina_chart_name" {
description = "The name of the Helm chart to install."
type = string
default = "retina"
}

variable "retina_values" {
description = "Configuration for set blocks, this corresponds to Helm values.yaml"
type = list(object({
name = string
value = string
}))
default = [
{
name = "image.tag"
value = "v0.0.24"
},
{
name = "operator.tag"
value = "v0.0.24"
},
{
name = "logLevel"
value = "info"
}
]
}
Loading

0 comments on commit dec4e39

Please sign in to comment.