Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
| <a name="module_opentelemetry_operator"></a> [opentelemetry\_operator](#module\_opentelemetry\_operator) | ./modules/monitoring-opentelemetry-operator | n/a |
| <a name="module_prometheus_stack"></a> [prometheus\_stack](#module\_prometheus\_stack) | ./modules/monitoring-prometheus-stack | n/a |
| <a name="module_pulsar_kaap"></a> [pulsar\_kaap](#module\_pulsar\_kaap) | ./modules/pulsar-kaap | n/a |
| <a name="module_pulsar_resources_operator"></a> [pulsar\_resources\_operator](#module\_pulsar\_resources\_operator) | ./modules/pulsar-resources-operator | n/a |
| <a name="module_streamx_dashboards"></a> [streamx\_dashboards](#module\_streamx\_dashboards) | ./modules/monitoring-streamx-grafana-dashboards | n/a |
| <a name="module_streamx_operator"></a> [streamx\_operator](#module\_streamx\_operator) | ./modules/streamx-operator | n/a |
| <a name="module_streamx_operator_image_pull_secret"></a> [streamx\_operator\_image\_pull\_secret](#module\_streamx\_operator\_image\_pull\_secret) | ./modules/docker-config-secret | n/a |
Expand Down Expand Up @@ -184,6 +185,18 @@
| <a name="input_pulsar_kaap_settings"></a> [pulsar\_kaap\_settings](#input\_pulsar\_kaap\_settings) | Additional key value settings which will be passed to the Helm chart values, e.g. { "namespace" = "kube-system" }. | `map(any)` | `null` | no |
| <a name="input_pulsar_kaap_timeout"></a> [pulsar\_kaap\_timeout](#input\_pulsar\_kaap\_timeout) | Time in seconds to wait for any individual kubernetes operation | `number` | `null` | no |
| <a name="input_pulsar_kaap_values"></a> [pulsar\_kaap\_values](#input\_pulsar\_kaap\_values) | A list of values in raw YAML to be applied to the helm release. Overrides default values from [default-configs](./default-configs). Merges with the settings input, can also be used with the `file()` function, i.e. `file("my/values.yaml")`. | `list(string)` | `null` | no |
| <a name="input_pulsar_resources_operator_chart_name"></a> [pulsar\_resources\_operator\_chart\_name](#input\_pulsar\_resources\_operator\_chart\_name) | The name of the Helm chart to install | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_chart_repository"></a> [pulsar\_resources\_operator\_chart\_repository](#input\_pulsar\_resources\_operator\_chart\_repository) | The repository containing the Helm chart to install. | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_chart_repository_password"></a> [pulsar\_resources\_operator\_chart\_repository\_password](#input\_pulsar\_resources\_operator\_chart\_repository\_password) | The password used for the repository authentication. | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_chart_repository_username"></a> [pulsar\_resources\_operator\_chart\_repository\_username](#input\_pulsar\_resources\_operator\_chart\_repository\_username) | The username used for the repository authentication. | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_chart_version"></a> [pulsar\_resources\_operator\_chart\_version](#input\_pulsar\_resources\_operator\_chart\_version) | The version of the Helm chart to install. | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_create_namespace"></a> [pulsar\_resources\_operator\_create\_namespace](#input\_pulsar\_resources\_operator\_create\_namespace) | Create a namespace for the deployment. | `bool` | `true` | no |
| <a name="input_pulsar_resources_operator_enabled"></a> [pulsar\_resources\_operator\_enabled](#input\_pulsar\_resources\_operator\_enabled) | Enables Pulsar Resources Operator. | `bool` | `true` | no |
| <a name="input_pulsar_resources_operator_namespace"></a> [pulsar\_resources\_operator\_namespace](#input\_pulsar\_resources\_operator\_namespace) | The namespace used for the deployment | `string` | `"pulsar-resources-operator"` | no |
| <a name="input_pulsar_resources_operator_release_name"></a> [pulsar\_resources\_operator\_release\_name](#input\_pulsar\_resources\_operator\_release\_name) | The name of the helm release. | `string` | `null` | no |
| <a name="input_pulsar_resources_operator_settings"></a> [pulsar\_resources\_operator\_settings](#input\_pulsar\_resources\_operator\_settings) | Additional key value settings which will be passed to the Helm chart values, e.g. { "namespace" = "kube-system" }. | `map(any)` | `null` | no |
| <a name="input_pulsar_resources_operator_timeout"></a> [pulsar\_resources\_operator\_timeout](#input\_pulsar\_resources\_operator\_timeout) | Time in seconds to wait for any individual kubernetes operation. | `number` | `null` | no |
| <a name="input_pulsar_resources_operator_values"></a> [pulsar\_resources\_operator\_values](#input\_pulsar\_resources\_operator\_values) | A list of values in raw YAML to be applied to the helm release. Overrides default composed values. Merges with the settings input, can also be used with the `file()` function, i.e. `file("my/values.yaml")`. | `list(string)` | `null` | no |
| <a name="input_streamx_operator_chart_name"></a> [streamx\_operator\_chart\_name](#input\_streamx\_operator\_chart\_name) | The name of the Helm chart to install | `string` | `null` | no |
| <a name="input_streamx_operator_chart_repository"></a> [streamx\_operator\_chart\_repository](#input\_streamx\_operator\_chart\_repository) | The repository containing the Helm chart to install. | `string` | `null` | no |
| <a name="input_streamx_operator_chart_repository_password"></a> [streamx\_operator\_chart\_repository\_password](#input\_streamx\_operator\_chart\_repository\_password) | The password used for the repository authentication. | `string` | `null` | no |
Expand All @@ -201,7 +214,7 @@
| <a name="input_streamx_operator_messaging_pulsar_client_service_url"></a> [streamx\_operator\_messaging\_pulsar\_client\_service\_url](#input\_streamx\_operator\_messaging\_pulsar\_client\_service\_url) | Pulsar client service URL passed to StreamX Operator. If null and KAAP enabled then KAAP default URL is used. | `string` | `null` | no |
| <a name="input_streamx_operator_monitoring_traces_endpoint"></a> [streamx\_operator\_monitoring\_traces\_endpoint](#input\_streamx\_operator\_monitoring\_traces\_endpoint) | Traces collector URL | `string` | `null` | no |
| <a name="input_streamx_operator_monitoring_traces_mode"></a> [streamx\_operator\_monitoring\_traces\_mode](#input\_streamx\_operator\_monitoring\_traces\_mode) | Traces monitoring mode for StreamX Meshes deployed by StreamX Operator | `string` | `null` | no |
| <a name="input_streamx_operator_namespace"></a> [streamx\_operator\_namespace](#input\_streamx\_operator\_namespace) | The namespace used for the deployment | `string` | `"streamx-operator"` | no |
| <a name="input_streamx_operator_namespace"></a> [streamx\_operator\_namespace](#input\_streamx\_operator\_namespace) | The namespace used for the deployment | `string` | `"streamx-system"` | no |
| <a name="input_streamx_operator_release_name"></a> [streamx\_operator\_release\_name](#input\_streamx\_operator\_release\_name) | The name of the helm release. | `string` | `null` | no |
| <a name="input_streamx_operator_settings"></a> [streamx\_operator\_settings](#input\_streamx\_operator\_settings) | Additional key value settings which will be passed to the Helm chart values, e.g. { "namespace" = "kube-system" }. | `map(any)` | `null` | no |
| <a name="input_streamx_operator_timeout"></a> [streamx\_operator\_timeout](#input\_streamx\_operator\_timeout) | Time in seconds to wait for any individual kubernetes operation. | `number` | `null` | no |
Expand Down
51 changes: 51 additions & 0 deletions modules/cnpg-cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.17.0, < 3.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.17.0, < 3.0.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [helm_release.release](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [kubernetes_secret_v1.cluster_app](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/secret_v1) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_atomic"></a> [atomic](#input\_atomic) | Purge the chart on a failed installation. | `bool` | `null` | no |
| <a name="input_chart_name"></a> [chart\_name](#input\_chart\_name) | The name of the Helm chart to install | `string` | `null` | no |
| <a name="input_chart_repository"></a> [chart\_repository](#input\_chart\_repository) | The repository containing the Helm chart to install | `string` | `null` | no |
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | The version of the Helm chart to install | `string` | `null` | no |
| <a name="input_cleanup_on_fail"></a> [cleanup\_on\_fail](#input\_cleanup\_on\_fail) | Allow deletion of new resources created in this upgrade when upgrade fails | `bool` | `null` | no |
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Create a namespace for the deployment. Defaults to "true". | `bool` | `null` | no |
| <a name="input_force_defaults_for_null_variables"></a> [force\_defaults\_for\_null\_variables](#input\_force\_defaults\_for\_null\_variables) | Enables forcing default variable values when the variable value passed to the module is null. | `bool` | `true` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | The namespace used for the deployment | `string` | `null` | no |
| <a name="input_release_name"></a> [release\_name](#input\_release\_name) | The name of the helm release | `string` | `null` | no |
| <a name="input_settings"></a> [settings](#input\_settings) | Settings which will be passed to the Helm chart values | `map(any)` | `null` | no |
| <a name="input_timeout"></a> [timeout](#input\_timeout) | Time in seconds to wait for any individual kubernetes operation | `number` | `null` | no |
| <a name="input_values"></a> [values](#input\_values) | A list of values in raw YAML to be applied to the helm release. Merges with the settings input, can also be used with the `file()` function, i.e. `file("my/values.yaml")`. | `any` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_db_name"></a> [db\_name](#output\_db\_name) | n/a |
| <a name="output_db_password"></a> [db\_password](#output\_db\_password) | n/a |
| <a name="output_db_username"></a> [db\_username](#output\_db\_username) | n/a |
<!-- END_TF_DOCS -->
3 changes: 3 additions & 0 deletions modules/cnpg-cluster/chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chart: cluster
repository: https://cloudnative-pg.github.io/charts
version: 0.3.1
71 changes: 71 additions & 0 deletions modules/cnpg-cluster/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

locals {
chart_defaults = yamldecode(file("${path.module}/chart.yaml"))
default_atomic = true
default_chart_name = local.chart_defaults.chart
default_chart_repository = local.chart_defaults.repository
default_chart_version = local.chart_defaults.version
default_cleanup_on_fail = true
default_create_namespace = true
default_namespace = "cnpg-system"
default_release_name = "cnpg"
default_settings = {}
default_timeout = 300
default_values = []

atomic = var.force_defaults_for_null_variables && var.atomic == null ? local.default_atomic : var.atomic
chart_name = var.force_defaults_for_null_variables && var.chart_name == null ? local.default_chart_name : var.chart_name
chart_repository = var.force_defaults_for_null_variables && var.chart_repository == null ? local.default_chart_repository : var.chart_repository
chart_version = var.force_defaults_for_null_variables && var.chart_version == null ? local.default_chart_version : var.chart_version
cleanup_on_fail = var.force_defaults_for_null_variables && var.cleanup_on_fail == null ? local.default_cleanup_on_fail : var.cleanup_on_fail
create_namespace = var.force_defaults_for_null_variables && var.create_namespace == null ? local.default_create_namespace : var.create_namespace
namespace = var.force_defaults_for_null_variables && var.namespace == null ? local.default_namespace : var.namespace
release_name = var.force_defaults_for_null_variables && var.release_name == null ? local.default_release_name : var.release_name
settings = var.force_defaults_for_null_variables && var.settings == null ? local.default_settings : var.settings
timeout = var.force_defaults_for_null_variables && var.timeout == null ? local.default_timeout : var.timeout
values = var.force_defaults_for_null_variables && var.values == null ? local.default_values : var.values
}

resource "helm_release" "release" {
atomic = local.atomic
chart = local.chart_name
cleanup_on_fail = local.cleanup_on_fail
create_namespace = local.create_namespace
name = local.release_name
namespace = local.namespace
repository = local.chart_repository
timeout = local.timeout
version = local.chart_version
values = local.values

dynamic "set" {
for_each = local.settings
content {
name = set.key
value = set.value
}
}
}

data "kubernetes_secret_v1" "cluster_app" {
metadata {
name = "${local.release_name}-cluster-app"
namespace = local.namespace
}

depends_on = [helm_release.release]
}
12 changes: 12 additions & 0 deletions modules/cnpg-cluster/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
output "db_username" {
value = data.kubernetes_secret_v1.cluster_app.data.username
}

output "db_password" {
value = data.kubernetes_secret_v1.cluster_app.data.password
sensitive = true
}

output "db_name" {
value = data.kubernetes_secret_v1.cluster_app.data.dbname
}
85 changes: 85 additions & 0 deletions modules/cnpg-cluster/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

variable "force_defaults_for_null_variables" {
default = true
description = "Enables forcing default variable values when the variable value passed to the module is null."
type = bool
}

variable "atomic" {
default = null
description = "Purge the chart on a failed installation."
type = bool
}

variable "chart_name" {
default = null
description = "The name of the Helm chart to install"
type = string
}

variable "chart_repository" {
default = null
description = "The repository containing the Helm chart to install"
type = string
}

variable "chart_version" {
default = null
description = "The version of the Helm chart to install"
type = string
}

variable "cleanup_on_fail" {
default = null
description = "Allow deletion of new resources created in this upgrade when upgrade fails"
type = bool
}

variable "create_namespace" {
default = null
description = "Create a namespace for the deployment. Defaults to \"true\"."
type = bool
}

variable "namespace" {
default = null
description = "The namespace used for the deployment"
type = string
}

variable "release_name" {
default = null
description = "The name of the helm release"
type = string
}

variable "settings" {
default = null
description = "Settings which will be passed to the Helm chart values"
type = map(any)
}

variable "timeout" {
default = null
description = "Time in seconds to wait for any individual kubernetes operation"
type = number
}

variable "values" {
default = null
description = "A list of values in raw YAML to be applied to the helm release. Merges with the settings input, can also be used with the `file()` function, i.e. `file(\"my/values.yaml\")`."
}
24 changes: 24 additions & 0 deletions modules/cnpg-cluster/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 Dynamic Solutions Sp. z o.o. sp.k.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

terraform {
required_version = ">= 1.0.0"
required_providers {
helm = {
source = "hashicorp/helm"
version = ">= 2.17.0, < 3.0.0"
}
}
}
Loading