mirror of
https://github.com/vcscsvcscs/OCI-Kubernetes-cluster-with-traefik.git
synced 2025-08-13 22:39:06 +02:00
Add oke and nlb to managed cluster
This commit is contained in:
8
oci-managed/nlb/data.tf
Normal file
8
oci-managed/nlb/data.tf
Normal file
@@ -0,0 +1,8 @@
|
||||
data "oci_containerengine_cluster_kube_config" "cluster_kube_config" {
|
||||
#Required
|
||||
cluster_id = var.cluster_ocid
|
||||
|
||||
#Optional
|
||||
endpoint = var.cluster_public_endpoint
|
||||
token_version = "2.0.0"
|
||||
}
|
0
oci-managed/nlb/output.tf
Normal file
0
oci-managed/nlb/output.tf
Normal file
5
oci-managed/nlb/provider.tf
Normal file
5
oci-managed/nlb/provider.tf
Normal file
@@ -0,0 +1,5 @@
|
||||
provider "helm" {
|
||||
kubernetes {
|
||||
config_path = "~/.kube/config"
|
||||
}
|
||||
}
|
20
oci-managed/nlb/traefik.tf
Normal file
20
oci-managed/nlb/traefik.tf
Normal file
@@ -0,0 +1,20 @@
|
||||
resource "helm_release" "traefik" {
|
||||
namespace = "traefik-loadbalancer"
|
||||
create_namespace = true
|
||||
name = "traefik"
|
||||
repository = "https://traefik.github.io/charts"
|
||||
chart = "traefik"
|
||||
version = var.traefik_chart_version
|
||||
|
||||
# Helm chart deployment can sometimes take longer than the default 5 minutes
|
||||
timeout = var.timeout_seconds
|
||||
|
||||
# If values file specified by the var.values_file input variable exists then apply the values from this file
|
||||
# else apply the default values from the chart
|
||||
values = [fileexists("${path.root}/${var.values_file}") == true ? file("${path.root}/${var.values_file}") : ""]
|
||||
|
||||
set {
|
||||
name = "deployment.replicas"
|
||||
value = var.replica_count
|
||||
}
|
||||
}
|
41
oci-managed/nlb/variables.tf
Normal file
41
oci-managed/nlb/variables.tf
Normal file
@@ -0,0 +1,41 @@
|
||||
variable "compartment_ocid" {}
|
||||
variable "environment" {
|
||||
default = "prod"
|
||||
}
|
||||
variable "cluster_ocid" {
|
||||
type = string
|
||||
}
|
||||
variable "cluster_public_endpoint" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "namespace" {
|
||||
description = "Namespace to install traefik chart into"
|
||||
type = string
|
||||
default = "traefik"
|
||||
}
|
||||
|
||||
variable "traefik_chart_version" {
|
||||
description = "Version of Traefik chart to install"
|
||||
type = string
|
||||
default = "21.1.0" # See https://artifacthub.io/packages/helm/traefik/traefik for latest version(s)
|
||||
}
|
||||
|
||||
# Helm chart deployment can sometimes take longer than the default 5 minutes
|
||||
variable "timeout_seconds" {
|
||||
type = number
|
||||
description = "Helm chart deployment can sometimes take longer than the default 5 minutes. Set a custom timeout here."
|
||||
default = 800 # 10 minutes
|
||||
}
|
||||
|
||||
variable "replica_count" {
|
||||
description = "Number of replica pods to create"
|
||||
type = number
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "values_file" {
|
||||
description = "The name of the traefik helmchart values file to use"
|
||||
type = string
|
||||
default = "values.yaml"
|
||||
}
|
Reference in New Issue
Block a user