Skip to content
Draft
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
19 changes: 19 additions & 0 deletions terraform/ovh/network/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.
#

module "tf_network" {
source ="/Users/andrzej/repo/terraform-ovh-platform/modules/network"
service_name = var.service_name
}
31 changes: 31 additions & 0 deletions terraform/ovh/network/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.
#


output "floatingip" {
description = "Allocated floating IP for future usage"
value = module.tf_network.floatingip
}

output "nodes_subnet_id" {
description = "Nodes subnet ID"
value = module.tf_network.nodes_subnet_id
}

output "network_id" {
description = "Network id to attach cluster"
value = module.tf_network.network_id
}

20 changes: 20 additions & 0 deletions terraform/ovh/network/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.
#


provider "ovh" {

# TODO ADD you OVH credentials
}
20 changes: 20 additions & 0 deletions terraform/ovh/network/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 "service_name" {
description = "The id of the public OVH cloud project"
type = string
}
29 changes: 29 additions & 0 deletions terraform/ovh/network/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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 {
ovh = {
source = "ovh/ovh"
version = "~> 2.0.0"
}
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.43.0"
}
}
}
46 changes: 46 additions & 0 deletions terraform/ovh/platform/config/pulsar-kaap/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cluster:
create: true
spec:
global:
name: pulsar
image: apachepulsar/pulsar:4.0.0
restartOnConfigMapChange: true
zookeeper:
replicas: 1
dataVolume:
name: data
size: 100M
resources:
requests:
cpu: "0.1"
memory: "256Mi"
bookkeeper:
replicas: 1
volumes:
journal:
size: 5Gi
ledgers:
size: 20Gi
resources:
requests:
cpu: "0.4"
memory: "2Gi"
broker:
replicas: 1
config:
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultWriteQuorum: "1"
managedLedgerDefaultAckQuorum: "1"
compactionServiceFactoryClassName: "org.apache.pulsar.compaction.EventTimeCompactionServiceFactory"
resources:
requests:
cpu: "0.4"
memory: "1Gi"
proxy:
replicas: 0
autorecovery:
replicas: 0
bastion:
replicas: 0
functionsWorker:
replicas: 0
56 changes: 56 additions & 0 deletions terraform/ovh/platform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.
#


module "cluster" {
source = "/Users/andrzej/repo/terraform-ovh-platform/modules/cluster"
service_name = var.service_name
kubeconfig_path = "${path.module}/.env/kubeconfig"
network_id = var.public_ip_address == null || var.public_ip_address == "" ? null: var.network_id
nodes_subnet_id = var.public_ip_address == null || var.public_ip_address == "" ? null: var.nodes_subnet_id
region = var.region
}

locals {
ingress_controller_nginx_settings_without_static_ip = {
"controller.replicaCount" : 1
"controller.service.annotations.loadbalancer\\.ovhcloud\\.com/class" : "octavia"
}
ingress_controller_nginx_settings_with_static_ip = {
"controller.service.loadBalancerIP" : var.public_ip_address
"controller.replicaCount" : 1
"controller.service.annotations.loadbalancer\\.ovhcloud\\.com/class" : "octavia"
}
}

module "streamx" {
source = "streamx-dev/charts/helm"
version = "0.0.4"

cert_manager_lets_encrypt_issuer_acme_email = var.cert_manager_lets_encrypt_issuer_acme_email
ingress_controller_nginx_settings = var.public_ip_address == null || var.public_ip_address == "" ? local.ingress_controller_nginx_settings_without_static_ip : local.ingress_controller_nginx_settings_with_static_ip
pulsar_kaap_values = [
file("${path.module}/config/pulsar-kaap/values.yaml")
]
streamx_operator_image_pull_secret_registry_email = var.streamx_operator_image_pull_secret_registry_email
streamx_operator_image_pull_secret_registry_password = var.streamx_operator_image_pull_secret_registry_password
streamx_operator_chart_repository_username = "_json_key_base64"
streamx_operator_chart_repository_password = var.streamx_operator_image_pull_secret_registry_password
ingress_controller_nginx_timeout = 300
cert_manager_timeout = 300
pulsar_kaap_timeout = 300
streamx_operator_timeout = 300
depends_on = [module.cluster]
}
31 changes: 31 additions & 0 deletions terraform/ovh/platform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.
#


output "kubeconfig_path" {
description = "K8s cluster kubeconfig file path"
value = module.cluster.kubeconfig_path
}

output "kubeconfig" {
description = "K8s cluster kubeconfig"
value = module.cluster.kubeconfig
sensitive = true
}

output "loadbalancer_ip" {
description = "K8s cluster Load Balancer IP"
value = module.streamx.loadbalancer_ip
}
44 changes: 44 additions & 0 deletions terraform/ovh/platform/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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.
#


provider "ovh" {
# TODO ADD you OVH credentials
}


provider "kubernetes" {
host = module.cluster.host
client_certificate = module.cluster.client_certificate
client_key = module.cluster.client_key
cluster_ca_certificate = module.cluster.cluster_ca_certificate
}

provider "helm" {
kubernetes {
host = module.cluster.host
client_certificate = module.cluster.client_certificate
client_key = module.cluster.client_key
cluster_ca_certificate = module.cluster.cluster_ca_certificate
}
}

provider "kubectl" {
load_config_file = false
host = module.cluster.host
client_certificate = module.cluster.client_certificate
client_key = module.cluster.client_key
cluster_ca_certificate = module.cluster.cluster_ca_certificate
}
64 changes: 64 additions & 0 deletions terraform/ovh/platform/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 "service_name" {
description = "The id of the public OVH cloud project"
type = string
}

variable "cluster_name" {
default = "streamx"
description = "The name of the kubernetes cluster."
type = string
}

variable "region" {
default = "waw1"
description = "Region of cloud deployment"
type = string
}

variable "network_id" {
description = "Network id to attach cluster"
type = string
}

variable "nodes_subnet_id" {
description = "Nodes subnet ID"
type = string
}

variable "cert_manager_lets_encrypt_issuer_acme_email" {
description = "Email passed to acme server."
type = string
}

variable "streamx_operator_image_pull_secret_registry_email" {
description = "StreamX Operator container image registry user email."
type = string
}

variable "streamx_operator_image_pull_secret_registry_password" {
description = "StreamX Operator container image registry user password."
type = string
sensitive = true
}

variable "public_ip_address" {
default = null
description = "Public IP address"
type = string
}
Loading
Loading