fix
This commit is contained in:
@@ -8,7 +8,7 @@ locals {
|
||||
}
|
||||
global = {
|
||||
"domain" = var.namespace
|
||||
"domain-name" = var.domain-name
|
||||
"domain-name" = "admin.${var.domain-name}"
|
||||
"issuer" = var.issuer
|
||||
"ingress-class" = var.ingress-class
|
||||
"backups" = var.backups
|
||||
@@ -17,10 +17,11 @@ locals {
|
||||
traefik = { for k, v in var.traefik : k => v if k!="enable" }
|
||||
dns = { for k, v in var.dns : k => v if k!="enable" }
|
||||
api = { for k, v in var.api : k => v if k!="enable" }
|
||||
okd = { for k, v in var.okd : k => v if k!="enable" }
|
||||
}
|
||||
|
||||
resource "kubernetes_namespace_v1" "infra-ns" {
|
||||
count = ( var.dns.enable )? 1 : 0
|
||||
count = ( var.dns.enable || var.okd.enable )? 1 : 0
|
||||
metadata {
|
||||
annotations = local.annotations
|
||||
labels = merge(local.common-labels, local.annotations)
|
||||
@@ -48,7 +49,6 @@ resource "kubectl_manifest" "dns" {
|
||||
|
||||
resource "kubectl_manifest" "traefik" {
|
||||
count = var.traefik.enable ? 1 : 0
|
||||
depends_on = [kubernetes_namespace_v1.infra-ns]
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
@@ -63,9 +63,9 @@ resource "kubectl_manifest" "traefik" {
|
||||
options: ${jsonencode(merge(local.global, local.traefik))}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "k8s_api" {
|
||||
count = var.traefik.enable ? 1 : 0
|
||||
depends_on = [kubernetes_namespace_v1.infra-ns]
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
@@ -80,3 +80,21 @@ resource "kubectl_manifest" "k8s_api" {
|
||||
options: ${jsonencode(merge(local.global, local.api))}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "okd" {
|
||||
count = var.okd.enable ? 1 : 0
|
||||
depends_on = [kubernetes_namespace_v1.infra-ns]
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: "vynil.solidite.fr/v1"
|
||||
kind: "Install"
|
||||
metadata:
|
||||
name: "okd"
|
||||
namespace: "${kubernetes_namespace_v1.infra-ns[0].metadata[0].name}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
spec:
|
||||
distrib: "${var.distributions.domain}"
|
||||
category: "apps"
|
||||
component: "okd"
|
||||
options: ${jsonencode(merge(local.global, local.okd))}
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -6,6 +6,116 @@ metadata:
|
||||
name: domain-infra
|
||||
description: null
|
||||
options:
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
app-group:
|
||||
default: infra
|
||||
examples:
|
||||
- infra
|
||||
type: string
|
||||
okd:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
traefik:
|
||||
default:
|
||||
enable: false
|
||||
namespace: traefik
|
||||
examples:
|
||||
- enable: false
|
||||
namespace: traefik
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
namespace:
|
||||
default: traefik
|
||||
type: string
|
||||
type: object
|
||||
api:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
storage-classes:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
examples:
|
||||
- BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
properties:
|
||||
BlockReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
BlockReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
dns:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
distributions:
|
||||
default:
|
||||
core: core
|
||||
domain: domain
|
||||
examples:
|
||||
- core: core
|
||||
domain: domain
|
||||
properties:
|
||||
core:
|
||||
default: core
|
||||
type: string
|
||||
domain:
|
||||
default: domain
|
||||
type: string
|
||||
type: object
|
||||
backups:
|
||||
default:
|
||||
enable: false
|
||||
@@ -36,106 +146,6 @@ options:
|
||||
default: backup-settings
|
||||
type: string
|
||||
type: object
|
||||
app-group:
|
||||
default: infra
|
||||
examples:
|
||||
- infra
|
||||
type: string
|
||||
traefik:
|
||||
default:
|
||||
enable: false
|
||||
namespace: traefik
|
||||
examples:
|
||||
- enable: false
|
||||
namespace: traefik
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
namespace:
|
||||
default: traefik
|
||||
type: string
|
||||
type: object
|
||||
dns:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
api:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
distributions:
|
||||
default:
|
||||
core: core
|
||||
domain: domain
|
||||
examples:
|
||||
- core: core
|
||||
domain: domain
|
||||
properties:
|
||||
core:
|
||||
default: core
|
||||
type: string
|
||||
domain:
|
||||
default: domain
|
||||
type: string
|
||||
type: object
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
storage-classes:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
examples:
|
||||
- BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
properties:
|
||||
BlockReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
BlockReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
dependencies: []
|
||||
providers:
|
||||
kubernetes: true
|
||||
@@ -144,4 +154,5 @@ providers:
|
||||
postgresql: null
|
||||
restapi: null
|
||||
http: null
|
||||
gitea: null
|
||||
tfaddtype: null
|
||||
|
||||
Reference in New Issue
Block a user