Refacto and add lb
This commit is contained in:
@@ -10,12 +10,16 @@ variable "namespace" {
|
||||
variable "labels" {
|
||||
type = map(string)
|
||||
}
|
||||
variable "annotations" {
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
variable "svc_type" {
|
||||
type = string
|
||||
default = "ClusterIP"
|
||||
validation {
|
||||
condition = contains(["ClusterIP", "ExternalName", "NodePort"], var.svc_type)
|
||||
error_message = "Only ClusterIP or ExternalName is allowed"
|
||||
condition = contains(["ClusterIP", "ExternalName", "NodePort", "LoadBalancer"], var.svc_type)
|
||||
error_message = "Only ClusterIP, ExternalName, NodePort or LoadBalancer is allowed"
|
||||
}
|
||||
}
|
||||
variable "ports" {
|
||||
@@ -46,3 +50,15 @@ variable "node_ports" {
|
||||
error_message = "The range of valid ports is 30000-32767"
|
||||
}
|
||||
}
|
||||
variable "lb_ports" {
|
||||
type = list(number)
|
||||
default = [8080]
|
||||
}
|
||||
variable "lb_policy" {
|
||||
type = string
|
||||
default = "Cluster"
|
||||
validation {
|
||||
condition = contains(["Cluster", "Local"], var.lb_policy)
|
||||
error_message = "Only Cluster or Local is allowed"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user