Module to configure a k8s cluster receiving a kubeconfig file content as input with a list of services to expose with a dynamic ingress block.
An empty kubeconfig file is required to workaround the first provider load. In apply time, kubeconfig file is changed by a generated file that contains the right cluster configuration.
Well integrated with the CCE Cluster module created also by me.
Name |
Description |
Type |
Default |
Required |
environment |
n/a |
string |
n/a |
yes |
hostname |
n/a |
string |
n/a |
yes |
kubeconfig |
Kubeconfig file content |
string |
n/a |
yes |
load_balancer_id |
n/a |
string |
n/a |
yes |
load_balancer_ip |
n/a |
string |
n/a |
yes |
load_balancer_port |
Load balancer listener port |
string |
"80" |
no |
project |
n/a |
string |
n/a |
yes |
service_list |
n/a |
list(object({ api_name = string replicas = number docker_image = string container_port = number port_name = string url_path = string })) |
n/a |
yes |
ssl_cert |
SSL certificate to use with HTTPS Listener. Required if use 443 as port |
string |
"" |
no |
ssl_key |
SSL key associated with ssl cert. Required if use 443 as port |
string |
"" |
no |
module "k8s_config" {
source = "git@github.com:abejarano/huawei-cloud-k8s-config-tf-module"
project = var.project
environment = var.environment
kubeconfig = module.k8s_cluster.kubeconfig
service_list = local.services
load_balancer_id = module.k8s_cluster.load_balancer_id
load_balancer_ip = module.k8s_cluster.load_balancer_eip
hostname = "test.com"
load_balancer_port = "443"
ssl_cert = var.ssl_cert
ssl_key = var.ssl_key
}
locals {
services = [
{
api_name = "nginx"
replicas = 2
docker_image = "nginx:1.8"
container_port = 80
port_name = "http"
url_path = "/"
}
]
}