From ed58ef54e16d3e7f89e3ffd6ed27a7b94eea149f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Sun, 12 May 2024 13:09:50 +0200 Subject: [PATCH] Fix olm --- core/olm/index.rhai | 16 ++ core/olm/index.yaml | 5 + ...com_v1_OperatorGroup_global-operators.yaml | 5 - core/olm/operators.tf | 17 ++ meta/addons/index.yaml | 150 ++++++++++++++++++ 5 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 core/olm/index.rhai delete mode 100644 core/olm/operators.coreos.com_v1_OperatorGroup_global-operators.yaml create mode 100644 core/olm/operators.tf diff --git a/core/olm/index.rhai b/core/olm/index.rhai new file mode 100644 index 0000000..a4e6e38 --- /dev/null +++ b/core/olm/index.rhai @@ -0,0 +1,16 @@ +const VERSION="0.27.0"; +const SRC=src; +const DEST=dest; +const DOIT=config.apply; +const sourcesDir=`https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v${VERSION}`; +const sources=[ + "olm.yaml" +]; +fn pre_pack() { + for file in global::sources { + shell(`curl -sL ${global::sourcesDir}/${file} > ${global::SRC}/${file}`); + } +} +fn post_pack() { + shell(`rm -f "${global::DEST}/operators.coreos.com_v1_OperatorGroup_global-operators.yaml" "${global::DEST}"/apiextensions*.yaml "${global::DEST}"/v1_Namespace*.yaml "${global::DEST}"/batch_v1_*.yaml`); +} diff --git a/core/olm/index.yaml b/core/olm/index.yaml index 6d02294..88f27ee 100644 --- a/core/olm/index.yaml +++ b/core/olm/index.yaml @@ -45,6 +45,11 @@ options: type: string type: object type: object + operators_namespace: + default: vynil-operators + examples: + - vynil-operators + type: string dependencies: - dist: null category: crd diff --git a/core/olm/operators.coreos.com_v1_OperatorGroup_global-operators.yaml b/core/olm/operators.coreos.com_v1_OperatorGroup_global-operators.yaml deleted file mode 100644 index 09fab40..0000000 --- a/core/olm/operators.coreos.com_v1_OperatorGroup_global-operators.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: global-operators - namespace: operators \ No newline at end of file diff --git a/core/olm/operators.tf b/core/olm/operators.tf new file mode 100644 index 0000000..71b13e8 --- /dev/null +++ b/core/olm/operators.tf @@ -0,0 +1,17 @@ +resource "kubernetes_namespace_v1" "operator_ns" { + metadata { + labels = local.common-labels + name = var.operators_namespace + } +} +resource "kubectl_manifest" "operator_group" { + depends_on = [kubernetes_namespace_v1.operator_ns] + yaml_body = <<-EOF + apiVersion: operators.coreos.com/v1 + kind: OperatorGroup + metadata: + name: global-operators + namespace: ${var.operators_namespace} + labels: ${jsonencode(local.common-labels)} + EOF +} diff --git a/meta/addons/index.yaml b/meta/addons/index.yaml index f2eb39d..22c5b34 100644 --- a/meta/addons/index.yaml +++ b/meta/addons/index.yaml @@ -6,6 +6,153 @@ metadata: name: addons description: addons meta-component installing all the addons components options: +<<<<<<< HEAD +======= + olm: + default: + enable: false + namespace: olm + examples: + - enable: false + namespace: olm + properties: + enable: + default: false + type: boolean + namespace: + default: olm + type: string + type: object + flux: + default: + enable: false + namespace: flux + examples: + - enable: false + namespace: flux + properties: + enable: + default: false + type: boolean + namespace: + default: flux + type: string + type: object + tools: + default: + keda: + enable: false + namespace: vynil-addons + node_problem_detector: + enable: false + examples: + - keda: + enable: false + namespace: vynil-addons + node_problem_detector: + enable: false + properties: + keda: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + namespace: + default: vynil-addons + type: string + node_problem_detector: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + type: object + monitor: + default: + jaeger: + enable: false + namespace: vynil-monitor + opentelemetry: + enable: false + prometheus: + enable: true + examples: + - jaeger: + enable: false + namespace: vynil-monitor + opentelemetry: + enable: false + prometheus: + enable: true + properties: + jaeger: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + namespace: + default: vynil-monitor + type: string + opentelemetry: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + prometheus: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + type: object + tekton: + default: + namespace: tekton + tekton_pipelines: + enable: false + tekton_triggers: + enable: false + examples: + - namespace: tekton + tekton_pipelines: + enable: false + tekton_triggers: + enable: false + properties: + namespace: + default: tekton + type: string + tekton_pipelines: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + tekton_triggers: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + type: object +>>>>>>> e51ed83 (Disable olm and flux by default) crds: default: argo-cd: @@ -215,6 +362,7 @@ options: type: boolean type: object type: object +<<<<<<< HEAD fission: default: enable: false @@ -418,6 +566,8 @@ options: default: vynil-virt type: string type: object +======= +>>>>>>> e51ed83 (Disable olm and flux by default) dependencies: [] providers: kubernetes: true