From 2aeea3f6fab61b3f8662635049f611668e1800ca Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 17 Mar 2026 09:20:32 +0800 Subject: [PATCH 01/34] Add moduletemplates --- Makefile | 5 +- config/addons/cdi/deploy/kustomization.yaml | 8 ++ config/addons/cdi/kustomization.yaml | 8 ++ config/addons/cdi/module.yaml | 6 ++ config/addons/cdi/moduletemplate.yaml | 24 +++++ .../charts/gpu-operator/helmrepository.yaml | 8 ++ .../charts/gpu-operator/kustomization.yaml | 7 ++ config/addons/charts/gpu-operator/module.yaml | 6 ++ .../charts/gpu-operator/moduletemplate.yaml | 77 ++++++++++++++ config/addons/charts/hami/helmrepository.yaml | 8 ++ config/addons/charts/hami/kustomization.yaml | 7 ++ config/addons/charts/hami/module.yaml | 6 ++ config/addons/charts/hami/moduletemplate.yaml | 71 +++++++++++++ .../addons/charts/istio/helmrepository.yaml | 8 ++ config/addons/charts/istio/kustomization.yaml | 14 +++ config/addons/charts/istio/module-base.yaml | 6 ++ .../addons/charts/istio/module-gateway.yaml | 6 ++ config/addons/charts/istio/module-istiod.yaml | 6 ++ .../charts/istio/moduletemplate-base.yaml | 42 ++++++++ .../charts/istio/moduletemplate-gateway.yaml | 45 ++++++++ .../charts/istio/moduletemplate-istiod.yaml | 47 ++++++++ config/addons/charts/kustomization.yaml | 24 +++++ .../charts/llm-d-infra/helmrepository.yaml | 8 ++ .../charts/llm-d-infra/kustomization.yaml | 8 ++ config/addons/charts/llm-d-infra/module.yaml | 6 ++ .../charts/llm-d-infra/moduletemplate.yaml | 58 ++++++++++ .../gpu-operator-helmrepository.yaml | 8 ++ .../gpu-operator-moduletemplate.yaml | 77 ++++++++++++++ .../module-templates/hami-helmrepository.yaml | 8 ++ .../module-templates/hami-moduletemplate.yaml | 71 +++++++++++++ .../istio-helmrepository.yaml | 8 ++ .../istio-moduletemplate-base.yaml | 42 ++++++++ .../istio-moduletemplate-gateway.yaml | 45 ++++++++ .../istio-moduletemplate-istiod.yaml | 47 ++++++++ .../module-templates/kustomization.yaml | 21 ++++ .../llm-d-infra-helmrepository.yaml | 8 ++ .../llm-d-infra-moduletemplate.yaml | 58 ++++++++++ .../prometheus-helmrepository.yaml | 8 ++ .../prometheus-moduletemplate.yaml | 100 ++++++++++++++++++ .../charts/prometheus/helmrepository.yaml | 8 ++ .../charts/prometheus/kustomization.yaml | 10 ++ config/addons/charts/prometheus/module.yaml | 6 ++ .../charts/prometheus/moduletemplate.yaml | 100 ++++++++++++++++++ .../gateway-api/deploy/kustomization.yaml | 6 ++ config/addons/gateway-api/kustomization.yaml | 6 ++ config/addons/gateway-api/module.yaml | 6 ++ config/addons/gateway-api/moduletemplate.yaml | 20 ++++ config/addons/gitrepository.yaml | 12 +++ .../addons/kubevirt/deploy/kustomization.yaml | 8 ++ config/addons/kubevirt/kustomization.yaml | 6 ++ config/addons/kubevirt/module.yaml | 6 ++ config/addons/kubevirt/moduletemplate.yaml | 21 ++++ config/addons/kustomization.yaml | 49 +++++++++ .../cluster/deploy/kustomization.yaml | 6 ++ .../rook-ceph/cluster/kustomization.yaml | 6 ++ config/addons/rook-ceph/cluster/module.yaml | 6 ++ .../rook-ceph/cluster/moduletemplate.yaml | 20 ++++ .../rook-ceph/deploy/kustomization.yaml | 8 ++ config/addons/rook-ceph/kustomization.yaml | 6 ++ config/addons/rook-ceph/module.yaml | 6 ++ config/addons/rook-ceph/moduletemplate.yaml | 20 ++++ config/addons/samba/deploy/kustomization.yaml | 6 ++ config/addons/samba/kustomization.yaml | 6 ++ config/addons/samba/module.yaml | 6 ++ config/addons/samba/moduletemplate.yaml | 20 ++++ 65 files changed, 1398 insertions(+), 2 deletions(-) create mode 100644 config/addons/cdi/deploy/kustomization.yaml create mode 100644 config/addons/cdi/kustomization.yaml create mode 100644 config/addons/cdi/module.yaml create mode 100644 config/addons/cdi/moduletemplate.yaml create mode 100644 config/addons/charts/gpu-operator/helmrepository.yaml create mode 100644 config/addons/charts/gpu-operator/kustomization.yaml create mode 100644 config/addons/charts/gpu-operator/module.yaml create mode 100644 config/addons/charts/gpu-operator/moduletemplate.yaml create mode 100644 config/addons/charts/hami/helmrepository.yaml create mode 100644 config/addons/charts/hami/kustomization.yaml create mode 100644 config/addons/charts/hami/module.yaml create mode 100644 config/addons/charts/hami/moduletemplate.yaml create mode 100644 config/addons/charts/istio/helmrepository.yaml create mode 100644 config/addons/charts/istio/kustomization.yaml create mode 100644 config/addons/charts/istio/module-base.yaml create mode 100644 config/addons/charts/istio/module-gateway.yaml create mode 100644 config/addons/charts/istio/module-istiod.yaml create mode 100644 config/addons/charts/istio/moduletemplate-base.yaml create mode 100644 config/addons/charts/istio/moduletemplate-gateway.yaml create mode 100644 config/addons/charts/istio/moduletemplate-istiod.yaml create mode 100644 config/addons/charts/kustomization.yaml create mode 100644 config/addons/charts/llm-d-infra/helmrepository.yaml create mode 100644 config/addons/charts/llm-d-infra/kustomization.yaml create mode 100644 config/addons/charts/llm-d-infra/module.yaml create mode 100644 config/addons/charts/llm-d-infra/moduletemplate.yaml create mode 100644 config/addons/charts/module-templates/gpu-operator-helmrepository.yaml create mode 100644 config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml create mode 100644 config/addons/charts/module-templates/hami-helmrepository.yaml create mode 100644 config/addons/charts/module-templates/hami-moduletemplate.yaml create mode 100644 config/addons/charts/module-templates/istio-helmrepository.yaml create mode 100644 config/addons/charts/module-templates/istio-moduletemplate-base.yaml create mode 100644 config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml create mode 100644 config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml create mode 100644 config/addons/charts/module-templates/kustomization.yaml create mode 100644 config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml create mode 100644 config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml create mode 100644 config/addons/charts/module-templates/prometheus-helmrepository.yaml create mode 100644 config/addons/charts/module-templates/prometheus-moduletemplate.yaml create mode 100644 config/addons/charts/prometheus/helmrepository.yaml create mode 100644 config/addons/charts/prometheus/kustomization.yaml create mode 100644 config/addons/charts/prometheus/module.yaml create mode 100644 config/addons/charts/prometheus/moduletemplate.yaml create mode 100644 config/addons/gateway-api/deploy/kustomization.yaml create mode 100644 config/addons/gateway-api/kustomization.yaml create mode 100644 config/addons/gateway-api/module.yaml create mode 100644 config/addons/gateway-api/moduletemplate.yaml create mode 100644 config/addons/gitrepository.yaml create mode 100644 config/addons/kubevirt/deploy/kustomization.yaml create mode 100644 config/addons/kubevirt/kustomization.yaml create mode 100644 config/addons/kubevirt/module.yaml create mode 100644 config/addons/kubevirt/moduletemplate.yaml create mode 100644 config/addons/kustomization.yaml create mode 100644 config/addons/rook-ceph/cluster/deploy/kustomization.yaml create mode 100644 config/addons/rook-ceph/cluster/kustomization.yaml create mode 100644 config/addons/rook-ceph/cluster/module.yaml create mode 100644 config/addons/rook-ceph/cluster/moduletemplate.yaml create mode 100644 config/addons/rook-ceph/deploy/kustomization.yaml create mode 100644 config/addons/rook-ceph/kustomization.yaml create mode 100644 config/addons/rook-ceph/module.yaml create mode 100644 config/addons/rook-ceph/moduletemplate.yaml create mode 100644 config/addons/samba/deploy/kustomization.yaml create mode 100644 config/addons/samba/kustomization.yaml create mode 100644 config/addons/samba/module.yaml create mode 100644 config/addons/samba/moduletemplate.yaml diff --git a/Makefile b/Makefile index b3427c2..0f700b2 100644 --- a/Makefile +++ b/Makefile @@ -158,10 +158,11 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform rm Dockerfile.cross .PHONY: build-installer -build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment. +build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate), dist/addons-bundle.yaml. mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - "$(KUSTOMIZE)" build config/default > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/charts/module-templates; } > dist/install.yaml + "$(KUSTOMIZE)" build config/addons > dist/addons-bundle.yaml ##@ Deployment diff --git a/config/addons/cdi/deploy/kustomization.yaml b/config/addons/cdi/deploy/kustomization.yaml new file mode 100644 index 0000000..0c9c281 --- /dev/null +++ b/config/addons/cdi/deploy/kustomization.yaml @@ -0,0 +1,8 @@ +# CDI deployment — remote resources for FluxCD Kustomization +# Source: https://github.com/kubevirt/containerized-data-importer +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/kubevirt/containerized-data-importer/releases/download/v1.64.0/cdi-operator.yaml + - https://github.com/kubevirt/containerized-data-importer/releases/download/v1.64.0/cdi-cr.yaml diff --git a/config/addons/cdi/kustomization.yaml b/config/addons/cdi/kustomization.yaml new file mode 100644 index 0000000..298ef6c --- /dev/null +++ b/config/addons/cdi/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# CDI — ModuleTemplate + kustomization pattern (like prometheus) +# Deploy order: GitRepository first, then ModuleTemplate, then Module +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/cdi/module.yaml b/config/addons/cdi/module.yaml new file mode 100644 index 0000000..499813f --- /dev/null +++ b/config/addons/cdi/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: cdi +spec: + templateRef: cdi diff --git a/config/addons/cdi/moduletemplate.yaml b/config/addons/cdi/moduletemplate.yaml new file mode 100644 index 0000000..4650c33 --- /dev/null +++ b/config/addons/cdi/moduletemplate.yaml @@ -0,0 +1,24 @@ +# ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 +# Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. +# +# Prerequisite: GitRepository (otterscale-module-operator) must exist in flux-system. +# Apply: kubectl apply -k config/addons/cdi/ +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: cdi +spec: + namespace: cdi + + description: >- + Containerized Data Importer v1.64.0 — PVC data import for KubeVirt VM disk images. + Deploys via FluxCD Kustomization from upstream release YAMLs. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/cdi/deploy diff --git a/config/addons/charts/gpu-operator/helmrepository.yaml b/config/addons/charts/gpu-operator/helmrepository.yaml new file mode 100644 index 0000000..ccffef3 --- /dev/null +++ b/config/addons/charts/gpu-operator/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: nvidia-gpu-operator + namespace: flux-system +spec: + interval: 24h + url: https://nvidia.github.io/gpu-operator diff --git a/config/addons/charts/gpu-operator/kustomization.yaml b/config/addons/charts/gpu-operator/kustomization.yaml new file mode 100644 index 0000000..3d1af02 --- /dev/null +++ b/config/addons/charts/gpu-operator/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - helmrepository.yaml + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/charts/gpu-operator/module.yaml b/config/addons/charts/gpu-operator/module.yaml new file mode 100644 index 0000000..cedca04 --- /dev/null +++ b/config/addons/charts/gpu-operator/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: gpu-operator +spec: + templateRef: gpu-operator diff --git a/config/addons/charts/gpu-operator/moduletemplate.yaml b/config/addons/charts/gpu-operator/moduletemplate.yaml new file mode 100644 index 0000000..3d7fc5c --- /dev/null +++ b/config/addons/charts/gpu-operator/moduletemplate.yaml @@ -0,0 +1,77 @@ +# ModuleTemplate — NVIDIA GPU Operator blueprint +# +# Deploys NVIDIA GPU Operator for driver, DCGM, DCGM Exporter, Node Status Exporter. +# Device plugin and vGPU are disabled (use HAMI for GPU sharing). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: gpu-operator +spec: + namespace: gpu-operator + + description: >- + Deploys NVIDIA GPU Operator (driver 580.x, DCGM, DCGM Exporter, Node Status Exporter). + Device plugin disabled for use with HAMI vGPU. + + helmRelease: + interval: 10m + + chart: + spec: + chart: gpu-operator + version: "25.10.1" + sourceRef: + kind: HelmRepository + name: nvidia-gpu-operator + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + cdi: + enabled: false + + driver: + enabled: true + version: "580.105.08" + upgradePolicy: + autoUpgrade: false + + # 離線版本 (取消註解以啟用) + # driver: + # version: "580" + # usePrecompiled: true + + devicePlugin: + enabled: false + + operator: + cleanupCRD: true + upgradeCRD: false + + dcgm: + enabled: true + + dcgmExporter: + enabled: true + serviceMonitor: + enabled: true + + nodeStatusExporter: + enabled: true + + vgpuDeviceManager: + enabled: false diff --git a/config/addons/charts/hami/helmrepository.yaml b/config/addons/charts/hami/helmrepository.yaml new file mode 100644 index 0000000..1b787a4 --- /dev/null +++ b/config/addons/charts/hami/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: hami + namespace: flux-system +spec: + interval: 24h + url: https://project-hami.github.io/HAMi/ diff --git a/config/addons/charts/hami/kustomization.yaml b/config/addons/charts/hami/kustomization.yaml new file mode 100644 index 0000000..3d1af02 --- /dev/null +++ b/config/addons/charts/hami/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - helmrepository.yaml + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/charts/hami/module.yaml b/config/addons/charts/hami/module.yaml new file mode 100644 index 0000000..a050802 --- /dev/null +++ b/config/addons/charts/hami/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: hami +spec: + templateRef: hami diff --git a/config/addons/charts/hami/moduletemplate.yaml b/config/addons/charts/hami/moduletemplate.yaml new file mode 100644 index 0000000..d555fbf --- /dev/null +++ b/config/addons/charts/hami/moduletemplate.yaml @@ -0,0 +1,71 @@ +# ModuleTemplate — HAMI (Heterogeneous AI Computing Virtualization) blueprint +# +# Deploys HAMI for GPU sharing (vGPU) with NVIDIA GPU Operator. +# Requires GPU Operator to be installed first (driver + nvidia-validations). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: hami +spec: + # HAMI scheduler and device plugin typically run in kube-system + namespace: kube-system + + description: >- + Deploys HAMI for GPU sharing (vGPU) with device split, memory/core scaling. + Integrates with NVIDIA GPU Operator via gpuOperatorToolkitReady. + + helmRelease: + interval: 10m + + chart: + spec: + chart: hami + version: "2.8.0" + sourceRef: + kind: HelmRepository + name: hami + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + global: + imageTag: "v2.8.0" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "31992" + # managedNodeSelectorEnable: false + # managedNodeSelector: + # usage: "nvidia.com/gpu.workload.config" + + scheduler: + service: + type: ClusterIP + + devicePlugin: + enabled: true + gpuOperatorToolkitReady: + enabled: true + hostPath: "/run/nvidia/validations" + deviceSplitCount: 10 + deviceMemoryScaling: 1 + deviceCoreScaling: 1 + service: + type: ClusterIP + runtimeClassName: "nvidia" + nvidiaNodeSelector: + gpu: null + nvidia.com/gpu.workload.config: "vgpu" diff --git a/config/addons/charts/istio/helmrepository.yaml b/config/addons/charts/istio/helmrepository.yaml new file mode 100644 index 0000000..41ffd7d --- /dev/null +++ b/config/addons/charts/istio/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: istio + namespace: flux-system +spec: + interval: 24h + url: https://istio-release.storage.googleapis.com/charts diff --git a/config/addons/charts/istio/kustomization.yaml b/config/addons/charts/istio/kustomization.yaml new file mode 100644 index 0000000..ab50910 --- /dev/null +++ b/config/addons/charts/istio/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# Deploy order: base → istiod → gateway +# Ensure istio-base is ready before istiod (FluxCD reconciles independently; +# consider applying in sequence or using dependsOn if needed). +resources: + - helmrepository.yaml + - moduletemplate-base.yaml + - moduletemplate-istiod.yaml + - moduletemplate-gateway.yaml + - module-base.yaml + - module-istiod.yaml + - module-gateway.yaml diff --git a/config/addons/charts/istio/module-base.yaml b/config/addons/charts/istio/module-base.yaml new file mode 100644 index 0000000..a86b4bc --- /dev/null +++ b/config/addons/charts/istio/module-base.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: istio-base +spec: + templateRef: istio-base diff --git a/config/addons/charts/istio/module-gateway.yaml b/config/addons/charts/istio/module-gateway.yaml new file mode 100644 index 0000000..d0a1a7b --- /dev/null +++ b/config/addons/charts/istio/module-gateway.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: istio-gateway +spec: + templateRef: istio-gateway diff --git a/config/addons/charts/istio/module-istiod.yaml b/config/addons/charts/istio/module-istiod.yaml new file mode 100644 index 0000000..1972b47 --- /dev/null +++ b/config/addons/charts/istio/module-istiod.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: istiod +spec: + templateRef: istiod diff --git a/config/addons/charts/istio/moduletemplate-base.yaml b/config/addons/charts/istio/moduletemplate-base.yaml new file mode 100644 index 0000000..0e783c9 --- /dev/null +++ b/config/addons/charts/istio/moduletemplate-base.yaml @@ -0,0 +1,42 @@ +# ModuleTemplate — Istio base (CRDs) +# +# Installs Istio base chart (CRDs). Must be applied before istiod. +# See: https://istio.io/latest/docs/setup/install/helm/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istio-base +spec: + namespace: istio-system + + description: >- + Installs Istio base chart (CRDs). Required before istiod. + + helmRelease: + interval: 10m + + chart: + spec: + chart: base + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 10m + + values: + defaultRevision: default diff --git a/config/addons/charts/istio/moduletemplate-gateway.yaml b/config/addons/charts/istio/moduletemplate-gateway.yaml new file mode 100644 index 0000000..c65f128 --- /dev/null +++ b/config/addons/charts/istio/moduletemplate-gateway.yaml @@ -0,0 +1,45 @@ +# ModuleTemplate — Istio Ingress Gateway +# +# Installs Istio ingress gateway. Optional; deploy after istiod. +# See: https://istio.io/latest/docs/setup/additional-setup/gateway/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istio-gateway +spec: + namespace: istio-ingress + + description: >- + Installs Istio ingress gateway for north-south traffic. + + helmRelease: + interval: 10m + + dependsOn: + - name: istiod + namespace: istio-system + + chart: + spec: + chart: gateway + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 10m + + values: {} diff --git a/config/addons/charts/istio/moduletemplate-istiod.yaml b/config/addons/charts/istio/moduletemplate-istiod.yaml new file mode 100644 index 0000000..2dc39e9 --- /dev/null +++ b/config/addons/charts/istio/moduletemplate-istiod.yaml @@ -0,0 +1,47 @@ +# ModuleTemplate — Istiod (Istio control plane) +# +# Installs Istiod control plane. Requires istio-base to be installed first. +# See: https://istio.io/latest/docs/setup/install/helm/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istiod +spec: + namespace: istio-system + + description: >- + Installs Istiod (Istio control plane / discovery server). + + helmRelease: + interval: 10m + + dependsOn: + - name: istio-base + namespace: istio-system + + chart: + spec: + chart: istiod + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 15m + + values: + env: + ENABLE_GATEWAY_API_INFERENCE_EXTENSION: "true" diff --git a/config/addons/charts/kustomization.yaml b/config/addons/charts/kustomization.yaml new file mode 100644 index 0000000..1de234c --- /dev/null +++ b/config/addons/charts/kustomization.yaml @@ -0,0 +1,24 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# 一次部署所有 OtterScale Module 元件(HelmRepository + ModuleTemplate + Module)。 +# +# 部署順序由 Kustomize 依 resources 清單順序決定: +# 1. gpu-operator/ — NVIDIA GPU Operator(driver + DCGM) +# 2. hami/ — HAMI vGPU sharing(依賴 gpu-operator) +# 3. prometheus/ — kube-prometheus-stack 監控套件 +# +# 使用方式: +# # 預覽所有將套用的資源 +# kubectl kustomize config/addons/charts/ +# +# # 直接套用到叢集 +# kubectl apply -k config/addons/charts/ +# +# 若只需部署單一元件,請進入子目錄執行: +# kubectl apply -k config/addons/charts/gpu-operator/ + +resources: + - gpu-operator/ + - hami/ + - prometheus/ diff --git a/config/addons/charts/llm-d-infra/helmrepository.yaml b/config/addons/charts/llm-d-infra/helmrepository.yaml new file mode 100644 index 0000000..2822645 --- /dev/null +++ b/config/addons/charts/llm-d-infra/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: llm-d-infra + namespace: flux-system +spec: + interval: 24h + url: https://llm-d-incubation.github.io/llm-d-infra/ diff --git a/config/addons/charts/llm-d-infra/kustomization.yaml b/config/addons/charts/llm-d-infra/kustomization.yaml new file mode 100644 index 0000000..a9a747a --- /dev/null +++ b/config/addons/charts/llm-d-infra/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# Deploy after Istio (or other Gateway controller) is ready. +resources: + - helmrepository.yaml + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/charts/llm-d-infra/module.yaml b/config/addons/charts/llm-d-infra/module.yaml new file mode 100644 index 0000000..7f19b5d --- /dev/null +++ b/config/addons/charts/llm-d-infra/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: llm-d-infra +spec: + templateRef: llm-d-infra diff --git a/config/addons/charts/llm-d-infra/moduletemplate.yaml b/config/addons/charts/llm-d-infra/moduletemplate.yaml new file mode 100644 index 0000000..3140fac --- /dev/null +++ b/config/addons/charts/llm-d-infra/moduletemplate.yaml @@ -0,0 +1,58 @@ +# ModuleTemplate — llm-d-infra blueprint +# +# Deploys llm-d infrastructure components: Gateway API configs, Helm charts, +# and operational tooling for llm-d (Kubernetes-native distributed LLM inference). +# +# Prerequisites: +# - Kubernetes 1.28+ +# - Gateway API v1.4.0+ installed +# - Gateway controller (Istio, Kgateway, AgentGateway or GKE) deployed +# +# See: https://github.com/llm-d-incubation/llm-d-infra +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: llm-d-infra +spec: + namespace: llm-d-infra + + description: >- + Deploys llm-d infrastructure (Gateway API, service mesh integration) + for high-performance distributed LLM inference framework. + + helmRelease: + interval: 10m + + chart: + spec: + chart: llm-d-infra + version: "1.3.10" + sourceRef: + kind: HelmRepository + name: llm-d-infra + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + gateway: + gatewayParameters: + resources: + limits: + cpu: "2" + memory: "1Gi" + service: + type: NodePort diff --git a/config/addons/charts/module-templates/gpu-operator-helmrepository.yaml b/config/addons/charts/module-templates/gpu-operator-helmrepository.yaml new file mode 100644 index 0000000..ccffef3 --- /dev/null +++ b/config/addons/charts/module-templates/gpu-operator-helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: nvidia-gpu-operator + namespace: flux-system +spec: + interval: 24h + url: https://nvidia.github.io/gpu-operator diff --git a/config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml b/config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml new file mode 100644 index 0000000..3d7fc5c --- /dev/null +++ b/config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml @@ -0,0 +1,77 @@ +# ModuleTemplate — NVIDIA GPU Operator blueprint +# +# Deploys NVIDIA GPU Operator for driver, DCGM, DCGM Exporter, Node Status Exporter. +# Device plugin and vGPU are disabled (use HAMI for GPU sharing). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: gpu-operator +spec: + namespace: gpu-operator + + description: >- + Deploys NVIDIA GPU Operator (driver 580.x, DCGM, DCGM Exporter, Node Status Exporter). + Device plugin disabled for use with HAMI vGPU. + + helmRelease: + interval: 10m + + chart: + spec: + chart: gpu-operator + version: "25.10.1" + sourceRef: + kind: HelmRepository + name: nvidia-gpu-operator + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + cdi: + enabled: false + + driver: + enabled: true + version: "580.105.08" + upgradePolicy: + autoUpgrade: false + + # 離線版本 (取消註解以啟用) + # driver: + # version: "580" + # usePrecompiled: true + + devicePlugin: + enabled: false + + operator: + cleanupCRD: true + upgradeCRD: false + + dcgm: + enabled: true + + dcgmExporter: + enabled: true + serviceMonitor: + enabled: true + + nodeStatusExporter: + enabled: true + + vgpuDeviceManager: + enabled: false diff --git a/config/addons/charts/module-templates/hami-helmrepository.yaml b/config/addons/charts/module-templates/hami-helmrepository.yaml new file mode 100644 index 0000000..1b787a4 --- /dev/null +++ b/config/addons/charts/module-templates/hami-helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: hami + namespace: flux-system +spec: + interval: 24h + url: https://project-hami.github.io/HAMi/ diff --git a/config/addons/charts/module-templates/hami-moduletemplate.yaml b/config/addons/charts/module-templates/hami-moduletemplate.yaml new file mode 100644 index 0000000..d555fbf --- /dev/null +++ b/config/addons/charts/module-templates/hami-moduletemplate.yaml @@ -0,0 +1,71 @@ +# ModuleTemplate — HAMI (Heterogeneous AI Computing Virtualization) blueprint +# +# Deploys HAMI for GPU sharing (vGPU) with NVIDIA GPU Operator. +# Requires GPU Operator to be installed first (driver + nvidia-validations). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: hami +spec: + # HAMI scheduler and device plugin typically run in kube-system + namespace: kube-system + + description: >- + Deploys HAMI for GPU sharing (vGPU) with device split, memory/core scaling. + Integrates with NVIDIA GPU Operator via gpuOperatorToolkitReady. + + helmRelease: + interval: 10m + + chart: + spec: + chart: hami + version: "2.8.0" + sourceRef: + kind: HelmRepository + name: hami + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + global: + imageTag: "v2.8.0" + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "31992" + # managedNodeSelectorEnable: false + # managedNodeSelector: + # usage: "nvidia.com/gpu.workload.config" + + scheduler: + service: + type: ClusterIP + + devicePlugin: + enabled: true + gpuOperatorToolkitReady: + enabled: true + hostPath: "/run/nvidia/validations" + deviceSplitCount: 10 + deviceMemoryScaling: 1 + deviceCoreScaling: 1 + service: + type: ClusterIP + runtimeClassName: "nvidia" + nvidiaNodeSelector: + gpu: null + nvidia.com/gpu.workload.config: "vgpu" diff --git a/config/addons/charts/module-templates/istio-helmrepository.yaml b/config/addons/charts/module-templates/istio-helmrepository.yaml new file mode 100644 index 0000000..41ffd7d --- /dev/null +++ b/config/addons/charts/module-templates/istio-helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: istio + namespace: flux-system +spec: + interval: 24h + url: https://istio-release.storage.googleapis.com/charts diff --git a/config/addons/charts/module-templates/istio-moduletemplate-base.yaml b/config/addons/charts/module-templates/istio-moduletemplate-base.yaml new file mode 100644 index 0000000..0e783c9 --- /dev/null +++ b/config/addons/charts/module-templates/istio-moduletemplate-base.yaml @@ -0,0 +1,42 @@ +# ModuleTemplate — Istio base (CRDs) +# +# Installs Istio base chart (CRDs). Must be applied before istiod. +# See: https://istio.io/latest/docs/setup/install/helm/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istio-base +spec: + namespace: istio-system + + description: >- + Installs Istio base chart (CRDs). Required before istiod. + + helmRelease: + interval: 10m + + chart: + spec: + chart: base + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 10m + + values: + defaultRevision: default diff --git a/config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml b/config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml new file mode 100644 index 0000000..c65f128 --- /dev/null +++ b/config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml @@ -0,0 +1,45 @@ +# ModuleTemplate — Istio Ingress Gateway +# +# Installs Istio ingress gateway. Optional; deploy after istiod. +# See: https://istio.io/latest/docs/setup/additional-setup/gateway/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istio-gateway +spec: + namespace: istio-ingress + + description: >- + Installs Istio ingress gateway for north-south traffic. + + helmRelease: + interval: 10m + + dependsOn: + - name: istiod + namespace: istio-system + + chart: + spec: + chart: gateway + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 10m + + values: {} diff --git a/config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml b/config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml new file mode 100644 index 0000000..2dc39e9 --- /dev/null +++ b/config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml @@ -0,0 +1,47 @@ +# ModuleTemplate — Istiod (Istio control plane) +# +# Installs Istiod control plane. Requires istio-base to be installed first. +# See: https://istio.io/latest/docs/setup/install/helm/ +# +# Apply order: base → istiod → gateway +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: istiod +spec: + namespace: istio-system + + description: >- + Installs Istiod (Istio control plane / discovery server). + + helmRelease: + interval: 10m + + dependsOn: + - name: istio-base + namespace: istio-system + + chart: + spec: + chart: istiod + version: "1.29.1" + sourceRef: + kind: HelmRepository + name: istio + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 15m + + values: + env: + ENABLE_GATEWAY_API_INFERENCE_EXTENSION: "true" diff --git a/config/addons/charts/module-templates/kustomization.yaml b/config/addons/charts/module-templates/kustomization.yaml new file mode 100644 index 0000000..571bc92 --- /dev/null +++ b/config/addons/charts/module-templates/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# ModuleTemplate + HelmRepository only (no Module CRs). +# Used by build-installer to generate dist/module-templates.yaml +# +# Included: gpu-operator, hami, prometheus, istio, llm-d-infra +# Order: HelmRepository first (sources), then ModuleTemplate +resources: + - gpu-operator-helmrepository.yaml + - gpu-operator-moduletemplate.yaml + - hami-helmrepository.yaml + - hami-moduletemplate.yaml + - prometheus-helmrepository.yaml + - prometheus-moduletemplate.yaml + - istio-helmrepository.yaml + - istio-moduletemplate-base.yaml + - istio-moduletemplate-istiod.yaml + - istio-moduletemplate-gateway.yaml + - llm-d-infra-helmrepository.yaml + - llm-d-infra-moduletemplate.yaml diff --git a/config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml b/config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml new file mode 100644 index 0000000..2822645 --- /dev/null +++ b/config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: llm-d-infra + namespace: flux-system +spec: + interval: 24h + url: https://llm-d-incubation.github.io/llm-d-infra/ diff --git a/config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml b/config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml new file mode 100644 index 0000000..3140fac --- /dev/null +++ b/config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml @@ -0,0 +1,58 @@ +# ModuleTemplate — llm-d-infra blueprint +# +# Deploys llm-d infrastructure components: Gateway API configs, Helm charts, +# and operational tooling for llm-d (Kubernetes-native distributed LLM inference). +# +# Prerequisites: +# - Kubernetes 1.28+ +# - Gateway API v1.4.0+ installed +# - Gateway controller (Istio, Kgateway, AgentGateway or GKE) deployed +# +# See: https://github.com/llm-d-incubation/llm-d-infra +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: llm-d-infra +spec: + namespace: llm-d-infra + + description: >- + Deploys llm-d infrastructure (Gateway API, service mesh integration) + for high-performance distributed LLM inference framework. + + helmRelease: + interval: 10m + + chart: + spec: + chart: llm-d-infra + version: "1.3.10" + sourceRef: + kind: HelmRepository + name: llm-d-infra + namespace: flux-system + interval: 24h + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + force: false + + timeout: 30m + + values: + gateway: + gatewayParameters: + resources: + limits: + cpu: "2" + memory: "1Gi" + service: + type: NodePort diff --git a/config/addons/charts/module-templates/prometheus-helmrepository.yaml b/config/addons/charts/module-templates/prometheus-helmrepository.yaml new file mode 100644 index 0000000..8a54131 --- /dev/null +++ b/config/addons/charts/module-templates/prometheus-helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: prometheus-community + namespace: flux-system +spec: + interval: 24h + url: https://prometheus-community.github.io/helm-charts diff --git a/config/addons/charts/module-templates/prometheus-moduletemplate.yaml b/config/addons/charts/module-templates/prometheus-moduletemplate.yaml new file mode 100644 index 0000000..16a65d0 --- /dev/null +++ b/config/addons/charts/module-templates/prometheus-moduletemplate.yaml @@ -0,0 +1,100 @@ +# ModuleTemplate — kube-prometheus-stack blueprint +# +# Defines a reusable template for deploying the Prometheus monitoring stack +# (Prometheus + Alertmanager + Node Exporter, without Grafana) via FluxCD. +# +# IMPORTANT: Replace `storageClassName` with your cluster's actual StorageClass +# name before applying (e.g. standard, gp2, longhorn, etc.). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: prometheus-stack +spec: + # Target namespace where the FluxCD HelmRelease object (and by default the + # Helm release itself) will be created. Can be overridden per-Module via + # Module.spec.namespace. + namespace: prometheus-stack + + description: >- + Deploys kube-prometheus-stack (Prometheus, Alertmanager, Node Exporter) + with persistent storage and remote-write receiver enabled. + Grafana is disabled; metrics retention is set to 365 days / 40 GiB. + + # spec.helmRelease is the FluxCD HelmReleaseSpec (not a full HelmRelease). + # The controller instantiates a HelmRelease from this spec and places it + # in spec.namespace above. + helmRelease: + # Reconciliation interval — how often FluxCD re-checks drift. + interval: 10m + + # Helm chart source: pulls kube-prometheus-stack from the + # prometheus-community HelmRepository (see helmrepository.yaml). + chart: + spec: + chart: kube-prometheus-stack + # Pin to a specific chart version for reproducibility. + # Remove or set to "*" to always track the latest. + version: ">=65.0.0" + sourceRef: + kind: HelmRepository + name: prometheus-community + namespace: flux-system + # How often FluxCD polls the chart index for new versions. + interval: 24h + + # Install strategy: retry up to 3 times on failure. + install: + remediation: + retries: 3 + + # Upgrade strategy: retry up to 3 times; force resource replacement on + # field conflicts. + upgrade: + remediation: + retries: 3 + force: false + + # Maximum time allowed for a single Helm operation before it is + # considered a failure. + timeout: 30m + + # Helm values — equivalent to the `--set` flags in the original + # `helm install` command. + values: + prometheus: + prometheusSpec: + # Accept remote-write requests (useful for forwarding from edge clusters). + enableRemoteWriteReceiver: true + + # Data retention: keep up to 365 days or 40 GiB, whichever limit is hit first. + retention: "365d" + retentionSize: "40GiB" + + # Discover ServiceMonitors from all namespaces, not just those that + # match the Helm release labels. + serviceMonitorSelectorNilUsesHelmValues: false + + # Persistent storage for Prometheus TSDB. + # ⚠️ Replace `storageClassName` with the actual StorageClass on your cluster. + storageSpec: + volumeClaimTemplate: + spec: + # TODO: replace with your cluster's StorageClass (e.g. standard, gp2, longhorn) + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "40Gi" + service: + type: NodePort + + # Deploy Node Exporter on every node for host-level metrics. + nodeExporter: + enabled: true + + # Grafana is managed separately; disable the bundled instance. + grafana: + enabled: false diff --git a/config/addons/charts/prometheus/helmrepository.yaml b/config/addons/charts/prometheus/helmrepository.yaml new file mode 100644 index 0000000..8a54131 --- /dev/null +++ b/config/addons/charts/prometheus/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: prometheus-community + namespace: flux-system +spec: + interval: 24h + url: https://prometheus-community.github.io/helm-charts diff --git a/config/addons/charts/prometheus/kustomization.yaml b/config/addons/charts/prometheus/kustomization.yaml new file mode 100644 index 0000000..3ea9247 --- /dev/null +++ b/config/addons/charts/prometheus/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# Deploy order matters: source must exist before the HelmRelease is created, +# and the ModuleTemplate must exist before the Module references it. +# Resources are applied in the order listed below. +resources: + - helmrepository.yaml + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/charts/prometheus/module.yaml b/config/addons/charts/prometheus/module.yaml new file mode 100644 index 0000000..16164d1 --- /dev/null +++ b/config/addons/charts/prometheus/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: prometheus +spec: + templateRef: prometheus-stack diff --git a/config/addons/charts/prometheus/moduletemplate.yaml b/config/addons/charts/prometheus/moduletemplate.yaml new file mode 100644 index 0000000..16a65d0 --- /dev/null +++ b/config/addons/charts/prometheus/moduletemplate.yaml @@ -0,0 +1,100 @@ +# ModuleTemplate — kube-prometheus-stack blueprint +# +# Defines a reusable template for deploying the Prometheus monitoring stack +# (Prometheus + Alertmanager + Node Exporter, without Grafana) via FluxCD. +# +# IMPORTANT: Replace `storageClassName` with your cluster's actual StorageClass +# name before applying (e.g. standard, gp2, longhorn, etc.). +# +# Apply: +# kubectl apply -f moduletemplate.yaml +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: prometheus-stack +spec: + # Target namespace where the FluxCD HelmRelease object (and by default the + # Helm release itself) will be created. Can be overridden per-Module via + # Module.spec.namespace. + namespace: prometheus-stack + + description: >- + Deploys kube-prometheus-stack (Prometheus, Alertmanager, Node Exporter) + with persistent storage and remote-write receiver enabled. + Grafana is disabled; metrics retention is set to 365 days / 40 GiB. + + # spec.helmRelease is the FluxCD HelmReleaseSpec (not a full HelmRelease). + # The controller instantiates a HelmRelease from this spec and places it + # in spec.namespace above. + helmRelease: + # Reconciliation interval — how often FluxCD re-checks drift. + interval: 10m + + # Helm chart source: pulls kube-prometheus-stack from the + # prometheus-community HelmRepository (see helmrepository.yaml). + chart: + spec: + chart: kube-prometheus-stack + # Pin to a specific chart version for reproducibility. + # Remove or set to "*" to always track the latest. + version: ">=65.0.0" + sourceRef: + kind: HelmRepository + name: prometheus-community + namespace: flux-system + # How often FluxCD polls the chart index for new versions. + interval: 24h + + # Install strategy: retry up to 3 times on failure. + install: + remediation: + retries: 3 + + # Upgrade strategy: retry up to 3 times; force resource replacement on + # field conflicts. + upgrade: + remediation: + retries: 3 + force: false + + # Maximum time allowed for a single Helm operation before it is + # considered a failure. + timeout: 30m + + # Helm values — equivalent to the `--set` flags in the original + # `helm install` command. + values: + prometheus: + prometheusSpec: + # Accept remote-write requests (useful for forwarding from edge clusters). + enableRemoteWriteReceiver: true + + # Data retention: keep up to 365 days or 40 GiB, whichever limit is hit first. + retention: "365d" + retentionSize: "40GiB" + + # Discover ServiceMonitors from all namespaces, not just those that + # match the Helm release labels. + serviceMonitorSelectorNilUsesHelmValues: false + + # Persistent storage for Prometheus TSDB. + # ⚠️ Replace `storageClassName` with the actual StorageClass on your cluster. + storageSpec: + volumeClaimTemplate: + spec: + # TODO: replace with your cluster's StorageClass (e.g. standard, gp2, longhorn) + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "40Gi" + service: + type: NodePort + + # Deploy Node Exporter on every node for host-level metrics. + nodeExporter: + enabled: true + + # Grafana is managed separately; disable the bundled instance. + grafana: + enabled: false diff --git a/config/addons/gateway-api/deploy/kustomization.yaml b/config/addons/gateway-api/deploy/kustomization.yaml new file mode 100644 index 0000000..c8d041d --- /dev/null +++ b/config/addons/gateway-api/deploy/kustomization.yaml @@ -0,0 +1,6 @@ +# Gateway API v1.5.0 — Standard channel CRDs +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/standard-install.yaml diff --git a/config/addons/gateway-api/kustomization.yaml b/config/addons/gateway-api/kustomization.yaml new file mode 100644 index 0000000..3da2876 --- /dev/null +++ b/config/addons/gateway-api/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/gateway-api/module.yaml b/config/addons/gateway-api/module.yaml new file mode 100644 index 0000000..e360d85 --- /dev/null +++ b/config/addons/gateway-api/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: gateway-api +spec: + templateRef: gateway-api diff --git a/config/addons/gateway-api/moduletemplate.yaml b/config/addons/gateway-api/moduletemplate.yaml new file mode 100644 index 0000000..09c5e4f --- /dev/null +++ b/config/addons/gateway-api/moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Kubernetes Gateway API v1.5.0 (Standard channel) +# Uses FluxCD Kustomization. CRDs only (GatewayClass, Gateway, HTTPRoute, etc.) +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: gateway-api +spec: + namespace: gateway-api-system + + description: >- + Kubernetes Gateway API v1.5.0 — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gateway-api/deploy diff --git a/config/addons/gitrepository.yaml b/config/addons/gitrepository.yaml new file mode 100644 index 0000000..f0465d2 --- /dev/null +++ b/config/addons/gitrepository.yaml @@ -0,0 +1,12 @@ +# Shared GitRepository for addon ModuleTemplates (CDI, KubeVirt, etc.) +# All addon components deploy from this repo's config/addons/*/deploy paths. +apiVersion: source.toolkit.fluxcd.io/v1 +kind: GitRepository +metadata: + name: otterscale-module-operator + namespace: flux-system +spec: + interval: 1h + url: https://github.com/otterscale/module-operator + ref: + branch: feat/add_addons_templates diff --git a/config/addons/kubevirt/deploy/kustomization.yaml b/config/addons/kubevirt/deploy/kustomization.yaml new file mode 100644 index 0000000..82cf395 --- /dev/null +++ b/config/addons/kubevirt/deploy/kustomization.yaml @@ -0,0 +1,8 @@ +# KubeVirt deployment — remote resources for FluxCD Kustomization +# Prerequisite: Deploy CDI first +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/kubevirt/kubevirt/releases/download/v1.8.0-rc.0/kubevirt-operator.yaml + - https://github.com/kubevirt/kubevirt/releases/download/v1.8.0-rc.0/kubevirt-cr.yaml diff --git a/config/addons/kubevirt/kustomization.yaml b/config/addons/kubevirt/kustomization.yaml new file mode 100644 index 0000000..3da2876 --- /dev/null +++ b/config/addons/kubevirt/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/kubevirt/module.yaml b/config/addons/kubevirt/module.yaml new file mode 100644 index 0000000..a72dceb --- /dev/null +++ b/config/addons/kubevirt/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: kubevirt +spec: + templateRef: kubevirt diff --git a/config/addons/kubevirt/moduletemplate.yaml b/config/addons/kubevirt/moduletemplate.yaml new file mode 100644 index 0000000..4e23a91 --- /dev/null +++ b/config/addons/kubevirt/moduletemplate.yaml @@ -0,0 +1,21 @@ +# ModuleTemplate — KubeVirt v1.8.0-rc.0 +# Uses FluxCD Kustomization. Deploy CDI first. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: kubevirt +spec: + namespace: kubevirt + + description: >- + KubeVirt v1.8.0-rc.0 — enables Kubernetes to manage VMs natively. + Requires CDI for VM disk image import. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/kubevirt/deploy diff --git a/config/addons/kustomization.yaml b/config/addons/kustomization.yaml new file mode 100644 index 0000000..516f007 --- /dev/null +++ b/config/addons/kustomization.yaml @@ -0,0 +1,49 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# Infrastructure Components — deploy all infrastructure components at once +# +# Included: +# cdi/ — Containerized Data Importer v1.64.0 (VM disk image import for KubeVirt) +# kubevirt/ — KubeVirt v1.8.0-rc.0 (VM on Kubernetes) +# gateway-api/ — Kubernetes Gateway API v1.5.0 (Standard channel CRDs) +# samba/ — Samba Operator v0.8 (SMB/CIFS file sharing) +# rook-ceph/ — Rook-Ceph Operator v1.19.2 (distributed storage CRDs + Operator) +# +# WARNING: Important deployment notes: +# +# One-shot (dev/test environment): +# kubectl apply -k config/addons/ +# # If CDI or KubeVirt CR gets "CRD not found", simply re-run: +# kubectl apply -k config/addons/ +# +# Staged (production recommended): +# +# Step 1 — Apply CRDs and Operators (this kustomization): +# kubectl apply -k config/addons/ +# +# Step 2 — Wait for all Operators to be ready: +# kubectl wait --for=condition=Established \ +# crd/cdis.cdi.kubevirt.io \ +# crd/kubevirts.kubevirt.io \ +# --timeout=120s +# kubectl -n rook-ceph rollout status deploy/rook-ceph-operator +# +# Step 3 — Create Rook CephCluster (edit cluster/kustomization.yaml for your environment first): +# kubectl apply -k config/addons/rook-ceph/cluster/ +# +# Deploy individual components: +# kubectl apply -k config/addons/cdi/ +# kubectl apply -k config/addons/kubevirt/ +# kubectl apply -k config/addons/gateway-api/ +# kubectl apply -k config/addons/samba/ +# kubectl apply -k config/addons/rook-ceph/ + +# Deploy order: GitRepository first, then ModuleTemplate-based components +resources: + - gitrepository.yaml + - gateway-api/ + - cdi/ + - kubevirt/ + - samba/ + - rook-ceph/ diff --git a/config/addons/rook-ceph/cluster/deploy/kustomization.yaml b/config/addons/rook-ceph/cluster/deploy/kustomization.yaml new file mode 100644 index 0000000..af9ec4d --- /dev/null +++ b/config/addons/rook-ceph/cluster/deploy/kustomization.yaml @@ -0,0 +1,6 @@ +# Rook-Ceph CephCluster CR — Phase 2 (apply after Operator is ready) +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/cluster.yaml diff --git a/config/addons/rook-ceph/cluster/kustomization.yaml b/config/addons/rook-ceph/cluster/kustomization.yaml new file mode 100644 index 0000000..3da2876 --- /dev/null +++ b/config/addons/rook-ceph/cluster/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/rook-ceph/cluster/module.yaml b/config/addons/rook-ceph/cluster/module.yaml new file mode 100644 index 0000000..6c8ef59 --- /dev/null +++ b/config/addons/rook-ceph/cluster/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: rook-ceph-cluster +spec: + templateRef: rook-ceph-cluster diff --git a/config/addons/rook-ceph/cluster/moduletemplate.yaml b/config/addons/rook-ceph/cluster/moduletemplate.yaml new file mode 100644 index 0000000..77452f9 --- /dev/null +++ b/config/addons/rook-ceph/cluster/moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Rook-Ceph CephCluster (Phase 2) +# Apply AFTER rook-ceph Operator is ready: kubectl -n rook-ceph rollout status deploy/rook-ceph-operator +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: rook-ceph-cluster +spec: + namespace: rook-ceph + + description: >- + Rook-Ceph CephCluster CR — Phase 2. Edit cluster/deploy for production (storage.nodes, useAllDevices: false). + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/rook-ceph/cluster/deploy diff --git a/config/addons/rook-ceph/deploy/kustomization.yaml b/config/addons/rook-ceph/deploy/kustomization.yaml new file mode 100644 index 0000000..454c5e3 --- /dev/null +++ b/config/addons/rook-ceph/deploy/kustomization.yaml @@ -0,0 +1,8 @@ +# Rook-Ceph Operator v1.19.2 — Phase 1: CRDs + Operator (no CephCluster) +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/crds.yaml + - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/common.yaml + - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/operator.yaml diff --git a/config/addons/rook-ceph/kustomization.yaml b/config/addons/rook-ceph/kustomization.yaml new file mode 100644 index 0000000..3da2876 --- /dev/null +++ b/config/addons/rook-ceph/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/rook-ceph/module.yaml b/config/addons/rook-ceph/module.yaml new file mode 100644 index 0000000..915b9c0 --- /dev/null +++ b/config/addons/rook-ceph/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: rook-ceph +spec: + templateRef: rook-ceph diff --git a/config/addons/rook-ceph/moduletemplate.yaml b/config/addons/rook-ceph/moduletemplate.yaml new file mode 100644 index 0000000..6b7a820 --- /dev/null +++ b/config/addons/rook-ceph/moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Rook-Ceph Operator v1.19.2 (Phase 1: Operator only) +# Uses FluxCD Kustomization. Phase 2: Apply rook-ceph-cluster Module for CephCluster. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: rook-ceph +spec: + namespace: rook-ceph + + description: >- + Rook-Ceph Operator v1.19.2 — CRDs, Operator Deployment. Create CephCluster separately via rook-ceph-cluster Module. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/rook-ceph/deploy diff --git a/config/addons/samba/deploy/kustomization.yaml b/config/addons/samba/deploy/kustomization.yaml new file mode 100644 index 0000000..bdf2c84 --- /dev/null +++ b/config/addons/samba/deploy/kustomization.yaml @@ -0,0 +1,6 @@ +# Samba Operator deployment — remote resources for FluxCD Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/samba-in-kubernetes/samba-operator/releases/download/v0.8/samba-operator-v0.8-default.yaml diff --git a/config/addons/samba/kustomization.yaml b/config/addons/samba/kustomization.yaml new file mode 100644 index 0000000..3da2876 --- /dev/null +++ b/config/addons/samba/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - moduletemplate.yaml + - module.yaml diff --git a/config/addons/samba/module.yaml b/config/addons/samba/module.yaml new file mode 100644 index 0000000..7cedd3d --- /dev/null +++ b/config/addons/samba/module.yaml @@ -0,0 +1,6 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: samba +spec: + templateRef: samba diff --git a/config/addons/samba/moduletemplate.yaml b/config/addons/samba/moduletemplate.yaml new file mode 100644 index 0000000..4f64466 --- /dev/null +++ b/config/addons/samba/moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Samba Operator v0.8 +# Uses FluxCD Kustomization. Deploys from remote release YAML. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: samba +spec: + namespace: samba-operator-system + + description: >- + Samba Operator v0.8 — exposes PVCs over SMB/CIFS on Kubernetes. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/samba/deploy From c9b1570e10e09bd6d6e86dad037b9c23acc1e362 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 14:28:06 +0800 Subject: [PATCH 02/34] Build moduletemplate together --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0f700b2..8b259ea 100644 --- a/Makefile +++ b/Makefile @@ -158,11 +158,10 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform rm Dockerfile.cross .PHONY: build-installer -build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate), dist/addons-bundle.yaml. +build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/charts/module-templates; } > dist/install.yaml - "$(KUSTOMIZE)" build config/addons > dist/addons-bundle.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/charts/module-templates; echo "---"; "$(KUSTOMIZE)" build config/addons; } > dist/install.yaml ##@ Deployment From ba5b06923c9e5b4ce4ff9916c3724277ed7c55df Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 17:35:52 +0800 Subject: [PATCH 03/34] Change gitrepository ref to tag --- config/addons/gitrepository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/addons/gitrepository.yaml b/config/addons/gitrepository.yaml index f0465d2..a03fe10 100644 --- a/config/addons/gitrepository.yaml +++ b/config/addons/gitrepository.yaml @@ -9,4 +9,4 @@ spec: interval: 1h url: https://github.com/otterscale/module-operator ref: - branch: feat/add_addons_templates + tag: v0.9.0-beta.3 From 3508676c8894c0529021ef35343983db8ebb0b10 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:13:43 +0800 Subject: [PATCH 04/34] Refactor: change folder structure --- AGENTS.md | 342 ------------------ Makefile | 2 +- config/addons/cdi/kustomization.yaml | 8 - config/addons/charts/kustomization.yaml | 24 -- config/addons/gateway-api/kustomization.yaml | 6 - .../cdi/deploy/kustomization.yaml | 0 .../{ => gitrepository}/cdi/module.yaml | 0 .../cdi/moduletemplate.yaml | 4 +- .../gateway-api/deploy/kustomization.yaml | 0 .../gateway-api/module.yaml | 0 .../gateway-api/moduletemplate.yaml | 2 +- .../{ => gitrepository}/gitrepository.yaml | 2 +- .../kubevirt/deploy/kustomization.yaml | 0 .../{ => gitrepository}/kubevirt/module.yaml | 0 .../kubevirt/moduletemplate.yaml | 2 +- .../addons/gitrepository/kustomization.yaml | 6 + .../module-templates/cdi-moduletemplate.yaml | 24 ++ .../gateway-api-moduletemplate.yaml | 20 + .../module-templates/gitrepository.yaml | 12 + .../kubevirt-moduletemplate.yaml | 21 ++ .../module-templates/kustomization.yaml | 14 + .../rook-ceph-moduletemplate.yaml | 20 + .../samba-moduletemplate.yaml | 20 + .../rook-ceph/deploy/kustomization.yaml | 0 .../{ => gitrepository}/rook-ceph/module.yaml | 0 .../rook-ceph/moduletemplate.yaml | 2 +- .../samba/deploy/kustomization.yaml | 0 .../{ => gitrepository}/samba/module.yaml | 0 .../samba/moduletemplate.yaml | 2 +- .../gpu-operator/helmrepository.yaml | 0 .../gpu-operator/kustomization.yaml | 0 .../gpu-operator/module.yaml | 0 .../gpu-operator/moduletemplate.yaml | 0 .../hami/helmrepository.yaml | 0 .../hami/kustomization.yaml | 0 .../hami/module.yaml | 0 .../hami/moduletemplate.yaml | 0 .../istio/helmrepository.yaml | 0 .../istio/kustomization.yaml | 0 .../istio/module-base.yaml | 0 .../istio/module-gateway.yaml | 0 .../istio/module-istiod.yaml | 0 .../istio/moduletemplate-base.yaml | 0 .../istio/moduletemplate-gateway.yaml | 0 .../istio/moduletemplate-istiod.yaml | 0 .../addons/helmrepository/kustomization.yaml | 11 + .../llm-d-infra/helmrepository.yaml | 0 .../llm-d-infra/kustomization.yaml | 0 .../llm-d-infra/module.yaml | 0 .../llm-d-infra/moduletemplate.yaml | 0 .../gpu-operator-helmrepository.yaml | 0 .../gpu-operator-moduletemplate.yaml | 0 .../module-templates/hami-helmrepository.yaml | 0 .../module-templates/hami-moduletemplate.yaml | 0 .../istio-helmrepository.yaml | 0 .../istio-moduletemplate-base.yaml | 0 .../istio-moduletemplate-gateway.yaml | 0 .../istio-moduletemplate-istiod.yaml | 0 .../module-templates/kustomization.yaml | 0 .../llm-d-infra-helmrepository.yaml | 0 .../llm-d-infra-moduletemplate.yaml | 0 .../prometheus-helmrepository.yaml | 0 .../prometheus-moduletemplate.yaml | 0 .../prometheus/helmrepository.yaml | 0 .../prometheus/kustomization.yaml | 0 .../prometheus/module.yaml | 0 .../prometheus/moduletemplate.yaml | 0 config/addons/kubevirt/kustomization.yaml | 6 - config/addons/kustomization.yaml | 49 +-- .../cluster/deploy/kustomization.yaml | 6 - .../rook-ceph/cluster/kustomization.yaml | 6 - config/addons/rook-ceph/cluster/module.yaml | 6 - .../rook-ceph/cluster/moduletemplate.yaml | 20 - config/addons/rook-ceph/kustomization.yaml | 6 - config/addons/samba/kustomization.yaml | 6 - config/manager/kustomization.yaml | 6 + 76 files changed, 167 insertions(+), 488 deletions(-) delete mode 100644 AGENTS.md delete mode 100644 config/addons/cdi/kustomization.yaml delete mode 100644 config/addons/charts/kustomization.yaml delete mode 100644 config/addons/gateway-api/kustomization.yaml rename config/addons/{ => gitrepository}/cdi/deploy/kustomization.yaml (100%) rename config/addons/{ => gitrepository}/cdi/module.yaml (100%) rename config/addons/{ => gitrepository}/cdi/moduletemplate.yaml (86%) rename config/addons/{ => gitrepository}/gateway-api/deploy/kustomization.yaml (100%) rename config/addons/{ => gitrepository}/gateway-api/module.yaml (100%) rename config/addons/{ => gitrepository}/gateway-api/moduletemplate.yaml (91%) rename config/addons/{ => gitrepository}/gitrepository.yaml (77%) rename config/addons/{ => gitrepository}/kubevirt/deploy/kustomization.yaml (100%) rename config/addons/{ => gitrepository}/kubevirt/module.yaml (100%) rename config/addons/{ => gitrepository}/kubevirt/moduletemplate.yaml (90%) create mode 100644 config/addons/gitrepository/kustomization.yaml create mode 100644 config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml create mode 100644 config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml create mode 100644 config/addons/gitrepository/module-templates/gitrepository.yaml create mode 100644 config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml create mode 100644 config/addons/gitrepository/module-templates/kustomization.yaml create mode 100644 config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml create mode 100644 config/addons/gitrepository/module-templates/samba-moduletemplate.yaml rename config/addons/{ => gitrepository}/rook-ceph/deploy/kustomization.yaml (100%) rename config/addons/{ => gitrepository}/rook-ceph/module.yaml (100%) rename config/addons/{ => gitrepository}/rook-ceph/moduletemplate.yaml (91%) rename config/addons/{ => gitrepository}/samba/deploy/kustomization.yaml (100%) rename config/addons/{ => gitrepository}/samba/module.yaml (100%) rename config/addons/{ => gitrepository}/samba/moduletemplate.yaml (90%) rename config/addons/{charts => helmrepository}/gpu-operator/helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/gpu-operator/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/gpu-operator/module.yaml (100%) rename config/addons/{charts => helmrepository}/gpu-operator/moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/hami/helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/hami/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/hami/module.yaml (100%) rename config/addons/{charts => helmrepository}/hami/moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/istio/helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/istio/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/istio/module-base.yaml (100%) rename config/addons/{charts => helmrepository}/istio/module-gateway.yaml (100%) rename config/addons/{charts => helmrepository}/istio/module-istiod.yaml (100%) rename config/addons/{charts => helmrepository}/istio/moduletemplate-base.yaml (100%) rename config/addons/{charts => helmrepository}/istio/moduletemplate-gateway.yaml (100%) rename config/addons/{charts => helmrepository}/istio/moduletemplate-istiod.yaml (100%) create mode 100644 config/addons/helmrepository/kustomization.yaml rename config/addons/{charts => helmrepository}/llm-d-infra/helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/llm-d-infra/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/llm-d-infra/module.yaml (100%) rename config/addons/{charts => helmrepository}/llm-d-infra/moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/gpu-operator-helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/gpu-operator-moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/hami-helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/hami-moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/istio-helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/istio-moduletemplate-base.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/istio-moduletemplate-gateway.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/istio-moduletemplate-istiod.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/llm-d-infra-helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/llm-d-infra-moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/prometheus-helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/module-templates/prometheus-moduletemplate.yaml (100%) rename config/addons/{charts => helmrepository}/prometheus/helmrepository.yaml (100%) rename config/addons/{charts => helmrepository}/prometheus/kustomization.yaml (100%) rename config/addons/{charts => helmrepository}/prometheus/module.yaml (100%) rename config/addons/{charts => helmrepository}/prometheus/moduletemplate.yaml (100%) delete mode 100644 config/addons/kubevirt/kustomization.yaml delete mode 100644 config/addons/rook-ceph/cluster/deploy/kustomization.yaml delete mode 100644 config/addons/rook-ceph/cluster/kustomization.yaml delete mode 100644 config/addons/rook-ceph/cluster/module.yaml delete mode 100644 config/addons/rook-ceph/cluster/moduletemplate.yaml delete mode 100644 config/addons/rook-ceph/kustomization.yaml delete mode 100644 config/addons/samba/kustomization.yaml diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index f9dfaa6..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,342 +0,0 @@ -# module-operator - AI Agent Guide - -## Project Structure - -**Single-group layout (default):** - -``` -cmd/main.go Manager entry (registers controllers/webhooks) -api//*_types.go CRD schemas (+kubebuilder markers) -api//zz_generated.* Auto-generated (DO NOT EDIT) -internal/controller/* Reconciliation logic -internal/webhook/* Validation/defaulting (if present) -config/crd/bases/* Generated CRDs (DO NOT EDIT) -config/rbac/role.yaml Generated RBAC (DO NOT EDIT) -config/samples/* Example CRs (edit these) -Makefile Build/test/deploy commands -PROJECT Kubebuilder metadata Auto-generated (DO NOT EDIT) -``` - -**Multi-group layout** (for projects with multiple API groups): - -``` -api///*_types.go CRD schemas by group -internal/controller//* Controllers by group -internal/webhook///* Webhooks by group and version (if present) -``` - -Multi-group layout organizes APIs by group name (e.g., `batch`, `apps`). Check the `PROJECT` file for `multigroup: true`. - -**To convert to multi-group layout:** - -1. Run: `kubebuilder edit --multigroup=true` -2. Move APIs: `mkdir -p api/ && mv api/ api//` -3. Move controllers: `mkdir -p internal/controller/ && mv internal/controller/*.go internal/controller//` -4. Move webhooks (if present): `mkdir -p internal/webhook/ && mv internal/webhook/ internal/webhook//` -5. Update import paths in all files -6. Fix `path` in `PROJECT` file for each resource -7. Update test suite CRD paths (add one more `..` to relative paths) - -## Critical Rules - -### Never Edit These (Auto-Generated) - -- `config/crd/bases/*.yaml` - from `make manifests` -- `config/rbac/role.yaml` - from `make manifests` -- `config/webhook/manifests.yaml` - from `make manifests` -- `**/zz_generated.*.go` - from `make generate` -- `PROJECT` - from `kubebuilder [OPTIONS]` - -### Never Remove Scaffold Markers - -Do NOT delete `// +kubebuilder:scaffold:*` comments. CLI injects code at these markers. - -### Keep Project Structure - -Do not move files around. The CLI expects files in specific locations. - -### Always Use CLI Commands - -Always use `kubebuilder create api` and `kubebuilder create webhook` to scaffold. Do NOT create files manually. - -### E2E Tests Require an Isolated Kind Cluster - -The e2e tests are designed to validate the solution in an isolated environment (similar to GitHub Actions CI). -Ensure you run them against a dedicated [Kind](https://kind.sigs.k8s.io/) cluster (not your “real” dev/prod cluster). - -## After Making Changes - -**After editing `*_types.go` or markers:** - -``` -make manifests # Regenerate CRDs/RBAC from markers -make generate # Regenerate DeepCopy methods -``` - -**After editing `*.go` files:** - -``` -make lint-fix # Auto-fix code style -make test # Run unit tests -``` - -## CLI Commands Cheat Sheet - -### Create API (your own types) - -```bash -kubebuilder create api --group --version --kind -``` - -### Deploy Image Plugin (scaffold to deploy/manage ANY container image) - -Generate a controller that deploys and manages a container image (nginx, redis, memcached, your app, etc.): - -```bash -# Example: deploying memcached -kubebuilder create api --group example.com --version v1alpha1 --kind Memcached \ - --image=memcached:alpine \ - --plugins=deploy-image.go.kubebuilder.io/v1-alpha -``` - -Scaffolds good-practice code: reconciliation logic, status conditions, finalizers, RBAC. Use as a reference implementation. - -### Create Webhooks - -```bash -# Validation + defaulting -kubebuilder create webhook --group --version --kind \ - --defaulting --programmatic-validation - -# Conversion webhook (for multi-version APIs) -kubebuilder create webhook --group --version v1 --kind \ - --conversion --spoke v2 -``` - -### Controller for Core Kubernetes Types - -```bash -# Watch Pods -kubebuilder create api --group core --version v1 --kind Pod \ - --controller=true --resource=false - -# Watch Deployments -kubebuilder create api --group apps --version v1 --kind Deployment \ - --controller=true --resource=false -``` - -### Controller for External Types (e.g., from other operators) - -Watch resources from external APIs (cert-manager, Argo CD, Istio, etc.): - -```bash -# Example: watching cert-manager Certificate resources -kubebuilder create api \ - --group cert-manager --version v1 --kind Certificate \ - --controller=true --resource=false \ - --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 \ - --external-api-domain=io \ - --external-api-module=github.com/cert-manager/cert-manager -``` - -**Note:** Use `--external-api-module=@` only if you need a specific version. Otherwise, omit `@` to use what's in go.mod. - -### Webhook for External Types - -```bash -# Example: validating external resources -kubebuilder create webhook \ - --group cert-manager --version v1 --kind Issuer \ - --defaulting \ - --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 \ - --external-api-domain=io \ - --external-api-module=github.com/cert-manager/cert-manager -``` - -## Testing & Development - -```bash -make test # Run unit tests (uses envtest: real K8s API + etcd) -make run # Run locally (uses current kubeconfig context) -``` - -Tests use **Ginkgo + Gomega** (BDD style). Check `suite_test.go` for setup. - -## Deployment Workflow - -```bash -# 1. Regenerate manifests -make manifests generate - -# 2. Build & deploy -export IMG=/:tag -make docker-build docker-push IMG=$IMG # Or: kind load docker-image $IMG --name -make deploy IMG=$IMG - -# 3. Test -kubectl apply -k config/samples/ - -# 4. Debug -kubectl logs -n -system deployment/-controller-manager -c manager -f -``` - -### API Design - -**Key markers for** `api//*_types.go`: - -```go -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Namespaced -// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=".status.conditions[?(@.type=='Ready')].status" - -// On fields: -// +kubebuilder:validation:Required -// +kubebuilder:validation:Minimum=1 -// +kubebuilder:validation:MaxLength=100 -// +kubebuilder:validation:Pattern="^[a-z]+$" -// +kubebuilder:default="value" -``` - -- **Use** `metav1.Condition` for status (not custom string fields) -- **Use predefined types**: `metav1.Time` instead of `string` for dates -- **Follow K8s API conventions**: Standard field names (`spec`, `status`, `metadata`) - -### Controller Design - -**RBAC markers in** `internal/controller/*_controller.go`: - -```go -// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds/status,verbs=get;update;patch -// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds/finalizers,verbs=update -// +kubebuilder:rbac:groups=events.k8s.io,resources=events,verbs=create;patch -// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete -``` - -**Implementation rules:** - -- **Idempotent reconciliation**: Safe to run multiple times -- **Re-fetch before updates**: `r.Get(ctx, req.NamespacedName, obj)` before `r.Update` to avoid conflicts -- **Structured logging**: `log := log.FromContext(ctx); log.Info("msg", "key", val)` -- **Owner references**: Enable automatic garbage collection (`SetControllerReference`) -- **Watch secondary resources**: Use `.Owns()` or `.Watches()`, not just `RequeueAfter` -- **Finalizers**: Clean up external resources (buckets, VMs, DNS entries) - -### Logging - -**Follow Kubernetes logging message style guidelines:** - -- Start from a capital letter -- Do not end the message with a period -- Active voice: subject present (`"Deployment could not create Pod"`) or omitted (`"Could not create Pod"`) -- Past tense: `"Could not delete Pod"` not `"Cannot delete Pod"` -- Specify object type: `"Deleted Pod"` not `"Deleted"` -- Balanced key-value pairs - -```go -log.Info("Starting reconciliation") -log.Info("Created Deployment", "name", deploy.Name) -log.Error(err, "Failed to create Pod", "name", name) -``` - -**Reference:** https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines - -### Webhooks - -- **Create all types together**: `--defaulting --programmatic-validation --conversion` -- **When`--force`is used**: Backup custom logic first, then restore after scaffolding -- **For multi-version APIs**: Use hub-and-spoke pattern (`--conversion --spoke v2`) - - Hub version: Usually oldest stable version (v1) - - Spoke versions: Newer versions that convert to/from hub (v2, v3) - - Example: `--group crew --version v1 --kind Captain --conversion --spoke v2` (v1 is hub, v2 is spoke) - -### Learning from Examples - -The **deploy-image plugin** scaffolds a complete controller following good practices. Use it as a reference implementation: - -```bash -kubebuilder create api --group example --version v1alpha1 --kind MyApp \ - --image= --plugins=deploy-image.go.kubebuilder.io/v1-alpha -``` - -Generated code includes: status conditions (`metav1.Condition`), finalizers, owner references, events, idempotent reconciliation. - -## Distribution Options - -### Option 1: YAML Bundle (Kustomize) - -```bash -# Generate dist/install.yaml from Kustomize manifests -make build-installer IMG=/:tag -``` - -**Key points:** - -- The `dist/install.yaml` is generated from Kustomize manifests (CRDs, RBAC, Deployment) -- Commit this file to your repository for easy distribution -- Users only need `kubectl` to install (no additional tools required) - -**Example:** Users install with a single command: - -```bash -kubectl apply -f https://raw.githubusercontent.com////dist/install.yaml -``` - -### Option 2: Helm Chart - -```bash -kubebuilder edit --plugins=helm/v2-alpha # Generates dist/chart/ (default) -kubebuilder edit --plugins=helm/v2-alpha --output-dir=charts # Generates charts/chart/ -``` - -**For development:** - -```bash -make helm-deploy IMG=/: # Deploy manager via Helm -make helm-deploy IMG=$IMG HELM_EXTRA_ARGS="--set ..." # Deploy with custom values -make helm-status # Show release status -make helm-uninstall # Remove release -make helm-history # View release history -make helm-rollback # Rollback to previous version -``` - -**For end users/production:** - -```bash -helm install my-release .//chart/ --namespace --create-namespace -``` - -**Important:** If you add webhooks or modify manifests after initial chart generation: - -1. Backup any customizations in `/chart/values.yaml` and `/chart/manager/manager.yaml` -2. Re-run: `kubebuilder edit --plugins=helm/v2-alpha --force` (use same `--output-dir` if customized) -3. Manually restore your custom values from the backup - -### Publish Container Image - -```bash -export IMG=/: -make docker-build docker-push IMG=$IMG -``` - -## References - -### Essential Reading - -- **Kubebuilder Book**: https://book.kubebuilder.io (comprehensive guide) -- **controller-runtime FAQ**: https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md (common patterns and questions) -- **Good Practices**: https://book.kubebuilder.io/reference/good-practices.html (why reconciliation is idempotent, status conditions, etc.) -- **Logging Conventions**: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines (message style, verbosity levels) - -### API Design & Implementation - -- **API Conventions**: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md -- **Operator Pattern**: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ -- **Markers Reference**: https://book.kubebuilder.io/reference/markers.html - -### Tools & Libraries - -- **controller-runtime**: https://github.com/kubernetes-sigs/controller-runtime -- **controller-tools**: https://github.com/kubernetes-sigs/controller-tools -- **Kubebuilder Repo**: https://github.com/kubernetes-sigs/kubebuilder diff --git a/Makefile b/Makefile index 8b259ea..07ec38b 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/charts/module-templates; echo "---"; "$(KUSTOMIZE)" build config/addons; } > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository/module-templates; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository/module-templates; } > dist/install.yaml ##@ Deployment diff --git a/config/addons/cdi/kustomization.yaml b/config/addons/cdi/kustomization.yaml deleted file mode 100644 index 298ef6c..0000000 --- a/config/addons/cdi/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# CDI — ModuleTemplate + kustomization pattern (like prometheus) -# Deploy order: GitRepository first, then ModuleTemplate, then Module -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/addons/charts/kustomization.yaml b/config/addons/charts/kustomization.yaml deleted file mode 100644 index 1de234c..0000000 --- a/config/addons/charts/kustomization.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# 一次部署所有 OtterScale Module 元件(HelmRepository + ModuleTemplate + Module)。 -# -# 部署順序由 Kustomize 依 resources 清單順序決定: -# 1. gpu-operator/ — NVIDIA GPU Operator(driver + DCGM) -# 2. hami/ — HAMI vGPU sharing(依賴 gpu-operator) -# 3. prometheus/ — kube-prometheus-stack 監控套件 -# -# 使用方式: -# # 預覽所有將套用的資源 -# kubectl kustomize config/addons/charts/ -# -# # 直接套用到叢集 -# kubectl apply -k config/addons/charts/ -# -# 若只需部署單一元件,請進入子目錄執行: -# kubectl apply -k config/addons/charts/gpu-operator/ - -resources: - - gpu-operator/ - - hami/ - - prometheus/ diff --git a/config/addons/gateway-api/kustomization.yaml b/config/addons/gateway-api/kustomization.yaml deleted file mode 100644 index 3da2876..0000000 --- a/config/addons/gateway-api/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/addons/cdi/deploy/kustomization.yaml b/config/addons/gitrepository/cdi/deploy/kustomization.yaml similarity index 100% rename from config/addons/cdi/deploy/kustomization.yaml rename to config/addons/gitrepository/cdi/deploy/kustomization.yaml diff --git a/config/addons/cdi/module.yaml b/config/addons/gitrepository/cdi/module.yaml similarity index 100% rename from config/addons/cdi/module.yaml rename to config/addons/gitrepository/cdi/module.yaml diff --git a/config/addons/cdi/moduletemplate.yaml b/config/addons/gitrepository/cdi/moduletemplate.yaml similarity index 86% rename from config/addons/cdi/moduletemplate.yaml rename to config/addons/gitrepository/cdi/moduletemplate.yaml index 4650c33..03858b2 100644 --- a/config/addons/cdi/moduletemplate.yaml +++ b/config/addons/gitrepository/cdi/moduletemplate.yaml @@ -2,7 +2,7 @@ # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # # Prerequisite: GitRepository (otterscale-module-operator) must exist in flux-system. -# Apply: kubectl apply -k config/addons/cdi/ +# Apply: kubectl apply -k config/addons/gitrepository/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate metadata: @@ -21,4 +21,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: flux-system - path: config/addons/cdi/deploy + path: config/addons/gitrepository/cdi/deploy diff --git a/config/addons/gateway-api/deploy/kustomization.yaml b/config/addons/gitrepository/gateway-api/deploy/kustomization.yaml similarity index 100% rename from config/addons/gateway-api/deploy/kustomization.yaml rename to config/addons/gitrepository/gateway-api/deploy/kustomization.yaml diff --git a/config/addons/gateway-api/module.yaml b/config/addons/gitrepository/gateway-api/module.yaml similarity index 100% rename from config/addons/gateway-api/module.yaml rename to config/addons/gitrepository/gateway-api/module.yaml diff --git a/config/addons/gateway-api/moduletemplate.yaml b/config/addons/gitrepository/gateway-api/moduletemplate.yaml similarity index 91% rename from config/addons/gateway-api/moduletemplate.yaml rename to config/addons/gitrepository/gateway-api/moduletemplate.yaml index 09c5e4f..fefa5f9 100644 --- a/config/addons/gateway-api/moduletemplate.yaml +++ b/config/addons/gitrepository/gateway-api/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: flux-system - path: config/addons/gateway-api/deploy + path: config/addons/gitrepository/gateway-api/deploy diff --git a/config/addons/gitrepository.yaml b/config/addons/gitrepository/gitrepository.yaml similarity index 77% rename from config/addons/gitrepository.yaml rename to config/addons/gitrepository/gitrepository.yaml index a03fe10..659b5e9 100644 --- a/config/addons/gitrepository.yaml +++ b/config/addons/gitrepository/gitrepository.yaml @@ -1,5 +1,5 @@ # Shared GitRepository for addon ModuleTemplates (CDI, KubeVirt, etc.) -# All addon components deploy from this repo's config/addons/*/deploy paths. +# All addon components deploy from this repo's config/addons/gitrepository/*/deploy paths. apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: diff --git a/config/addons/kubevirt/deploy/kustomization.yaml b/config/addons/gitrepository/kubevirt/deploy/kustomization.yaml similarity index 100% rename from config/addons/kubevirt/deploy/kustomization.yaml rename to config/addons/gitrepository/kubevirt/deploy/kustomization.yaml diff --git a/config/addons/kubevirt/module.yaml b/config/addons/gitrepository/kubevirt/module.yaml similarity index 100% rename from config/addons/kubevirt/module.yaml rename to config/addons/gitrepository/kubevirt/module.yaml diff --git a/config/addons/kubevirt/moduletemplate.yaml b/config/addons/gitrepository/kubevirt/moduletemplate.yaml similarity index 90% rename from config/addons/kubevirt/moduletemplate.yaml rename to config/addons/gitrepository/kubevirt/moduletemplate.yaml index 4e23a91..a079af4 100644 --- a/config/addons/kubevirt/moduletemplate.yaml +++ b/config/addons/gitrepository/kubevirt/moduletemplate.yaml @@ -18,4 +18,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: flux-system - path: config/addons/kubevirt/deploy + path: config/addons/gitrepository/kubevirt/deploy diff --git a/config/addons/gitrepository/kustomization.yaml b/config/addons/gitrepository/kustomization.yaml new file mode 100644 index 0000000..b3a392e --- /dev/null +++ b/config/addons/gitrepository/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# GitRepository only. ModuleTemplates come from build-installer (config/addons/gitrepository/module-templates). +resources: + - gitrepository.yaml diff --git a/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml b/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml new file mode 100644 index 0000000..03858b2 --- /dev/null +++ b/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml @@ -0,0 +1,24 @@ +# ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 +# Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. +# +# Prerequisite: GitRepository (otterscale-module-operator) must exist in flux-system. +# Apply: kubectl apply -k config/addons/gitrepository/cdi/ +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: cdi +spec: + namespace: cdi + + description: >- + Containerized Data Importer v1.64.0 — PVC data import for KubeVirt VM disk images. + Deploys via FluxCD Kustomization from upstream release YAMLs. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gitrepository/cdi/deploy diff --git a/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml b/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml new file mode 100644 index 0000000..fefa5f9 --- /dev/null +++ b/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Kubernetes Gateway API v1.5.0 (Standard channel) +# Uses FluxCD Kustomization. CRDs only (GatewayClass, Gateway, HTTPRoute, etc.) +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: gateway-api +spec: + namespace: gateway-api-system + + description: >- + Kubernetes Gateway API v1.5.0 — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gitrepository/gateway-api/deploy diff --git a/config/addons/gitrepository/module-templates/gitrepository.yaml b/config/addons/gitrepository/module-templates/gitrepository.yaml new file mode 100644 index 0000000..659b5e9 --- /dev/null +++ b/config/addons/gitrepository/module-templates/gitrepository.yaml @@ -0,0 +1,12 @@ +# Shared GitRepository for addon ModuleTemplates (CDI, KubeVirt, etc.) +# All addon components deploy from this repo's config/addons/gitrepository/*/deploy paths. +apiVersion: source.toolkit.fluxcd.io/v1 +kind: GitRepository +metadata: + name: otterscale-module-operator + namespace: flux-system +spec: + interval: 1h + url: https://github.com/otterscale/module-operator + ref: + tag: v0.9.0-beta.3 diff --git a/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml b/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml new file mode 100644 index 0000000..a079af4 --- /dev/null +++ b/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml @@ -0,0 +1,21 @@ +# ModuleTemplate — KubeVirt v1.8.0-rc.0 +# Uses FluxCD Kustomization. Deploy CDI first. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: kubevirt +spec: + namespace: kubevirt + + description: >- + KubeVirt v1.8.0-rc.0 — enables Kubernetes to manage VMs natively. + Requires CDI for VM disk image import. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gitrepository/kubevirt/deploy diff --git a/config/addons/gitrepository/module-templates/kustomization.yaml b/config/addons/gitrepository/module-templates/kustomization.yaml new file mode 100644 index 0000000..44f0a5a --- /dev/null +++ b/config/addons/gitrepository/module-templates/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# GitRepository + ModuleTemplate only (no Module CRs). +# Used by build-installer — install.yaml must not contain Module. +# +# Keep in sync with ../gitrepository.yaml and ../*/moduletemplate.yaml +resources: + - gitrepository.yaml + - gateway-api-moduletemplate.yaml + - cdi-moduletemplate.yaml + - kubevirt-moduletemplate.yaml + - samba-moduletemplate.yaml + - rook-ceph-moduletemplate.yaml diff --git a/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml b/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml new file mode 100644 index 0000000..b2b1c69 --- /dev/null +++ b/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Rook-Ceph Operator v1.19.2 (Phase 1: Operator only) +# Uses FluxCD Kustomization. Phase 2: Apply rook-ceph-cluster Module for CephCluster. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: rook-ceph +spec: + namespace: rook-ceph + + description: >- + Rook-Ceph Operator v1.19.2 — CRDs, Operator Deployment. Create CephCluster separately via rook-ceph-cluster Module. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gitrepository/rook-ceph/deploy diff --git a/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml b/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml new file mode 100644 index 0000000..e583811 --- /dev/null +++ b/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml @@ -0,0 +1,20 @@ +# ModuleTemplate — Samba Operator v0.8 +# Uses FluxCD Kustomization. Deploys from remote release YAML. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: samba +spec: + namespace: samba-operator-system + + description: >- + Samba Operator v0.8 — exposes PVCs over SMB/CIFS on Kubernetes. + + kustomization: + interval: 30m + prune: true + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: flux-system + path: config/addons/gitrepository/samba/deploy diff --git a/config/addons/rook-ceph/deploy/kustomization.yaml b/config/addons/gitrepository/rook-ceph/deploy/kustomization.yaml similarity index 100% rename from config/addons/rook-ceph/deploy/kustomization.yaml rename to config/addons/gitrepository/rook-ceph/deploy/kustomization.yaml diff --git a/config/addons/rook-ceph/module.yaml b/config/addons/gitrepository/rook-ceph/module.yaml similarity index 100% rename from config/addons/rook-ceph/module.yaml rename to config/addons/gitrepository/rook-ceph/module.yaml diff --git a/config/addons/rook-ceph/moduletemplate.yaml b/config/addons/gitrepository/rook-ceph/moduletemplate.yaml similarity index 91% rename from config/addons/rook-ceph/moduletemplate.yaml rename to config/addons/gitrepository/rook-ceph/moduletemplate.yaml index 6b7a820..b2b1c69 100644 --- a/config/addons/rook-ceph/moduletemplate.yaml +++ b/config/addons/gitrepository/rook-ceph/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: flux-system - path: config/addons/rook-ceph/deploy + path: config/addons/gitrepository/rook-ceph/deploy diff --git a/config/addons/samba/deploy/kustomization.yaml b/config/addons/gitrepository/samba/deploy/kustomization.yaml similarity index 100% rename from config/addons/samba/deploy/kustomization.yaml rename to config/addons/gitrepository/samba/deploy/kustomization.yaml diff --git a/config/addons/samba/module.yaml b/config/addons/gitrepository/samba/module.yaml similarity index 100% rename from config/addons/samba/module.yaml rename to config/addons/gitrepository/samba/module.yaml diff --git a/config/addons/samba/moduletemplate.yaml b/config/addons/gitrepository/samba/moduletemplate.yaml similarity index 90% rename from config/addons/samba/moduletemplate.yaml rename to config/addons/gitrepository/samba/moduletemplate.yaml index 4f64466..e583811 100644 --- a/config/addons/samba/moduletemplate.yaml +++ b/config/addons/gitrepository/samba/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: flux-system - path: config/addons/samba/deploy + path: config/addons/gitrepository/samba/deploy diff --git a/config/addons/charts/gpu-operator/helmrepository.yaml b/config/addons/helmrepository/gpu-operator/helmrepository.yaml similarity index 100% rename from config/addons/charts/gpu-operator/helmrepository.yaml rename to config/addons/helmrepository/gpu-operator/helmrepository.yaml diff --git a/config/addons/charts/gpu-operator/kustomization.yaml b/config/addons/helmrepository/gpu-operator/kustomization.yaml similarity index 100% rename from config/addons/charts/gpu-operator/kustomization.yaml rename to config/addons/helmrepository/gpu-operator/kustomization.yaml diff --git a/config/addons/charts/gpu-operator/module.yaml b/config/addons/helmrepository/gpu-operator/module.yaml similarity index 100% rename from config/addons/charts/gpu-operator/module.yaml rename to config/addons/helmrepository/gpu-operator/module.yaml diff --git a/config/addons/charts/gpu-operator/moduletemplate.yaml b/config/addons/helmrepository/gpu-operator/moduletemplate.yaml similarity index 100% rename from config/addons/charts/gpu-operator/moduletemplate.yaml rename to config/addons/helmrepository/gpu-operator/moduletemplate.yaml diff --git a/config/addons/charts/hami/helmrepository.yaml b/config/addons/helmrepository/hami/helmrepository.yaml similarity index 100% rename from config/addons/charts/hami/helmrepository.yaml rename to config/addons/helmrepository/hami/helmrepository.yaml diff --git a/config/addons/charts/hami/kustomization.yaml b/config/addons/helmrepository/hami/kustomization.yaml similarity index 100% rename from config/addons/charts/hami/kustomization.yaml rename to config/addons/helmrepository/hami/kustomization.yaml diff --git a/config/addons/charts/hami/module.yaml b/config/addons/helmrepository/hami/module.yaml similarity index 100% rename from config/addons/charts/hami/module.yaml rename to config/addons/helmrepository/hami/module.yaml diff --git a/config/addons/charts/hami/moduletemplate.yaml b/config/addons/helmrepository/hami/moduletemplate.yaml similarity index 100% rename from config/addons/charts/hami/moduletemplate.yaml rename to config/addons/helmrepository/hami/moduletemplate.yaml diff --git a/config/addons/charts/istio/helmrepository.yaml b/config/addons/helmrepository/istio/helmrepository.yaml similarity index 100% rename from config/addons/charts/istio/helmrepository.yaml rename to config/addons/helmrepository/istio/helmrepository.yaml diff --git a/config/addons/charts/istio/kustomization.yaml b/config/addons/helmrepository/istio/kustomization.yaml similarity index 100% rename from config/addons/charts/istio/kustomization.yaml rename to config/addons/helmrepository/istio/kustomization.yaml diff --git a/config/addons/charts/istio/module-base.yaml b/config/addons/helmrepository/istio/module-base.yaml similarity index 100% rename from config/addons/charts/istio/module-base.yaml rename to config/addons/helmrepository/istio/module-base.yaml diff --git a/config/addons/charts/istio/module-gateway.yaml b/config/addons/helmrepository/istio/module-gateway.yaml similarity index 100% rename from config/addons/charts/istio/module-gateway.yaml rename to config/addons/helmrepository/istio/module-gateway.yaml diff --git a/config/addons/charts/istio/module-istiod.yaml b/config/addons/helmrepository/istio/module-istiod.yaml similarity index 100% rename from config/addons/charts/istio/module-istiod.yaml rename to config/addons/helmrepository/istio/module-istiod.yaml diff --git a/config/addons/charts/istio/moduletemplate-base.yaml b/config/addons/helmrepository/istio/moduletemplate-base.yaml similarity index 100% rename from config/addons/charts/istio/moduletemplate-base.yaml rename to config/addons/helmrepository/istio/moduletemplate-base.yaml diff --git a/config/addons/charts/istio/moduletemplate-gateway.yaml b/config/addons/helmrepository/istio/moduletemplate-gateway.yaml similarity index 100% rename from config/addons/charts/istio/moduletemplate-gateway.yaml rename to config/addons/helmrepository/istio/moduletemplate-gateway.yaml diff --git a/config/addons/charts/istio/moduletemplate-istiod.yaml b/config/addons/helmrepository/istio/moduletemplate-istiod.yaml similarity index 100% rename from config/addons/charts/istio/moduletemplate-istiod.yaml rename to config/addons/helmrepository/istio/moduletemplate-istiod.yaml diff --git a/config/addons/helmrepository/kustomization.yaml b/config/addons/helmrepository/kustomization.yaml new file mode 100644 index 0000000..71e9f89 --- /dev/null +++ b/config/addons/helmrepository/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# Helm-based addons (HelmRepository + ModuleTemplate + Module) +resources: + - gpu-operator/ + - hami/ + - prometheus/ + - istio/ + - llm-d-infra/ + - module-templates/ diff --git a/config/addons/charts/llm-d-infra/helmrepository.yaml b/config/addons/helmrepository/llm-d-infra/helmrepository.yaml similarity index 100% rename from config/addons/charts/llm-d-infra/helmrepository.yaml rename to config/addons/helmrepository/llm-d-infra/helmrepository.yaml diff --git a/config/addons/charts/llm-d-infra/kustomization.yaml b/config/addons/helmrepository/llm-d-infra/kustomization.yaml similarity index 100% rename from config/addons/charts/llm-d-infra/kustomization.yaml rename to config/addons/helmrepository/llm-d-infra/kustomization.yaml diff --git a/config/addons/charts/llm-d-infra/module.yaml b/config/addons/helmrepository/llm-d-infra/module.yaml similarity index 100% rename from config/addons/charts/llm-d-infra/module.yaml rename to config/addons/helmrepository/llm-d-infra/module.yaml diff --git a/config/addons/charts/llm-d-infra/moduletemplate.yaml b/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml similarity index 100% rename from config/addons/charts/llm-d-infra/moduletemplate.yaml rename to config/addons/helmrepository/llm-d-infra/moduletemplate.yaml diff --git a/config/addons/charts/module-templates/gpu-operator-helmrepository.yaml b/config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml similarity index 100% rename from config/addons/charts/module-templates/gpu-operator-helmrepository.yaml rename to config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml diff --git a/config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml b/config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml similarity index 100% rename from config/addons/charts/module-templates/gpu-operator-moduletemplate.yaml rename to config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml diff --git a/config/addons/charts/module-templates/hami-helmrepository.yaml b/config/addons/helmrepository/module-templates/hami-helmrepository.yaml similarity index 100% rename from config/addons/charts/module-templates/hami-helmrepository.yaml rename to config/addons/helmrepository/module-templates/hami-helmrepository.yaml diff --git a/config/addons/charts/module-templates/hami-moduletemplate.yaml b/config/addons/helmrepository/module-templates/hami-moduletemplate.yaml similarity index 100% rename from config/addons/charts/module-templates/hami-moduletemplate.yaml rename to config/addons/helmrepository/module-templates/hami-moduletemplate.yaml diff --git a/config/addons/charts/module-templates/istio-helmrepository.yaml b/config/addons/helmrepository/module-templates/istio-helmrepository.yaml similarity index 100% rename from config/addons/charts/module-templates/istio-helmrepository.yaml rename to config/addons/helmrepository/module-templates/istio-helmrepository.yaml diff --git a/config/addons/charts/module-templates/istio-moduletemplate-base.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml similarity index 100% rename from config/addons/charts/module-templates/istio-moduletemplate-base.yaml rename to config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml diff --git a/config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml similarity index 100% rename from config/addons/charts/module-templates/istio-moduletemplate-gateway.yaml rename to config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml diff --git a/config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml similarity index 100% rename from config/addons/charts/module-templates/istio-moduletemplate-istiod.yaml rename to config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml diff --git a/config/addons/charts/module-templates/kustomization.yaml b/config/addons/helmrepository/module-templates/kustomization.yaml similarity index 100% rename from config/addons/charts/module-templates/kustomization.yaml rename to config/addons/helmrepository/module-templates/kustomization.yaml diff --git a/config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml b/config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml similarity index 100% rename from config/addons/charts/module-templates/llm-d-infra-helmrepository.yaml rename to config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml diff --git a/config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml b/config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml similarity index 100% rename from config/addons/charts/module-templates/llm-d-infra-moduletemplate.yaml rename to config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml diff --git a/config/addons/charts/module-templates/prometheus-helmrepository.yaml b/config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml similarity index 100% rename from config/addons/charts/module-templates/prometheus-helmrepository.yaml rename to config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml diff --git a/config/addons/charts/module-templates/prometheus-moduletemplate.yaml b/config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml similarity index 100% rename from config/addons/charts/module-templates/prometheus-moduletemplate.yaml rename to config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml diff --git a/config/addons/charts/prometheus/helmrepository.yaml b/config/addons/helmrepository/prometheus/helmrepository.yaml similarity index 100% rename from config/addons/charts/prometheus/helmrepository.yaml rename to config/addons/helmrepository/prometheus/helmrepository.yaml diff --git a/config/addons/charts/prometheus/kustomization.yaml b/config/addons/helmrepository/prometheus/kustomization.yaml similarity index 100% rename from config/addons/charts/prometheus/kustomization.yaml rename to config/addons/helmrepository/prometheus/kustomization.yaml diff --git a/config/addons/charts/prometheus/module.yaml b/config/addons/helmrepository/prometheus/module.yaml similarity index 100% rename from config/addons/charts/prometheus/module.yaml rename to config/addons/helmrepository/prometheus/module.yaml diff --git a/config/addons/charts/prometheus/moduletemplate.yaml b/config/addons/helmrepository/prometheus/moduletemplate.yaml similarity index 100% rename from config/addons/charts/prometheus/moduletemplate.yaml rename to config/addons/helmrepository/prometheus/moduletemplate.yaml diff --git a/config/addons/kubevirt/kustomization.yaml b/config/addons/kubevirt/kustomization.yaml deleted file mode 100644 index 3da2876..0000000 --- a/config/addons/kubevirt/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/addons/kustomization.yaml b/config/addons/kustomization.yaml index 516f007..a5c14e6 100644 --- a/config/addons/kustomization.yaml +++ b/config/addons/kustomization.yaml @@ -1,49 +1,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# Infrastructure Components — deploy all infrastructure components at once +# Addons — Helm-based (charts) + Git-based (CDI, KubeVirt, etc.) # -# Included: -# cdi/ — Containerized Data Importer v1.64.0 (VM disk image import for KubeVirt) -# kubevirt/ — KubeVirt v1.8.0-rc.0 (VM on Kubernetes) -# gateway-api/ — Kubernetes Gateway API v1.5.0 (Standard channel CRDs) -# samba/ — Samba Operator v0.8 (SMB/CIFS file sharing) -# rook-ceph/ — Rook-Ceph Operator v1.19.2 (distributed storage CRDs + Operator) -# -# WARNING: Important deployment notes: -# -# One-shot (dev/test environment): -# kubectl apply -k config/addons/ -# # If CDI or KubeVirt CR gets "CRD not found", simply re-run: -# kubectl apply -k config/addons/ -# -# Staged (production recommended): -# -# Step 1 — Apply CRDs and Operators (this kustomization): -# kubectl apply -k config/addons/ -# -# Step 2 — Wait for all Operators to be ready: -# kubectl wait --for=condition=Established \ -# crd/cdis.cdi.kubevirt.io \ -# crd/kubevirts.kubevirt.io \ -# --timeout=120s -# kubectl -n rook-ceph rollout status deploy/rook-ceph-operator -# -# Step 3 — Create Rook CephCluster (edit cluster/kustomization.yaml for your environment first): -# kubectl apply -k config/addons/rook-ceph/cluster/ -# -# Deploy individual components: -# kubectl apply -k config/addons/cdi/ -# kubectl apply -k config/addons/kubevirt/ -# kubectl apply -k config/addons/gateway-api/ -# kubectl apply -k config/addons/samba/ -# kubectl apply -k config/addons/rook-ceph/ - -# Deploy order: GitRepository first, then ModuleTemplate-based components +# One-shot: kubectl apply -k config/addons/ +# Individual: kubectl apply -k config/addons/helmrepository/ or config/addons/gitrepository/ resources: - - gitrepository.yaml - - gateway-api/ - - cdi/ - - kubevirt/ - - samba/ - - rook-ceph/ + - helmrepository/ + - gitrepository/ diff --git a/config/addons/rook-ceph/cluster/deploy/kustomization.yaml b/config/addons/rook-ceph/cluster/deploy/kustomization.yaml deleted file mode 100644 index af9ec4d..0000000 --- a/config/addons/rook-ceph/cluster/deploy/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Rook-Ceph CephCluster CR — Phase 2 (apply after Operator is ready) -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/cluster.yaml diff --git a/config/addons/rook-ceph/cluster/kustomization.yaml b/config/addons/rook-ceph/cluster/kustomization.yaml deleted file mode 100644 index 3da2876..0000000 --- a/config/addons/rook-ceph/cluster/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/addons/rook-ceph/cluster/module.yaml b/config/addons/rook-ceph/cluster/module.yaml deleted file mode 100644 index 6c8ef59..0000000 --- a/config/addons/rook-ceph/cluster/module.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: module.otterscale.io/v1alpha1 -kind: Module -metadata: - name: rook-ceph-cluster -spec: - templateRef: rook-ceph-cluster diff --git a/config/addons/rook-ceph/cluster/moduletemplate.yaml b/config/addons/rook-ceph/cluster/moduletemplate.yaml deleted file mode 100644 index 77452f9..0000000 --- a/config/addons/rook-ceph/cluster/moduletemplate.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# ModuleTemplate — Rook-Ceph CephCluster (Phase 2) -# Apply AFTER rook-ceph Operator is ready: kubectl -n rook-ceph rollout status deploy/rook-ceph-operator -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: rook-ceph-cluster -spec: - namespace: rook-ceph - - description: >- - Rook-Ceph CephCluster CR — Phase 2. Edit cluster/deploy for production (storage.nodes, useAllDevices: false). - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-module-operator - namespace: flux-system - path: config/addons/rook-ceph/cluster/deploy diff --git a/config/addons/rook-ceph/kustomization.yaml b/config/addons/rook-ceph/kustomization.yaml deleted file mode 100644 index 3da2876..0000000 --- a/config/addons/rook-ceph/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/addons/samba/kustomization.yaml b/config/addons/samba/kustomization.yaml deleted file mode 100644 index 3da2876..0000000 --- a/config/addons/samba/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - moduletemplate.yaml - - module.yaml diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5c5f0b8..ad13e96 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,2 +1,8 @@ resources: - manager.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: controller + newName: controller + newTag: latest From d7bd3e5fcff503b6cec268afcb0a9d55c7c405b0 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:25:56 +0800 Subject: [PATCH 05/34] Remove redundant files --- config/addons/gitrepository/gitrepository.yaml | 12 ------------ config/addons/gitrepository/kustomization.yaml | 6 ------ config/addons/helmrepository/kustomization.yaml | 11 ----------- config/addons/kustomization.yaml | 10 ---------- 4 files changed, 39 deletions(-) delete mode 100644 config/addons/gitrepository/gitrepository.yaml delete mode 100644 config/addons/gitrepository/kustomization.yaml delete mode 100644 config/addons/helmrepository/kustomization.yaml delete mode 100644 config/addons/kustomization.yaml diff --git a/config/addons/gitrepository/gitrepository.yaml b/config/addons/gitrepository/gitrepository.yaml deleted file mode 100644 index 659b5e9..0000000 --- a/config/addons/gitrepository/gitrepository.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Shared GitRepository for addon ModuleTemplates (CDI, KubeVirt, etc.) -# All addon components deploy from this repo's config/addons/gitrepository/*/deploy paths. -apiVersion: source.toolkit.fluxcd.io/v1 -kind: GitRepository -metadata: - name: otterscale-module-operator - namespace: flux-system -spec: - interval: 1h - url: https://github.com/otterscale/module-operator - ref: - tag: v0.9.0-beta.3 diff --git a/config/addons/gitrepository/kustomization.yaml b/config/addons/gitrepository/kustomization.yaml deleted file mode 100644 index b3a392e..0000000 --- a/config/addons/gitrepository/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# GitRepository only. ModuleTemplates come from build-installer (config/addons/gitrepository/module-templates). -resources: - - gitrepository.yaml diff --git a/config/addons/helmrepository/kustomization.yaml b/config/addons/helmrepository/kustomization.yaml deleted file mode 100644 index 71e9f89..0000000 --- a/config/addons/helmrepository/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# Helm-based addons (HelmRepository + ModuleTemplate + Module) -resources: - - gpu-operator/ - - hami/ - - prometheus/ - - istio/ - - llm-d-infra/ - - module-templates/ diff --git a/config/addons/kustomization.yaml b/config/addons/kustomization.yaml deleted file mode 100644 index a5c14e6..0000000 --- a/config/addons/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# Addons — Helm-based (charts) + Git-based (CDI, KubeVirt, etc.) -# -# One-shot: kubectl apply -k config/addons/ -# Individual: kubectl apply -k config/addons/helmrepository/ or config/addons/gitrepository/ -resources: - - helmrepository/ - - gitrepository/ From 447813b5df4cb0c6193ec920b5a0b605974631d2 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:39:20 +0800 Subject: [PATCH 06/34] Rename gitrepository --- config/addons/gitrepository/cdi/moduletemplate.yaml | 4 ++-- config/addons/gitrepository/gateway-api/moduletemplate.yaml | 2 +- config/addons/gitrepository/kubevirt/moduletemplate.yaml | 2 +- .../gitrepository/module-templates/cdi-moduletemplate.yaml | 4 ++-- .../module-templates/gateway-api-moduletemplate.yaml | 2 +- .../addons/gitrepository/module-templates/gitrepository.yaml | 2 +- .../module-templates/kubevirt-moduletemplate.yaml | 2 +- .../module-templates/rook-ceph-moduletemplate.yaml | 2 +- .../gitrepository/module-templates/samba-moduletemplate.yaml | 2 +- config/addons/gitrepository/rook-ceph/moduletemplate.yaml | 2 +- config/addons/gitrepository/samba/moduletemplate.yaml | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/addons/gitrepository/cdi/moduletemplate.yaml b/config/addons/gitrepository/cdi/moduletemplate.yaml index 03858b2..d642af6 100644 --- a/config/addons/gitrepository/cdi/moduletemplate.yaml +++ b/config/addons/gitrepository/cdi/moduletemplate.yaml @@ -1,7 +1,7 @@ # ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # -# Prerequisite: GitRepository (otterscale-module-operator) must exist in flux-system. +# Prerequisite: GitRepository (otterscale-repository) must exist in flux-system. # Apply: kubectl apply -k config/addons/gitrepository/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -19,6 +19,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/cdi/deploy diff --git a/config/addons/gitrepository/gateway-api/moduletemplate.yaml b/config/addons/gitrepository/gateway-api/moduletemplate.yaml index fefa5f9..ceb2243 100644 --- a/config/addons/gitrepository/gateway-api/moduletemplate.yaml +++ b/config/addons/gitrepository/gateway-api/moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/gateway-api/deploy diff --git a/config/addons/gitrepository/kubevirt/moduletemplate.yaml b/config/addons/gitrepository/kubevirt/moduletemplate.yaml index a079af4..023a217 100644 --- a/config/addons/gitrepository/kubevirt/moduletemplate.yaml +++ b/config/addons/gitrepository/kubevirt/moduletemplate.yaml @@ -16,6 +16,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/kubevirt/deploy diff --git a/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml b/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml index 03858b2..d642af6 100644 --- a/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml +++ b/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml @@ -1,7 +1,7 @@ # ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # -# Prerequisite: GitRepository (otterscale-module-operator) must exist in flux-system. +# Prerequisite: GitRepository (otterscale-repository) must exist in flux-system. # Apply: kubectl apply -k config/addons/gitrepository/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -19,6 +19,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/cdi/deploy diff --git a/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml b/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml index fefa5f9..ceb2243 100644 --- a/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml +++ b/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/gateway-api/deploy diff --git a/config/addons/gitrepository/module-templates/gitrepository.yaml b/config/addons/gitrepository/module-templates/gitrepository.yaml index 659b5e9..c84cb0f 100644 --- a/config/addons/gitrepository/module-templates/gitrepository.yaml +++ b/config/addons/gitrepository/module-templates/gitrepository.yaml @@ -3,7 +3,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system spec: interval: 1h diff --git a/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml b/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml index a079af4..023a217 100644 --- a/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml +++ b/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml @@ -16,6 +16,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/kubevirt/deploy diff --git a/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml b/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml index b2b1c69..05949c1 100644 --- a/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml +++ b/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/rook-ceph/deploy diff --git a/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml b/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml index e583811..c309b10 100644 --- a/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml +++ b/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/samba/deploy diff --git a/config/addons/gitrepository/rook-ceph/moduletemplate.yaml b/config/addons/gitrepository/rook-ceph/moduletemplate.yaml index b2b1c69..05949c1 100644 --- a/config/addons/gitrepository/rook-ceph/moduletemplate.yaml +++ b/config/addons/gitrepository/rook-ceph/moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/rook-ceph/deploy diff --git a/config/addons/gitrepository/samba/moduletemplate.yaml b/config/addons/gitrepository/samba/moduletemplate.yaml index e583811..c309b10 100644 --- a/config/addons/gitrepository/samba/moduletemplate.yaml +++ b/config/addons/gitrepository/samba/moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-module-operator + name: otterscale-repository namespace: flux-system path: config/addons/gitrepository/samba/deploy From 165094b77e5750cf69ecebcd0d407409bd0a9553 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:47:43 +0800 Subject: [PATCH 07/34] Revise kustomization.yaml --- Makefile | 2 +- .../{module-templates => }/gitrepository.yaml | 0 .../addons/gitrepository/kustomization.yaml | 14 +++ .../module-templates/cdi-moduletemplate.yaml | 24 ----- .../gateway-api-moduletemplate.yaml | 20 ---- .../kubevirt-moduletemplate.yaml | 21 ---- .../module-templates/kustomization.yaml | 14 --- .../rook-ceph-moduletemplate.yaml | 20 ---- .../samba-moduletemplate.yaml | 20 ---- .../addons/helmrepository/kustomization.yaml | 21 ++++ .../gpu-operator-helmrepository.yaml | 8 -- .../gpu-operator-moduletemplate.yaml | 77 -------------- .../module-templates/hami-helmrepository.yaml | 8 -- .../module-templates/hami-moduletemplate.yaml | 71 ------------- .../istio-helmrepository.yaml | 8 -- .../istio-moduletemplate-base.yaml | 42 -------- .../istio-moduletemplate-gateway.yaml | 45 -------- .../istio-moduletemplate-istiod.yaml | 47 -------- .../module-templates/kustomization.yaml | 21 ---- .../llm-d-infra-helmrepository.yaml | 8 -- .../llm-d-infra-moduletemplate.yaml | 58 ---------- .../prometheus-helmrepository.yaml | 8 -- .../prometheus-moduletemplate.yaml | 100 ------------------ 23 files changed, 36 insertions(+), 621 deletions(-) rename config/addons/gitrepository/{module-templates => }/gitrepository.yaml (100%) create mode 100644 config/addons/gitrepository/kustomization.yaml delete mode 100644 config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml delete mode 100644 config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml delete mode 100644 config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml delete mode 100644 config/addons/gitrepository/module-templates/kustomization.yaml delete mode 100644 config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml delete mode 100644 config/addons/gitrepository/module-templates/samba-moduletemplate.yaml create mode 100644 config/addons/helmrepository/kustomization.yaml delete mode 100644 config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml delete mode 100644 config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml delete mode 100644 config/addons/helmrepository/module-templates/hami-helmrepository.yaml delete mode 100644 config/addons/helmrepository/module-templates/hami-moduletemplate.yaml delete mode 100644 config/addons/helmrepository/module-templates/istio-helmrepository.yaml delete mode 100644 config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml delete mode 100644 config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml delete mode 100644 config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml delete mode 100644 config/addons/helmrepository/module-templates/kustomization.yaml delete mode 100644 config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml delete mode 100644 config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml delete mode 100644 config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml delete mode 100644 config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml diff --git a/Makefile b/Makefile index 07ec38b..d3bc3ca 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository/module-templates; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository/module-templates; } > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository; } > dist/install.yaml ##@ Deployment diff --git a/config/addons/gitrepository/module-templates/gitrepository.yaml b/config/addons/gitrepository/gitrepository.yaml similarity index 100% rename from config/addons/gitrepository/module-templates/gitrepository.yaml rename to config/addons/gitrepository/gitrepository.yaml diff --git a/config/addons/gitrepository/kustomization.yaml b/config/addons/gitrepository/kustomization.yaml new file mode 100644 index 0000000..027c8d9 --- /dev/null +++ b/config/addons/gitrepository/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# GitRepository + ModuleTemplate only (no Module CRs). +# Used by build-installer — install.yaml must not contain Module. +# +# Keep in sync with gitrepository.yaml and */moduletemplate.yaml +resources: + - gitrepository.yaml + - gateway-api/moduletemplate.yaml + - cdi/moduletemplate.yaml + - kubevirt/moduletemplate.yaml + - samba/moduletemplate.yaml + - rook-ceph/moduletemplate.yaml diff --git a/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml b/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml deleted file mode 100644 index d642af6..0000000 --- a/config/addons/gitrepository/module-templates/cdi-moduletemplate.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 -# Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. -# -# Prerequisite: GitRepository (otterscale-repository) must exist in flux-system. -# Apply: kubectl apply -k config/addons/gitrepository/cdi/ -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: cdi -spec: - namespace: cdi - - description: >- - Containerized Data Importer v1.64.0 — PVC data import for KubeVirt VM disk images. - Deploys via FluxCD Kustomization from upstream release YAMLs. - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/cdi/deploy diff --git a/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml b/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml deleted file mode 100644 index ceb2243..0000000 --- a/config/addons/gitrepository/module-templates/gateway-api-moduletemplate.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# ModuleTemplate — Kubernetes Gateway API v1.5.0 (Standard channel) -# Uses FluxCD Kustomization. CRDs only (GatewayClass, Gateway, HTTPRoute, etc.) -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: gateway-api -spec: - namespace: gateway-api-system - - description: >- - Kubernetes Gateway API v1.5.0 — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/gateway-api/deploy diff --git a/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml b/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml deleted file mode 100644 index 023a217..0000000 --- a/config/addons/gitrepository/module-templates/kubevirt-moduletemplate.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# ModuleTemplate — KubeVirt v1.8.0-rc.0 -# Uses FluxCD Kustomization. Deploy CDI first. -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: kubevirt -spec: - namespace: kubevirt - - description: >- - KubeVirt v1.8.0-rc.0 — enables Kubernetes to manage VMs natively. - Requires CDI for VM disk image import. - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/kubevirt/deploy diff --git a/config/addons/gitrepository/module-templates/kustomization.yaml b/config/addons/gitrepository/module-templates/kustomization.yaml deleted file mode 100644 index 44f0a5a..0000000 --- a/config/addons/gitrepository/module-templates/kustomization.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# GitRepository + ModuleTemplate only (no Module CRs). -# Used by build-installer — install.yaml must not contain Module. -# -# Keep in sync with ../gitrepository.yaml and ../*/moduletemplate.yaml -resources: - - gitrepository.yaml - - gateway-api-moduletemplate.yaml - - cdi-moduletemplate.yaml - - kubevirt-moduletemplate.yaml - - samba-moduletemplate.yaml - - rook-ceph-moduletemplate.yaml diff --git a/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml b/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml deleted file mode 100644 index 05949c1..0000000 --- a/config/addons/gitrepository/module-templates/rook-ceph-moduletemplate.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# ModuleTemplate — Rook-Ceph Operator v1.19.2 (Phase 1: Operator only) -# Uses FluxCD Kustomization. Phase 2: Apply rook-ceph-cluster Module for CephCluster. -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: rook-ceph -spec: - namespace: rook-ceph - - description: >- - Rook-Ceph Operator v1.19.2 — CRDs, Operator Deployment. Create CephCluster separately via rook-ceph-cluster Module. - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/rook-ceph/deploy diff --git a/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml b/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml deleted file mode 100644 index c309b10..0000000 --- a/config/addons/gitrepository/module-templates/samba-moduletemplate.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# ModuleTemplate — Samba Operator v0.8 -# Uses FluxCD Kustomization. Deploys from remote release YAML. -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: samba -spec: - namespace: samba-operator-system - - description: >- - Samba Operator v0.8 — exposes PVCs over SMB/CIFS on Kubernetes. - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/samba/deploy diff --git a/config/addons/helmrepository/kustomization.yaml b/config/addons/helmrepository/kustomization.yaml new file mode 100644 index 0000000..3943def --- /dev/null +++ b/config/addons/helmrepository/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +# ModuleTemplate + HelmRepository only (no Module CRs). +# Used by build-installer to generate dist/install.yaml +# +# Included: gpu-operator, hami, prometheus, istio, llm-d-infra +# Order: HelmRepository first (sources), then ModuleTemplate +resources: + - gpu-operator/helmrepository.yaml + - gpu-operator/moduletemplate.yaml + - hami/helmrepository.yaml + - hami/moduletemplate.yaml + - prometheus/helmrepository.yaml + - prometheus/moduletemplate.yaml + - istio/helmrepository.yaml + - istio/moduletemplate-base.yaml + - istio/moduletemplate-istiod.yaml + - istio/moduletemplate-gateway.yaml + - llm-d-infra/helmrepository.yaml + - llm-d-infra/moduletemplate.yaml diff --git a/config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml b/config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml deleted file mode 100644 index ccffef3..0000000 --- a/config/addons/helmrepository/module-templates/gpu-operator-helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: nvidia-gpu-operator - namespace: flux-system -spec: - interval: 24h - url: https://nvidia.github.io/gpu-operator diff --git a/config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml b/config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml deleted file mode 100644 index 3d7fc5c..0000000 --- a/config/addons/helmrepository/module-templates/gpu-operator-moduletemplate.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# ModuleTemplate — NVIDIA GPU Operator blueprint -# -# Deploys NVIDIA GPU Operator for driver, DCGM, DCGM Exporter, Node Status Exporter. -# Device plugin and vGPU are disabled (use HAMI for GPU sharing). -# -# Apply: -# kubectl apply -f moduletemplate.yaml -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: gpu-operator -spec: - namespace: gpu-operator - - description: >- - Deploys NVIDIA GPU Operator (driver 580.x, DCGM, DCGM Exporter, Node Status Exporter). - Device plugin disabled for use with HAMI vGPU. - - helmRelease: - interval: 10m - - chart: - spec: - chart: gpu-operator - version: "25.10.1" - sourceRef: - kind: HelmRepository - name: nvidia-gpu-operator - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 30m - - values: - cdi: - enabled: false - - driver: - enabled: true - version: "580.105.08" - upgradePolicy: - autoUpgrade: false - - # 離線版本 (取消註解以啟用) - # driver: - # version: "580" - # usePrecompiled: true - - devicePlugin: - enabled: false - - operator: - cleanupCRD: true - upgradeCRD: false - - dcgm: - enabled: true - - dcgmExporter: - enabled: true - serviceMonitor: - enabled: true - - nodeStatusExporter: - enabled: true - - vgpuDeviceManager: - enabled: false diff --git a/config/addons/helmrepository/module-templates/hami-helmrepository.yaml b/config/addons/helmrepository/module-templates/hami-helmrepository.yaml deleted file mode 100644 index 1b787a4..0000000 --- a/config/addons/helmrepository/module-templates/hami-helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: hami - namespace: flux-system -spec: - interval: 24h - url: https://project-hami.github.io/HAMi/ diff --git a/config/addons/helmrepository/module-templates/hami-moduletemplate.yaml b/config/addons/helmrepository/module-templates/hami-moduletemplate.yaml deleted file mode 100644 index d555fbf..0000000 --- a/config/addons/helmrepository/module-templates/hami-moduletemplate.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# ModuleTemplate — HAMI (Heterogeneous AI Computing Virtualization) blueprint -# -# Deploys HAMI for GPU sharing (vGPU) with NVIDIA GPU Operator. -# Requires GPU Operator to be installed first (driver + nvidia-validations). -# -# Apply: -# kubectl apply -f moduletemplate.yaml -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: hami -spec: - # HAMI scheduler and device plugin typically run in kube-system - namespace: kube-system - - description: >- - Deploys HAMI for GPU sharing (vGPU) with device split, memory/core scaling. - Integrates with NVIDIA GPU Operator via gpuOperatorToolkitReady. - - helmRelease: - interval: 10m - - chart: - spec: - chart: hami - version: "2.8.0" - sourceRef: - kind: HelmRepository - name: hami - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 30m - - values: - global: - imageTag: "v2.8.0" - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "31992" - # managedNodeSelectorEnable: false - # managedNodeSelector: - # usage: "nvidia.com/gpu.workload.config" - - scheduler: - service: - type: ClusterIP - - devicePlugin: - enabled: true - gpuOperatorToolkitReady: - enabled: true - hostPath: "/run/nvidia/validations" - deviceSplitCount: 10 - deviceMemoryScaling: 1 - deviceCoreScaling: 1 - service: - type: ClusterIP - runtimeClassName: "nvidia" - nvidiaNodeSelector: - gpu: null - nvidia.com/gpu.workload.config: "vgpu" diff --git a/config/addons/helmrepository/module-templates/istio-helmrepository.yaml b/config/addons/helmrepository/module-templates/istio-helmrepository.yaml deleted file mode 100644 index 41ffd7d..0000000 --- a/config/addons/helmrepository/module-templates/istio-helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: istio - namespace: flux-system -spec: - interval: 24h - url: https://istio-release.storage.googleapis.com/charts diff --git a/config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml deleted file mode 100644 index 0e783c9..0000000 --- a/config/addons/helmrepository/module-templates/istio-moduletemplate-base.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# ModuleTemplate — Istio base (CRDs) -# -# Installs Istio base chart (CRDs). Must be applied before istiod. -# See: https://istio.io/latest/docs/setup/install/helm/ -# -# Apply order: base → istiod → gateway -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: istio-base -spec: - namespace: istio-system - - description: >- - Installs Istio base chart (CRDs). Required before istiod. - - helmRelease: - interval: 10m - - chart: - spec: - chart: base - version: "1.29.1" - sourceRef: - kind: HelmRepository - name: istio - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 10m - - values: - defaultRevision: default diff --git a/config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml deleted file mode 100644 index c65f128..0000000 --- a/config/addons/helmrepository/module-templates/istio-moduletemplate-gateway.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# ModuleTemplate — Istio Ingress Gateway -# -# Installs Istio ingress gateway. Optional; deploy after istiod. -# See: https://istio.io/latest/docs/setup/additional-setup/gateway/ -# -# Apply order: base → istiod → gateway -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: istio-gateway -spec: - namespace: istio-ingress - - description: >- - Installs Istio ingress gateway for north-south traffic. - - helmRelease: - interval: 10m - - dependsOn: - - name: istiod - namespace: istio-system - - chart: - spec: - chart: gateway - version: "1.29.1" - sourceRef: - kind: HelmRepository - name: istio - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 10m - - values: {} diff --git a/config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml b/config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml deleted file mode 100644 index 2dc39e9..0000000 --- a/config/addons/helmrepository/module-templates/istio-moduletemplate-istiod.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# ModuleTemplate — Istiod (Istio control plane) -# -# Installs Istiod control plane. Requires istio-base to be installed first. -# See: https://istio.io/latest/docs/setup/install/helm/ -# -# Apply order: base → istiod → gateway -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: istiod -spec: - namespace: istio-system - - description: >- - Installs Istiod (Istio control plane / discovery server). - - helmRelease: - interval: 10m - - dependsOn: - - name: istio-base - namespace: istio-system - - chart: - spec: - chart: istiod - version: "1.29.1" - sourceRef: - kind: HelmRepository - name: istio - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 15m - - values: - env: - ENABLE_GATEWAY_API_INFERENCE_EXTENSION: "true" diff --git a/config/addons/helmrepository/module-templates/kustomization.yaml b/config/addons/helmrepository/module-templates/kustomization.yaml deleted file mode 100644 index 571bc92..0000000 --- a/config/addons/helmrepository/module-templates/kustomization.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# ModuleTemplate + HelmRepository only (no Module CRs). -# Used by build-installer to generate dist/module-templates.yaml -# -# Included: gpu-operator, hami, prometheus, istio, llm-d-infra -# Order: HelmRepository first (sources), then ModuleTemplate -resources: - - gpu-operator-helmrepository.yaml - - gpu-operator-moduletemplate.yaml - - hami-helmrepository.yaml - - hami-moduletemplate.yaml - - prometheus-helmrepository.yaml - - prometheus-moduletemplate.yaml - - istio-helmrepository.yaml - - istio-moduletemplate-base.yaml - - istio-moduletemplate-istiod.yaml - - istio-moduletemplate-gateway.yaml - - llm-d-infra-helmrepository.yaml - - llm-d-infra-moduletemplate.yaml diff --git a/config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml b/config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml deleted file mode 100644 index 2822645..0000000 --- a/config/addons/helmrepository/module-templates/llm-d-infra-helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: llm-d-infra - namespace: flux-system -spec: - interval: 24h - url: https://llm-d-incubation.github.io/llm-d-infra/ diff --git a/config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml b/config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml deleted file mode 100644 index 3140fac..0000000 --- a/config/addons/helmrepository/module-templates/llm-d-infra-moduletemplate.yaml +++ /dev/null @@ -1,58 +0,0 @@ -# ModuleTemplate — llm-d-infra blueprint -# -# Deploys llm-d infrastructure components: Gateway API configs, Helm charts, -# and operational tooling for llm-d (Kubernetes-native distributed LLM inference). -# -# Prerequisites: -# - Kubernetes 1.28+ -# - Gateway API v1.4.0+ installed -# - Gateway controller (Istio, Kgateway, AgentGateway or GKE) deployed -# -# See: https://github.com/llm-d-incubation/llm-d-infra -# -# Apply: -# kubectl apply -f moduletemplate.yaml -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: llm-d-infra -spec: - namespace: llm-d-infra - - description: >- - Deploys llm-d infrastructure (Gateway API, service mesh integration) - for high-performance distributed LLM inference framework. - - helmRelease: - interval: 10m - - chart: - spec: - chart: llm-d-infra - version: "1.3.10" - sourceRef: - kind: HelmRepository - name: llm-d-infra - namespace: flux-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 30m - - values: - gateway: - gatewayParameters: - resources: - limits: - cpu: "2" - memory: "1Gi" - service: - type: NodePort diff --git a/config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml b/config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml deleted file mode 100644 index 8a54131..0000000 --- a/config/addons/helmrepository/module-templates/prometheus-helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: prometheus-community - namespace: flux-system -spec: - interval: 24h - url: https://prometheus-community.github.io/helm-charts diff --git a/config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml b/config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml deleted file mode 100644 index 16a65d0..0000000 --- a/config/addons/helmrepository/module-templates/prometheus-moduletemplate.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# ModuleTemplate — kube-prometheus-stack blueprint -# -# Defines a reusable template for deploying the Prometheus monitoring stack -# (Prometheus + Alertmanager + Node Exporter, without Grafana) via FluxCD. -# -# IMPORTANT: Replace `storageClassName` with your cluster's actual StorageClass -# name before applying (e.g. standard, gp2, longhorn, etc.). -# -# Apply: -# kubectl apply -f moduletemplate.yaml -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: prometheus-stack -spec: - # Target namespace where the FluxCD HelmRelease object (and by default the - # Helm release itself) will be created. Can be overridden per-Module via - # Module.spec.namespace. - namespace: prometheus-stack - - description: >- - Deploys kube-prometheus-stack (Prometheus, Alertmanager, Node Exporter) - with persistent storage and remote-write receiver enabled. - Grafana is disabled; metrics retention is set to 365 days / 40 GiB. - - # spec.helmRelease is the FluxCD HelmReleaseSpec (not a full HelmRelease). - # The controller instantiates a HelmRelease from this spec and places it - # in spec.namespace above. - helmRelease: - # Reconciliation interval — how often FluxCD re-checks drift. - interval: 10m - - # Helm chart source: pulls kube-prometheus-stack from the - # prometheus-community HelmRepository (see helmrepository.yaml). - chart: - spec: - chart: kube-prometheus-stack - # Pin to a specific chart version for reproducibility. - # Remove or set to "*" to always track the latest. - version: ">=65.0.0" - sourceRef: - kind: HelmRepository - name: prometheus-community - namespace: flux-system - # How often FluxCD polls the chart index for new versions. - interval: 24h - - # Install strategy: retry up to 3 times on failure. - install: - remediation: - retries: 3 - - # Upgrade strategy: retry up to 3 times; force resource replacement on - # field conflicts. - upgrade: - remediation: - retries: 3 - force: false - - # Maximum time allowed for a single Helm operation before it is - # considered a failure. - timeout: 30m - - # Helm values — equivalent to the `--set` flags in the original - # `helm install` command. - values: - prometheus: - prometheusSpec: - # Accept remote-write requests (useful for forwarding from edge clusters). - enableRemoteWriteReceiver: true - - # Data retention: keep up to 365 days or 40 GiB, whichever limit is hit first. - retention: "365d" - retentionSize: "40GiB" - - # Discover ServiceMonitors from all namespaces, not just those that - # match the Helm release labels. - serviceMonitorSelectorNilUsesHelmValues: false - - # Persistent storage for Prometheus TSDB. - # ⚠️ Replace `storageClassName` with the actual StorageClass on your cluster. - storageSpec: - volumeClaimTemplate: - spec: - # TODO: replace with your cluster's StorageClass (e.g. standard, gp2, longhorn) - accessModes: - - ReadWriteOnce - resources: - requests: - storage: "40Gi" - service: - type: NodePort - - # Deploy Node Exporter on every node for host-level metrics. - nodeExporter: - enabled: true - - # Grafana is managed separately; disable the bundled instance. - grafana: - enabled: false From 8167e6685dadee3d6a96af42832a962e6ff3e3d4 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:51:02 +0800 Subject: [PATCH 08/34] Remove chinese --- config/addons/helmrepository/gpu-operator/moduletemplate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/addons/helmrepository/gpu-operator/moduletemplate.yaml b/config/addons/helmrepository/gpu-operator/moduletemplate.yaml index 3d7fc5c..6ca07cb 100644 --- a/config/addons/helmrepository/gpu-operator/moduletemplate.yaml +++ b/config/addons/helmrepository/gpu-operator/moduletemplate.yaml @@ -50,7 +50,7 @@ spec: upgradePolicy: autoUpgrade: false - # 離線版本 (取消註解以啟用) + # Offline version # driver: # version: "580" # usePrecompiled: true From 9ace9cdc61adfabfbccc822be53ef06c1a353e67 Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 18:58:41 +0800 Subject: [PATCH 09/34] Sync gitrepo tag version --- Makefile | 2 +- config/addons/gitrepository/gitrepository.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d3bc3ca..2f3c11c 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository; } > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository; } | sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' > dist/install.yaml ##@ Deployment diff --git a/config/addons/gitrepository/gitrepository.yaml b/config/addons/gitrepository/gitrepository.yaml index c84cb0f..38343f8 100644 --- a/config/addons/gitrepository/gitrepository.yaml +++ b/config/addons/gitrepository/gitrepository.yaml @@ -9,4 +9,4 @@ spec: interval: 1h url: https://github.com/otterscale/module-operator ref: - tag: v0.9.0-beta.3 + tag: MODULE_OPERATOR_VERSION From 32e9b36830460f15ce2380df704c4388cd4d172b Mon Sep 17 00:00:00 2001 From: Shawn Tsai Date: Tue, 17 Mar 2026 19:17:03 +0800 Subject: [PATCH 10/34] Update AGENTS.md --- AGENTS.md | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..4ca0653 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,348 @@ +# module-operator - AI Agent Guide + +## Project Structure + +**Single-group layout (default):** + +``` +cmd/main.go Manager entry (registers controllers/webhooks) +api//*_types.go CRD schemas (+kubebuilder markers) +api//zz_generated.* Auto-generated (DO NOT EDIT) +internal/controller/* Reconciliation logic +internal/webhook/* Validation/defaulting (if present) +config/crd/bases/* Generated CRDs (DO NOT EDIT) +config/rbac/role.yaml Generated RBAC (DO NOT EDIT) +config/samples/* Example CRs (edit these) +Makefile Build/test/deploy commands +PROJECT Kubebuilder metadata Auto-generated (DO NOT EDIT) +``` + +**Multi-group layout** (for projects with multiple API groups): + +``` +api///*_types.go CRD schemas by group +internal/controller//* Controllers by group +internal/webhook///* Webhooks by group and version (if present) +``` + +Multi-group layout organizes APIs by group name (e.g., `batch`, `apps`). Check the `PROJECT` file for `multigroup: true`. + +**To convert to multi-group layout:** + +1. Run: `kubebuilder edit --multigroup=true` +2. Move APIs: `mkdir -p api/ && mv api/ api//` +3. Move controllers: `mkdir -p internal/controller/ && mv internal/controller/*.go internal/controller//` +4. Move webhooks (if present): `mkdir -p internal/webhook/ && mv internal/webhook/ internal/webhook//` +5. Update import paths in all files +6. Fix `path` in `PROJECT` file for each resource +7. Update test suite CRD paths (add one more `..` to relative paths) + +## Critical Rules + +### Never Edit These (Auto-Generated) + +- `config/crd/bases/*.yaml` - from `make manifests` +- `config/rbac/role.yaml` - from `make manifests` +- `config/webhook/manifests.yaml` - from `make manifests` +- `**/zz_generated.*.go` - from `make generate` +- `PROJECT` - from `kubebuilder [OPTIONS]` + +### Never Remove Scaffold Markers + +Do NOT delete `// +kubebuilder:scaffold:*` comments. CLI injects code at these markers. + +### Keep Project Structure + +Do not move files around. The CLI expects files in specific locations. + +### Always Use CLI Commands + +Always use `kubebuilder create api` and `kubebuilder create webhook` to scaffold. Do NOT create files manually. + +### E2E Tests Require an Isolated Kind Cluster + +The e2e tests are designed to validate the solution in an isolated environment (similar to GitHub Actions CI). +Ensure you run them against a dedicated [Kind](https://kind.sigs.k8s.io/) cluster (not your “real” dev/prod cluster). + +## After Making Changes + +**After editing `*_types.go` or markers:** + +``` +make manifests # Regenerate CRDs/RBAC from markers +make generate # Regenerate DeepCopy methods +``` + +**After editing `*.go` files:** + +``` +make lint-fix # Auto-fix code style +make test # Run unit tests +``` + +## CLI Commands Cheat Sheet + +### Create API (your own types) + +```bash +kubebuilder create api --group --version --kind +``` + +### Deploy Image Plugin (scaffold to deploy/manage ANY container image) + +Generate a controller that deploys and manages a container image (nginx, redis, memcached, your app, etc.): + +```bash +# Example: deploying memcached +kubebuilder create api --group example.com --version v1alpha1 --kind Memcached \ + --image=memcached:alpine \ + --plugins=deploy-image.go.kubebuilder.io/v1-alpha +``` + +Scaffolds good-practice code: reconciliation logic, status conditions, finalizers, RBAC. Use as a reference implementation. + +### Create Webhooks + +```bash +# Validation + defaulting +kubebuilder create webhook --group --version --kind \ + --defaulting --programmatic-validation + +# Conversion webhook (for multi-version APIs) +kubebuilder create webhook --group --version v1 --kind \ + --conversion --spoke v2 +``` + +### Controller for Core Kubernetes Types + +```bash +# Watch Pods +kubebuilder create api --group core --version v1 --kind Pod \ + --controller=true --resource=false + +# Watch Deployments +kubebuilder create api --group apps --version v1 --kind Deployment \ + --controller=true --resource=false +``` + +### Controller for External Types (e.g., from other operators) + +Watch resources from external APIs (cert-manager, Argo CD, Istio, etc.): + +```bash +# Example: watching cert-manager Certificate resources +kubebuilder create api \ + --group cert-manager --version v1 --kind Certificate \ + --controller=true --resource=false \ + --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 \ + --external-api-domain=io \ + --external-api-module=github.com/cert-manager/cert-manager +``` + +**Note:** Use `--external-api-module=@` only if you need a specific version. Otherwise, omit `@` to use what's in go.mod. + +### Webhook for External Types + +```bash +# Example: validating external resources +kubebuilder create webhook \ + --group cert-manager --version v1 --kind Issuer \ + --defaulting \ + --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 \ + --external-api-domain=io \ + --external-api-module=github.com/cert-manager/cert-manager +``` + +## Testing & Development + +```bash +make test # Run unit tests (uses envtest: real K8s API + etcd) +make run # Run locally (uses current kubeconfig context) +``` + +Tests use **Ginkgo + Gomega** (BDD style). Check `suite_test.go` for setup. + +## Deployment Workflow + +```bash +# 1. Regenerate manifests +make manifests generate + +# 2. Build & deploy +export IMG=/:tag +make docker-build docker-push IMG=$IMG # Or: kind load docker-image $IMG --name +make deploy IMG=$IMG + +# 3. Test +kubectl apply -k config/samples/ + +# 4. Debug +kubectl logs -n -system deployment/-controller-manager -c manager -f +``` + +### API Design + +**Key markers for** `api//*_types.go`: + +```go +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Namespaced +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=".status.conditions[?(@.type=='Ready')].status" + +// On fields: +// +kubebuilder:validation:Required +// +kubebuilder:validation:Minimum=1 +// +kubebuilder:validation:MaxLength=100 +// +kubebuilder:validation:Pattern="^[a-z]+$" +// +kubebuilder:default="value" +``` + +- **Use** `metav1.Condition` for status (not custom string fields) +- **Use predefined types**: `metav1.Time` instead of `string` for dates +- **Follow K8s API conventions**: Standard field names (`spec`, `status`, `metadata`) + +### Controller Design + +**RBAC markers in** `internal/controller/*_controller.go`: + +```go +// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=mygroup.example.com,resources=mykinds/finalizers,verbs=update +// +kubebuilder:rbac:groups=events.k8s.io,resources=events,verbs=create;patch +// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete +``` + +**Implementation rules:** + +- **Idempotent reconciliation**: Safe to run multiple times +- **Re-fetch before updates**: `r.Get(ctx, req.NamespacedName, obj)` before `r.Update` to avoid conflicts +- **Structured logging**: `log := log.FromContext(ctx); log.Info("msg", "key", val)` +- **Owner references**: Enable automatic garbage collection (`SetControllerReference`) +- **Watch secondary resources**: Use `.Owns()` or `.Watches()`, not just `RequeueAfter` +- **Finalizers**: Clean up external resources (buckets, VMs, DNS entries) + +### Logging + +**Follow Kubernetes logging message style guidelines:** + +- Start from a capital letter +- Do not end the message with a period +- Active voice: subject present (`"Deployment could not create Pod"`) or omitted (`"Could not create Pod"`) +- Past tense: `"Could not delete Pod"` not `"Cannot delete Pod"` +- Specify object type: `"Deleted Pod"` not `"Deleted"` +- Balanced key-value pairs + +```go +log.Info("Starting reconciliation") +log.Info("Created Deployment", "name", deploy.Name) +log.Error(err, "Failed to create Pod", "name", name) +``` + +**Reference:** https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines + +### Webhooks + +- **Create all types together**: `--defaulting --programmatic-validation --conversion` +- **When`--force`is used**: Backup custom logic first, then restore after scaffolding +- **For multi-version APIs**: Use hub-and-spoke pattern (`--conversion --spoke v2`) + - Hub version: Usually oldest stable version (v1) + - Spoke versions: Newer versions that convert to/from hub (v2, v3) + - Example: `--group crew --version v1 --kind Captain --conversion --spoke v2` (v1 is hub, v2 is spoke) + +### Learning from Examples + +The **deploy-image plugin** scaffolds a complete controller following good practices. Use it as a reference implementation: + +```bash +kubebuilder create api --group example --version v1alpha1 --kind MyApp \ + --image= --plugins=deploy-image.go.kubebuilder.io/v1-alpha +``` + +Generated code includes: status conditions (`metav1.Condition`), finalizers, owner references, events, idempotent reconciliation. + +## Distribution Options + +### Option 1: YAML Bundle (Kustomize) + +```bash +# Generate dist/install.yaml from Kustomize manifests +make build-installer IMG=/:tag +``` + +**Key points:** + +- The `dist/install.yaml` is generated from Kustomize manifests (CRDs, RBAC, Deployment, HelmRepository, GitRepository, addon ModuleTemplates) +- Commit this file to your repository for easy distribution +- Users only need `kubectl` to install (no additional tools required) + +**GitRepository version substitution:** + +- `config/addons/gitrepository/gitrepository.yaml` uses the placeholder `MODULE_OPERATOR_VERSION` for the Git ref tag +- The `build-installer` target replaces it with the current version (`git describe --tags --always`) via `sed` before writing `dist/install.yaml` +- Addons (CDI, KubeVirt, etc.) are thus sourced from the same version as the operator being built, enabling feature-branch testing without hardcoded tags + +**Example:** Users install with a single command: + +```bash +kubectl apply -f https://raw.githubusercontent.com////dist/install.yaml +``` + +### Option 2: Helm Chart + +```bash +kubebuilder edit --plugins=helm/v2-alpha # Generates dist/chart/ (default) +kubebuilder edit --plugins=helm/v2-alpha --output-dir=charts # Generates charts/chart/ +``` + +**For development:** + +```bash +make helm-deploy IMG=/: # Deploy manager via Helm +make helm-deploy IMG=$IMG HELM_EXTRA_ARGS="--set ..." # Deploy with custom values +make helm-status # Show release status +make helm-uninstall # Remove release +make helm-history # View release history +make helm-rollback # Rollback to previous version +``` + +**For end users/production:** + +```bash +helm install my-release .//chart/ --namespace --create-namespace +``` + +**Important:** If you add webhooks or modify manifests after initial chart generation: + +1. Backup any customizations in `/chart/values.yaml` and `/chart/manager/manager.yaml` +2. Re-run: `kubebuilder edit --plugins=helm/v2-alpha --force` (use same `--output-dir` if customized) +3. Manually restore your custom values from the backup + +### Publish Container Image + +```bash +export IMG=/: +make docker-build docker-push IMG=$IMG +``` + +## References + +### Essential Reading + +- **Kubebuilder Book**: https://book.kubebuilder.io (comprehensive guide) +- **controller-runtime FAQ**: https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md (common patterns and questions) +- **Good Practices**: https://book.kubebuilder.io/reference/good-practices.html (why reconciliation is idempotent, status conditions, etc.) +- **Logging Conventions**: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines (message style, verbosity levels) + +### API Design & Implementation + +- **API Conventions**: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md +- **Operator Pattern**: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ +- **Markers Reference**: https://book.kubebuilder.io/reference/markers.html + +### Tools & Libraries + +- **controller-runtime**: https://github.com/kubernetes-sigs/controller-runtime +- **controller-tools**: https://github.com/kubernetes-sigs/controller-tools +- **Kubebuilder Repo**: https://github.com/kubernetes-sigs/kubebuilder From dadd03b93c1c4c8931b243666e3cacc32c2d0b1e Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:46:11 +0800 Subject: [PATCH 11/34] feat: remove Samba operator resources and templates from kustomization --- .../addons/gitrepository/kustomization.yaml | 1 - .../samba/deploy/kustomization.yaml | 6 ------ config/addons/gitrepository/samba/module.yaml | 6 ------ .../gitrepository/samba/moduletemplate.yaml | 20 ------------------- 4 files changed, 33 deletions(-) delete mode 100644 config/addons/gitrepository/samba/deploy/kustomization.yaml delete mode 100644 config/addons/gitrepository/samba/module.yaml delete mode 100644 config/addons/gitrepository/samba/moduletemplate.yaml diff --git a/config/addons/gitrepository/kustomization.yaml b/config/addons/gitrepository/kustomization.yaml index 027c8d9..6abadf1 100644 --- a/config/addons/gitrepository/kustomization.yaml +++ b/config/addons/gitrepository/kustomization.yaml @@ -10,5 +10,4 @@ resources: - gateway-api/moduletemplate.yaml - cdi/moduletemplate.yaml - kubevirt/moduletemplate.yaml - - samba/moduletemplate.yaml - rook-ceph/moduletemplate.yaml diff --git a/config/addons/gitrepository/samba/deploy/kustomization.yaml b/config/addons/gitrepository/samba/deploy/kustomization.yaml deleted file mode 100644 index bdf2c84..0000000 --- a/config/addons/gitrepository/samba/deploy/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Samba Operator deployment — remote resources for FluxCD Kustomization -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - https://github.com/samba-in-kubernetes/samba-operator/releases/download/v0.8/samba-operator-v0.8-default.yaml diff --git a/config/addons/gitrepository/samba/module.yaml b/config/addons/gitrepository/samba/module.yaml deleted file mode 100644 index 7cedd3d..0000000 --- a/config/addons/gitrepository/samba/module.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: module.otterscale.io/v1alpha1 -kind: Module -metadata: - name: samba -spec: - templateRef: samba diff --git a/config/addons/gitrepository/samba/moduletemplate.yaml b/config/addons/gitrepository/samba/moduletemplate.yaml deleted file mode 100644 index c309b10..0000000 --- a/config/addons/gitrepository/samba/moduletemplate.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# ModuleTemplate — Samba Operator v0.8 -# Uses FluxCD Kustomization. Deploys from remote release YAML. -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: samba -spec: - namespace: samba-operator-system - - description: >- - Samba Operator v0.8 — exposes PVCs over SMB/CIFS on Kubernetes. - - kustomization: - interval: 30m - prune: true - sourceRef: - kind: GitRepository - name: otterscale-repository - namespace: flux-system - path: config/addons/gitrepository/samba/deploy From 0c5bf2eb7909b9ff32ea2b6585442a68f8aa54a9 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:46:22 +0800 Subject: [PATCH 12/34] feat: add dependency on CDI in KubeVirt module template --- config/addons/gitrepository/kubevirt/moduletemplate.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/addons/gitrepository/kubevirt/moduletemplate.yaml b/config/addons/gitrepository/kubevirt/moduletemplate.yaml index 023a217..c9ba4be 100644 --- a/config/addons/gitrepository/kubevirt/moduletemplate.yaml +++ b/config/addons/gitrepository/kubevirt/moduletemplate.yaml @@ -14,6 +14,9 @@ spec: kustomization: interval: 30m prune: true + dependsOn: + - name: cdi + namespace: cdi sourceRef: kind: GitRepository name: otterscale-repository From 2b434fa069dc91488eb8a6d26e775cc9465bf0e6 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:50:02 +0800 Subject: [PATCH 13/34] feat: add dependency on gpu-operator in HAMI module template --- config/addons/helmrepository/hami/moduletemplate.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/addons/helmrepository/hami/moduletemplate.yaml b/config/addons/helmrepository/hami/moduletemplate.yaml index d555fbf..05e9e16 100644 --- a/config/addons/helmrepository/hami/moduletemplate.yaml +++ b/config/addons/helmrepository/hami/moduletemplate.yaml @@ -20,6 +20,10 @@ spec: helmRelease: interval: 10m + dependsOn: + - name: gpu-operator + namespace: gpu-operator + chart: spec: chart: hami From 2fc68312484a44ad69ffc90fad630bf46538b842 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:50:06 +0800 Subject: [PATCH 14/34] feat: add dependencies for gpu-operator, istio-gateway, and gateway-api in llm-d-infra module template --- .../addons/helmrepository/llm-d-infra/moduletemplate.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml b/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml index 3140fac..d82a3aa 100644 --- a/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml +++ b/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml @@ -26,6 +26,14 @@ spec: helmRelease: interval: 10m + dependsOn: + - name: gpu-operator + namespace: gpu-operator + - name: istio-gateway + namespace: istio-ingress + - name: gateway-api + namespace: gateway-api-system + chart: spec: chart: llm-d-infra From 2ba86ca34cfc30ec5d2619a82ed064b557d035d4 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:51:59 +0800 Subject: [PATCH 15/34] feat: add dependency on rook-ceph for kube-prometheus-stack module template --- config/addons/helmrepository/prometheus/moduletemplate.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/addons/helmrepository/prometheus/moduletemplate.yaml b/config/addons/helmrepository/prometheus/moduletemplate.yaml index 16a65d0..4ff57d1 100644 --- a/config/addons/helmrepository/prometheus/moduletemplate.yaml +++ b/config/addons/helmrepository/prometheus/moduletemplate.yaml @@ -30,6 +30,10 @@ spec: # Reconciliation interval — how often FluxCD re-checks drift. interval: 10m + dependsOn: + - name: rook-ceph + namespace: rook-ceph + # Helm chart source: pulls kube-prometheus-stack from the # prometheus-community HelmRepository (see helmrepository.yaml). chart: From c2a54b84c933a0544d607928fa5cea36870dfbff Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:54:50 +0800 Subject: [PATCH 16/34] feat: remove module.yaml references and add new module samples for various components --- config/addons/helmrepository/gpu-operator/kustomization.yaml | 1 - config/addons/helmrepository/hami/kustomization.yaml | 1 - config/addons/helmrepository/istio/kustomization.yaml | 3 --- config/addons/helmrepository/llm-d-infra/kustomization.yaml | 1 - config/addons/helmrepository/prometheus/kustomization.yaml | 1 - .../gitrepository/cdi/module.yaml => samples/module-cdi.yaml} | 0 .../module.yaml => samples/module-gateway-api.yaml} | 0 .../module.yaml => samples/module-gpu-operator.yaml} | 0 .../hami/module.yaml => samples/module-hami.yaml} | 0 .../istio/module-base.yaml => samples/module-istio-base.yaml} | 0 .../module-gateway.yaml => samples/module-istio-gateway.yaml} | 0 .../module-istiod.yaml => samples/module-istio-istiod.yaml} | 0 .../kubevirt/module.yaml => samples/module-kubevirt.yaml} | 0 .../module.yaml => samples/module-llm-d-infra.yaml} | 0 .../prometheus/module.yaml => samples/module-prometheus.yaml} | 0 .../rook-ceph/module.yaml => samples/module-rook-ceph.yaml} | 0 16 files changed, 7 deletions(-) rename config/{addons/gitrepository/cdi/module.yaml => samples/module-cdi.yaml} (100%) rename config/{addons/gitrepository/gateway-api/module.yaml => samples/module-gateway-api.yaml} (100%) rename config/{addons/helmrepository/gpu-operator/module.yaml => samples/module-gpu-operator.yaml} (100%) rename config/{addons/helmrepository/hami/module.yaml => samples/module-hami.yaml} (100%) rename config/{addons/helmrepository/istio/module-base.yaml => samples/module-istio-base.yaml} (100%) rename config/{addons/helmrepository/istio/module-gateway.yaml => samples/module-istio-gateway.yaml} (100%) rename config/{addons/helmrepository/istio/module-istiod.yaml => samples/module-istio-istiod.yaml} (100%) rename config/{addons/gitrepository/kubevirt/module.yaml => samples/module-kubevirt.yaml} (100%) rename config/{addons/helmrepository/llm-d-infra/module.yaml => samples/module-llm-d-infra.yaml} (100%) rename config/{addons/helmrepository/prometheus/module.yaml => samples/module-prometheus.yaml} (100%) rename config/{addons/gitrepository/rook-ceph/module.yaml => samples/module-rook-ceph.yaml} (100%) diff --git a/config/addons/helmrepository/gpu-operator/kustomization.yaml b/config/addons/helmrepository/gpu-operator/kustomization.yaml index 3d1af02..87af6c2 100644 --- a/config/addons/helmrepository/gpu-operator/kustomization.yaml +++ b/config/addons/helmrepository/gpu-operator/kustomization.yaml @@ -4,4 +4,3 @@ kind: Kustomization resources: - helmrepository.yaml - moduletemplate.yaml - - module.yaml diff --git a/config/addons/helmrepository/hami/kustomization.yaml b/config/addons/helmrepository/hami/kustomization.yaml index 3d1af02..87af6c2 100644 --- a/config/addons/helmrepository/hami/kustomization.yaml +++ b/config/addons/helmrepository/hami/kustomization.yaml @@ -4,4 +4,3 @@ kind: Kustomization resources: - helmrepository.yaml - moduletemplate.yaml - - module.yaml diff --git a/config/addons/helmrepository/istio/kustomization.yaml b/config/addons/helmrepository/istio/kustomization.yaml index ab50910..bcb3145 100644 --- a/config/addons/helmrepository/istio/kustomization.yaml +++ b/config/addons/helmrepository/istio/kustomization.yaml @@ -9,6 +9,3 @@ resources: - moduletemplate-base.yaml - moduletemplate-istiod.yaml - moduletemplate-gateway.yaml - - module-base.yaml - - module-istiod.yaml - - module-gateway.yaml diff --git a/config/addons/helmrepository/llm-d-infra/kustomization.yaml b/config/addons/helmrepository/llm-d-infra/kustomization.yaml index a9a747a..4ccfe39 100644 --- a/config/addons/helmrepository/llm-d-infra/kustomization.yaml +++ b/config/addons/helmrepository/llm-d-infra/kustomization.yaml @@ -5,4 +5,3 @@ kind: Kustomization resources: - helmrepository.yaml - moduletemplate.yaml - - module.yaml diff --git a/config/addons/helmrepository/prometheus/kustomization.yaml b/config/addons/helmrepository/prometheus/kustomization.yaml index 3ea9247..8c2fd23 100644 --- a/config/addons/helmrepository/prometheus/kustomization.yaml +++ b/config/addons/helmrepository/prometheus/kustomization.yaml @@ -7,4 +7,3 @@ kind: Kustomization resources: - helmrepository.yaml - moduletemplate.yaml - - module.yaml diff --git a/config/addons/gitrepository/cdi/module.yaml b/config/samples/module-cdi.yaml similarity index 100% rename from config/addons/gitrepository/cdi/module.yaml rename to config/samples/module-cdi.yaml diff --git a/config/addons/gitrepository/gateway-api/module.yaml b/config/samples/module-gateway-api.yaml similarity index 100% rename from config/addons/gitrepository/gateway-api/module.yaml rename to config/samples/module-gateway-api.yaml diff --git a/config/addons/helmrepository/gpu-operator/module.yaml b/config/samples/module-gpu-operator.yaml similarity index 100% rename from config/addons/helmrepository/gpu-operator/module.yaml rename to config/samples/module-gpu-operator.yaml diff --git a/config/addons/helmrepository/hami/module.yaml b/config/samples/module-hami.yaml similarity index 100% rename from config/addons/helmrepository/hami/module.yaml rename to config/samples/module-hami.yaml diff --git a/config/addons/helmrepository/istio/module-base.yaml b/config/samples/module-istio-base.yaml similarity index 100% rename from config/addons/helmrepository/istio/module-base.yaml rename to config/samples/module-istio-base.yaml diff --git a/config/addons/helmrepository/istio/module-gateway.yaml b/config/samples/module-istio-gateway.yaml similarity index 100% rename from config/addons/helmrepository/istio/module-gateway.yaml rename to config/samples/module-istio-gateway.yaml diff --git a/config/addons/helmrepository/istio/module-istiod.yaml b/config/samples/module-istio-istiod.yaml similarity index 100% rename from config/addons/helmrepository/istio/module-istiod.yaml rename to config/samples/module-istio-istiod.yaml diff --git a/config/addons/gitrepository/kubevirt/module.yaml b/config/samples/module-kubevirt.yaml similarity index 100% rename from config/addons/gitrepository/kubevirt/module.yaml rename to config/samples/module-kubevirt.yaml diff --git a/config/addons/helmrepository/llm-d-infra/module.yaml b/config/samples/module-llm-d-infra.yaml similarity index 100% rename from config/addons/helmrepository/llm-d-infra/module.yaml rename to config/samples/module-llm-d-infra.yaml diff --git a/config/addons/helmrepository/prometheus/module.yaml b/config/samples/module-prometheus.yaml similarity index 100% rename from config/addons/helmrepository/prometheus/module.yaml rename to config/samples/module-prometheus.yaml diff --git a/config/addons/gitrepository/rook-ceph/module.yaml b/config/samples/module-rook-ceph.yaml similarity index 100% rename from config/addons/gitrepository/rook-ceph/module.yaml rename to config/samples/module-rook-ceph.yaml From 6eb502049471eb99c61f9fe383af75b02f83ed9e Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 13:57:20 +0800 Subject: [PATCH 17/34] feat: remove unused kustomization.yaml files for various addons --- .../helmrepository/gpu-operator/kustomization.yaml | 6 ------ config/addons/helmrepository/hami/kustomization.yaml | 6 ------ config/addons/helmrepository/istio/kustomization.yaml | 11 ----------- .../helmrepository/llm-d-infra/kustomization.yaml | 7 ------- .../helmrepository/prometheus/kustomization.yaml | 9 --------- 5 files changed, 39 deletions(-) delete mode 100644 config/addons/helmrepository/gpu-operator/kustomization.yaml delete mode 100644 config/addons/helmrepository/hami/kustomization.yaml delete mode 100644 config/addons/helmrepository/istio/kustomization.yaml delete mode 100644 config/addons/helmrepository/llm-d-infra/kustomization.yaml delete mode 100644 config/addons/helmrepository/prometheus/kustomization.yaml diff --git a/config/addons/helmrepository/gpu-operator/kustomization.yaml b/config/addons/helmrepository/gpu-operator/kustomization.yaml deleted file mode 100644 index 87af6c2..0000000 --- a/config/addons/helmrepository/gpu-operator/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - helmrepository.yaml - - moduletemplate.yaml diff --git a/config/addons/helmrepository/hami/kustomization.yaml b/config/addons/helmrepository/hami/kustomization.yaml deleted file mode 100644 index 87af6c2..0000000 --- a/config/addons/helmrepository/hami/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - helmrepository.yaml - - moduletemplate.yaml diff --git a/config/addons/helmrepository/istio/kustomization.yaml b/config/addons/helmrepository/istio/kustomization.yaml deleted file mode 100644 index bcb3145..0000000 --- a/config/addons/helmrepository/istio/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# Deploy order: base → istiod → gateway -# Ensure istio-base is ready before istiod (FluxCD reconciles independently; -# consider applying in sequence or using dependsOn if needed). -resources: - - helmrepository.yaml - - moduletemplate-base.yaml - - moduletemplate-istiod.yaml - - moduletemplate-gateway.yaml diff --git a/config/addons/helmrepository/llm-d-infra/kustomization.yaml b/config/addons/helmrepository/llm-d-infra/kustomization.yaml deleted file mode 100644 index 4ccfe39..0000000 --- a/config/addons/helmrepository/llm-d-infra/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# Deploy after Istio (or other Gateway controller) is ready. -resources: - - helmrepository.yaml - - moduletemplate.yaml diff --git a/config/addons/helmrepository/prometheus/kustomization.yaml b/config/addons/helmrepository/prometheus/kustomization.yaml deleted file mode 100644 index 8c2fd23..0000000 --- a/config/addons/helmrepository/prometheus/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# Deploy order matters: source must exist before the HelmRelease is created, -# and the ModuleTemplate must exist before the Module references it. -# Resources are applied in the order listed below. -resources: - - helmrepository.yaml - - moduletemplate.yaml From a006324c7e7fed01c4f957d59eb1f82a47f69b4e Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:00:52 +0800 Subject: [PATCH 18/34] feat: add module templates and Helm repositories for various components including CDI, KubeVirt, GPU Operator, HAMI, Istio, and Rook-Ceph --- AGENTS.md | 4 ++-- Makefile | 2 +- config/addons/gitrepository/kustomization.yaml | 13 ------------- .../cdi/deploy/kustomization.yaml | 0 .../cdi/moduletemplate.yaml | 4 ++-- .../gateway-api/deploy/kustomization.yaml | 0 .../gateway-api/moduletemplate.yaml | 2 +- .../gitrepository.yaml | 2 +- .../gpu-operator/helmrepository.yaml | 0 .../gpu-operator/moduletemplate.yaml | 0 .../hami/helmrepository.yaml | 0 .../hami/moduletemplate.yaml | 0 .../istio/helmrepository.yaml | 0 .../istio/moduletemplate-base.yaml | 0 .../istio/moduletemplate-gateway.yaml | 0 .../istio/moduletemplate-istiod.yaml | 0 .../kubevirt/deploy/kustomization.yaml | 0 .../kubevirt/moduletemplate.yaml | 2 +- .../kustomization.yaml | 18 +++++++++++++----- .../llm-d-infra/helmrepository.yaml | 0 .../llm-d-infra/moduletemplate.yaml | 0 .../prometheus/helmrepository.yaml | 0 .../prometheus/moduletemplate.yaml | 0 .../rook-ceph/deploy/kustomization.yaml | 0 .../rook-ceph/moduletemplate.yaml | 2 +- 25 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 config/addons/gitrepository/kustomization.yaml rename config/{addons/gitrepository => modules}/cdi/deploy/kustomization.yaml (100%) rename config/{addons/gitrepository => modules}/cdi/moduletemplate.yaml (85%) rename config/{addons/gitrepository => modules}/gateway-api/deploy/kustomization.yaml (100%) rename config/{addons/gitrepository => modules}/gateway-api/moduletemplate.yaml (91%) rename config/{addons/gitrepository => modules}/gitrepository.yaml (77%) rename config/{addons/helmrepository => modules}/gpu-operator/helmrepository.yaml (100%) rename config/{addons/helmrepository => modules}/gpu-operator/moduletemplate.yaml (100%) rename config/{addons/helmrepository => modules}/hami/helmrepository.yaml (100%) rename config/{addons/helmrepository => modules}/hami/moduletemplate.yaml (100%) rename config/{addons/helmrepository => modules}/istio/helmrepository.yaml (100%) rename config/{addons/helmrepository => modules}/istio/moduletemplate-base.yaml (100%) rename config/{addons/helmrepository => modules}/istio/moduletemplate-gateway.yaml (100%) rename config/{addons/helmrepository => modules}/istio/moduletemplate-istiod.yaml (100%) rename config/{addons/gitrepository => modules}/kubevirt/deploy/kustomization.yaml (100%) rename config/{addons/gitrepository => modules}/kubevirt/moduletemplate.yaml (91%) rename config/{addons/helmrepository => modules}/kustomization.yaml (51%) rename config/{addons/helmrepository => modules}/llm-d-infra/helmrepository.yaml (100%) rename config/{addons/helmrepository => modules}/llm-d-infra/moduletemplate.yaml (100%) rename config/{addons/helmrepository => modules}/prometheus/helmrepository.yaml (100%) rename config/{addons/helmrepository => modules}/prometheus/moduletemplate.yaml (100%) rename config/{addons/gitrepository => modules}/rook-ceph/deploy/kustomization.yaml (100%) rename config/{addons/gitrepository => modules}/rook-ceph/moduletemplate.yaml (91%) diff --git a/AGENTS.md b/AGENTS.md index 4ca0653..d9916ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -279,9 +279,9 @@ make build-installer IMG=/:tag **GitRepository version substitution:** -- `config/addons/gitrepository/gitrepository.yaml` uses the placeholder `MODULE_OPERATOR_VERSION` for the Git ref tag +- `config/modules/gitrepository.yaml` uses the placeholder `MODULE_OPERATOR_VERSION` for the Git ref tag - The `build-installer` target replaces it with the current version (`git describe --tags --always`) via `sed` before writing `dist/install.yaml` -- Addons (CDI, KubeVirt, etc.) are thus sourced from the same version as the operator being built, enabling feature-branch testing without hardcoded tags +- Modules (CDI, KubeVirt, etc.) are thus sourced from the same version as the operator being built, enabling feature-branch testing without hardcoded tags **Example:** Users install with a single command: diff --git a/Makefile b/Makefile index 2f3c11c..b4c7c97 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/addons/helmrepository; echo "---"; "$(KUSTOMIZE)" build config/addons/gitrepository; } | sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/modules; } | sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' > dist/install.yaml ##@ Deployment diff --git a/config/addons/gitrepository/kustomization.yaml b/config/addons/gitrepository/kustomization.yaml deleted file mode 100644 index 6abadf1..0000000 --- a/config/addons/gitrepository/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -# GitRepository + ModuleTemplate only (no Module CRs). -# Used by build-installer — install.yaml must not contain Module. -# -# Keep in sync with gitrepository.yaml and */moduletemplate.yaml -resources: - - gitrepository.yaml - - gateway-api/moduletemplate.yaml - - cdi/moduletemplate.yaml - - kubevirt/moduletemplate.yaml - - rook-ceph/moduletemplate.yaml diff --git a/config/addons/gitrepository/cdi/deploy/kustomization.yaml b/config/modules/cdi/deploy/kustomization.yaml similarity index 100% rename from config/addons/gitrepository/cdi/deploy/kustomization.yaml rename to config/modules/cdi/deploy/kustomization.yaml diff --git a/config/addons/gitrepository/cdi/moduletemplate.yaml b/config/modules/cdi/moduletemplate.yaml similarity index 85% rename from config/addons/gitrepository/cdi/moduletemplate.yaml rename to config/modules/cdi/moduletemplate.yaml index d642af6..8318617 100644 --- a/config/addons/gitrepository/cdi/moduletemplate.yaml +++ b/config/modules/cdi/moduletemplate.yaml @@ -2,7 +2,7 @@ # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # # Prerequisite: GitRepository (otterscale-repository) must exist in flux-system. -# Apply: kubectl apply -k config/addons/gitrepository/cdi/ +# Apply: kubectl apply -k config/modules/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate metadata: @@ -21,4 +21,4 @@ spec: kind: GitRepository name: otterscale-repository namespace: flux-system - path: config/addons/gitrepository/cdi/deploy + path: config/modules/cdi/deploy diff --git a/config/addons/gitrepository/gateway-api/deploy/kustomization.yaml b/config/modules/gateway-api/deploy/kustomization.yaml similarity index 100% rename from config/addons/gitrepository/gateway-api/deploy/kustomization.yaml rename to config/modules/gateway-api/deploy/kustomization.yaml diff --git a/config/addons/gitrepository/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml similarity index 91% rename from config/addons/gitrepository/gateway-api/moduletemplate.yaml rename to config/modules/gateway-api/moduletemplate.yaml index ceb2243..5979366 100644 --- a/config/addons/gitrepository/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-repository namespace: flux-system - path: config/addons/gitrepository/gateway-api/deploy + path: config/modules/gateway-api/deploy diff --git a/config/addons/gitrepository/gitrepository.yaml b/config/modules/gitrepository.yaml similarity index 77% rename from config/addons/gitrepository/gitrepository.yaml rename to config/modules/gitrepository.yaml index 38343f8..f0fba73 100644 --- a/config/addons/gitrepository/gitrepository.yaml +++ b/config/modules/gitrepository.yaml @@ -1,5 +1,5 @@ # Shared GitRepository for addon ModuleTemplates (CDI, KubeVirt, etc.) -# All addon components deploy from this repo's config/addons/gitrepository/*/deploy paths. +# All addon components deploy from this repo's config/modules/*/deploy paths. apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: diff --git a/config/addons/helmrepository/gpu-operator/helmrepository.yaml b/config/modules/gpu-operator/helmrepository.yaml similarity index 100% rename from config/addons/helmrepository/gpu-operator/helmrepository.yaml rename to config/modules/gpu-operator/helmrepository.yaml diff --git a/config/addons/helmrepository/gpu-operator/moduletemplate.yaml b/config/modules/gpu-operator/moduletemplate.yaml similarity index 100% rename from config/addons/helmrepository/gpu-operator/moduletemplate.yaml rename to config/modules/gpu-operator/moduletemplate.yaml diff --git a/config/addons/helmrepository/hami/helmrepository.yaml b/config/modules/hami/helmrepository.yaml similarity index 100% rename from config/addons/helmrepository/hami/helmrepository.yaml rename to config/modules/hami/helmrepository.yaml diff --git a/config/addons/helmrepository/hami/moduletemplate.yaml b/config/modules/hami/moduletemplate.yaml similarity index 100% rename from config/addons/helmrepository/hami/moduletemplate.yaml rename to config/modules/hami/moduletemplate.yaml diff --git a/config/addons/helmrepository/istio/helmrepository.yaml b/config/modules/istio/helmrepository.yaml similarity index 100% rename from config/addons/helmrepository/istio/helmrepository.yaml rename to config/modules/istio/helmrepository.yaml diff --git a/config/addons/helmrepository/istio/moduletemplate-base.yaml b/config/modules/istio/moduletemplate-base.yaml similarity index 100% rename from config/addons/helmrepository/istio/moduletemplate-base.yaml rename to config/modules/istio/moduletemplate-base.yaml diff --git a/config/addons/helmrepository/istio/moduletemplate-gateway.yaml b/config/modules/istio/moduletemplate-gateway.yaml similarity index 100% rename from config/addons/helmrepository/istio/moduletemplate-gateway.yaml rename to config/modules/istio/moduletemplate-gateway.yaml diff --git a/config/addons/helmrepository/istio/moduletemplate-istiod.yaml b/config/modules/istio/moduletemplate-istiod.yaml similarity index 100% rename from config/addons/helmrepository/istio/moduletemplate-istiod.yaml rename to config/modules/istio/moduletemplate-istiod.yaml diff --git a/config/addons/gitrepository/kubevirt/deploy/kustomization.yaml b/config/modules/kubevirt/deploy/kustomization.yaml similarity index 100% rename from config/addons/gitrepository/kubevirt/deploy/kustomization.yaml rename to config/modules/kubevirt/deploy/kustomization.yaml diff --git a/config/addons/gitrepository/kubevirt/moduletemplate.yaml b/config/modules/kubevirt/moduletemplate.yaml similarity index 91% rename from config/addons/gitrepository/kubevirt/moduletemplate.yaml rename to config/modules/kubevirt/moduletemplate.yaml index c9ba4be..e02dfbc 100644 --- a/config/addons/gitrepository/kubevirt/moduletemplate.yaml +++ b/config/modules/kubevirt/moduletemplate.yaml @@ -21,4 +21,4 @@ spec: kind: GitRepository name: otterscale-repository namespace: flux-system - path: config/addons/gitrepository/kubevirt/deploy + path: config/modules/kubevirt/deploy diff --git a/config/addons/helmrepository/kustomization.yaml b/config/modules/kustomization.yaml similarity index 51% rename from config/addons/helmrepository/kustomization.yaml rename to config/modules/kustomization.yaml index 3943def..33c1fb2 100644 --- a/config/addons/helmrepository/kustomization.yaml +++ b/config/modules/kustomization.yaml @@ -1,12 +1,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# ModuleTemplate + HelmRepository only (no Module CRs). -# Used by build-installer to generate dist/install.yaml -# -# Included: gpu-operator, hami, prometheus, istio, llm-d-infra -# Order: HelmRepository first (sources), then ModuleTemplate +# Sources + ModuleTemplates only (no Module CRs). +# Used by build-installer to generate dist/install.yaml. +# Module CRs are in config/samples/ for users to apply selectively. resources: + # --- GitRepository source --- + - gitrepository.yaml + + # --- HelmRepository sources + ModuleTemplates --- - gpu-operator/helmrepository.yaml - gpu-operator/moduletemplate.yaml - hami/helmrepository.yaml @@ -19,3 +21,9 @@ resources: - istio/moduletemplate-gateway.yaml - llm-d-infra/helmrepository.yaml - llm-d-infra/moduletemplate.yaml + + # --- GitRepository ModuleTemplates --- + - gateway-api/moduletemplate.yaml + - cdi/moduletemplate.yaml + - kubevirt/moduletemplate.yaml + - rook-ceph/moduletemplate.yaml diff --git a/config/addons/helmrepository/llm-d-infra/helmrepository.yaml b/config/modules/llm-d-infra/helmrepository.yaml similarity index 100% rename from config/addons/helmrepository/llm-d-infra/helmrepository.yaml rename to config/modules/llm-d-infra/helmrepository.yaml diff --git a/config/addons/helmrepository/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml similarity index 100% rename from config/addons/helmrepository/llm-d-infra/moduletemplate.yaml rename to config/modules/llm-d-infra/moduletemplate.yaml diff --git a/config/addons/helmrepository/prometheus/helmrepository.yaml b/config/modules/prometheus/helmrepository.yaml similarity index 100% rename from config/addons/helmrepository/prometheus/helmrepository.yaml rename to config/modules/prometheus/helmrepository.yaml diff --git a/config/addons/helmrepository/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml similarity index 100% rename from config/addons/helmrepository/prometheus/moduletemplate.yaml rename to config/modules/prometheus/moduletemplate.yaml diff --git a/config/addons/gitrepository/rook-ceph/deploy/kustomization.yaml b/config/modules/rook-ceph/deploy/kustomization.yaml similarity index 100% rename from config/addons/gitrepository/rook-ceph/deploy/kustomization.yaml rename to config/modules/rook-ceph/deploy/kustomization.yaml diff --git a/config/addons/gitrepository/rook-ceph/moduletemplate.yaml b/config/modules/rook-ceph/moduletemplate.yaml similarity index 91% rename from config/addons/gitrepository/rook-ceph/moduletemplate.yaml rename to config/modules/rook-ceph/moduletemplate.yaml index 05949c1..adf34ae 100644 --- a/config/addons/gitrepository/rook-ceph/moduletemplate.yaml +++ b/config/modules/rook-ceph/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-repository namespace: flux-system - path: config/addons/gitrepository/rook-ceph/deploy + path: config/modules/rook-ceph/deploy From c13ff9c9ea0fcc78bfa3a0c2ea88a644bb99fa45 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:04:40 +0800 Subject: [PATCH 19/34] feat: update namespaces from flux-system to otterscale-system in module templates and Helm repositories --- config/modules/cdi/moduletemplate.yaml | 4 ++-- config/modules/gateway-api/moduletemplate.yaml | 2 +- config/modules/gitrepository.yaml | 2 +- config/modules/gpu-operator/helmrepository.yaml | 2 +- config/modules/gpu-operator/moduletemplate.yaml | 2 +- config/modules/hami/helmrepository.yaml | 2 +- config/modules/hami/moduletemplate.yaml | 2 +- config/modules/istio/helmrepository.yaml | 2 +- config/modules/istio/moduletemplate-base.yaml | 2 +- config/modules/istio/moduletemplate-gateway.yaml | 2 +- config/modules/istio/moduletemplate-istiod.yaml | 2 +- config/modules/kubevirt/moduletemplate.yaml | 2 +- config/modules/llm-d-infra/helmrepository.yaml | 2 +- config/modules/llm-d-infra/moduletemplate.yaml | 2 +- config/modules/prometheus/helmrepository.yaml | 2 +- config/modules/prometheus/moduletemplate.yaml | 2 +- config/modules/rook-ceph/moduletemplate.yaml | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/config/modules/cdi/moduletemplate.yaml b/config/modules/cdi/moduletemplate.yaml index 8318617..768a76d 100644 --- a/config/modules/cdi/moduletemplate.yaml +++ b/config/modules/cdi/moduletemplate.yaml @@ -1,7 +1,7 @@ # ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # -# Prerequisite: GitRepository (otterscale-repository) must exist in flux-system. +# Prerequisite: GitRepository (otterscale-repository) must exist in otterscale-system. # Apply: kubectl apply -k config/modules/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -20,5 +20,5 @@ spec: sourceRef: kind: GitRepository name: otterscale-repository - namespace: flux-system + namespace: otterscale-system path: config/modules/cdi/deploy diff --git a/config/modules/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml index 5979366..7114b50 100644 --- a/config/modules/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -16,5 +16,5 @@ spec: sourceRef: kind: GitRepository name: otterscale-repository - namespace: flux-system + namespace: otterscale-system path: config/modules/gateway-api/deploy diff --git a/config/modules/gitrepository.yaml b/config/modules/gitrepository.yaml index f0fba73..cc5143f 100644 --- a/config/modules/gitrepository.yaml +++ b/config/modules/gitrepository.yaml @@ -4,7 +4,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: name: otterscale-repository - namespace: flux-system + namespace: otterscale-system spec: interval: 1h url: https://github.com/otterscale/module-operator diff --git a/config/modules/gpu-operator/helmrepository.yaml b/config/modules/gpu-operator/helmrepository.yaml index ccffef3..d85176e 100644 --- a/config/modules/gpu-operator/helmrepository.yaml +++ b/config/modules/gpu-operator/helmrepository.yaml @@ -2,7 +2,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: nvidia-gpu-operator - namespace: flux-system + namespace: otterscale-system spec: interval: 24h url: https://nvidia.github.io/gpu-operator diff --git a/config/modules/gpu-operator/moduletemplate.yaml b/config/modules/gpu-operator/moduletemplate.yaml index 6ca07cb..d38085d 100644 --- a/config/modules/gpu-operator/moduletemplate.yaml +++ b/config/modules/gpu-operator/moduletemplate.yaml @@ -26,7 +26,7 @@ spec: sourceRef: kind: HelmRepository name: nvidia-gpu-operator - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/hami/helmrepository.yaml b/config/modules/hami/helmrepository.yaml index 1b787a4..ca66384 100644 --- a/config/modules/hami/helmrepository.yaml +++ b/config/modules/hami/helmrepository.yaml @@ -2,7 +2,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: hami - namespace: flux-system + namespace: otterscale-system spec: interval: 24h url: https://project-hami.github.io/HAMi/ diff --git a/config/modules/hami/moduletemplate.yaml b/config/modules/hami/moduletemplate.yaml index 05e9e16..21256eb 100644 --- a/config/modules/hami/moduletemplate.yaml +++ b/config/modules/hami/moduletemplate.yaml @@ -31,7 +31,7 @@ spec: sourceRef: kind: HelmRepository name: hami - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/istio/helmrepository.yaml b/config/modules/istio/helmrepository.yaml index 41ffd7d..456ea4f 100644 --- a/config/modules/istio/helmrepository.yaml +++ b/config/modules/istio/helmrepository.yaml @@ -2,7 +2,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: istio - namespace: flux-system + namespace: otterscale-system spec: interval: 24h url: https://istio-release.storage.googleapis.com/charts diff --git a/config/modules/istio/moduletemplate-base.yaml b/config/modules/istio/moduletemplate-base.yaml index 0e783c9..2b1ff0a 100644 --- a/config/modules/istio/moduletemplate-base.yaml +++ b/config/modules/istio/moduletemplate-base.yaml @@ -24,7 +24,7 @@ spec: sourceRef: kind: HelmRepository name: istio - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/istio/moduletemplate-gateway.yaml b/config/modules/istio/moduletemplate-gateway.yaml index c65f128..97bf768 100644 --- a/config/modules/istio/moduletemplate-gateway.yaml +++ b/config/modules/istio/moduletemplate-gateway.yaml @@ -28,7 +28,7 @@ spec: sourceRef: kind: HelmRepository name: istio - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/istio/moduletemplate-istiod.yaml b/config/modules/istio/moduletemplate-istiod.yaml index 2dc39e9..c2cb314 100644 --- a/config/modules/istio/moduletemplate-istiod.yaml +++ b/config/modules/istio/moduletemplate-istiod.yaml @@ -28,7 +28,7 @@ spec: sourceRef: kind: HelmRepository name: istio - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/kubevirt/moduletemplate.yaml b/config/modules/kubevirt/moduletemplate.yaml index e02dfbc..551fbd1 100644 --- a/config/modules/kubevirt/moduletemplate.yaml +++ b/config/modules/kubevirt/moduletemplate.yaml @@ -20,5 +20,5 @@ spec: sourceRef: kind: GitRepository name: otterscale-repository - namespace: flux-system + namespace: otterscale-system path: config/modules/kubevirt/deploy diff --git a/config/modules/llm-d-infra/helmrepository.yaml b/config/modules/llm-d-infra/helmrepository.yaml index 2822645..d924d27 100644 --- a/config/modules/llm-d-infra/helmrepository.yaml +++ b/config/modules/llm-d-infra/helmrepository.yaml @@ -2,7 +2,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: llm-d-infra - namespace: flux-system + namespace: otterscale-system spec: interval: 24h url: https://llm-d-incubation.github.io/llm-d-infra/ diff --git a/config/modules/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml index d82a3aa..cf1f588 100644 --- a/config/modules/llm-d-infra/moduletemplate.yaml +++ b/config/modules/llm-d-infra/moduletemplate.yaml @@ -41,7 +41,7 @@ spec: sourceRef: kind: HelmRepository name: llm-d-infra - namespace: flux-system + namespace: otterscale-system interval: 24h install: diff --git a/config/modules/prometheus/helmrepository.yaml b/config/modules/prometheus/helmrepository.yaml index 8a54131..22c65a9 100644 --- a/config/modules/prometheus/helmrepository.yaml +++ b/config/modules/prometheus/helmrepository.yaml @@ -2,7 +2,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: prometheus-community - namespace: flux-system + namespace: otterscale-system spec: interval: 24h url: https://prometheus-community.github.io/helm-charts diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 4ff57d1..587be21 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -45,7 +45,7 @@ spec: sourceRef: kind: HelmRepository name: prometheus-community - namespace: flux-system + namespace: otterscale-system # How often FluxCD polls the chart index for new versions. interval: 24h diff --git a/config/modules/rook-ceph/moduletemplate.yaml b/config/modules/rook-ceph/moduletemplate.yaml index adf34ae..48f1833 100644 --- a/config/modules/rook-ceph/moduletemplate.yaml +++ b/config/modules/rook-ceph/moduletemplate.yaml @@ -16,5 +16,5 @@ spec: sourceRef: kind: GitRepository name: otterscale-repository - namespace: flux-system + namespace: otterscale-system path: config/modules/rook-ceph/deploy From bc5c821ad1523232079d5f604fe0059b35f6c664 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:07:16 +0800 Subject: [PATCH 20/34] feat: update GitRepository references from otterscale-repository to otterscale-module-operator in module templates and Helm repository configurations --- config/modules/cdi/moduletemplate.yaml | 4 ++-- config/modules/gateway-api/moduletemplate.yaml | 2 +- config/modules/gitrepository.yaml | 2 +- config/modules/kubevirt/moduletemplate.yaml | 2 +- config/modules/prometheus/helmrepository.yaml | 2 +- config/modules/prometheus/moduletemplate.yaml | 4 ++-- config/modules/rook-ceph/moduletemplate.yaml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/modules/cdi/moduletemplate.yaml b/config/modules/cdi/moduletemplate.yaml index 768a76d..7ee655b 100644 --- a/config/modules/cdi/moduletemplate.yaml +++ b/config/modules/cdi/moduletemplate.yaml @@ -1,7 +1,7 @@ # ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # -# Prerequisite: GitRepository (otterscale-repository) must exist in otterscale-system. +# Prerequisite: GitRepository (otterscale-module-operator) must exist in otterscale-system. # Apply: kubectl apply -k config/modules/cdi/ apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -19,6 +19,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-repository + name: otterscale-module-operator namespace: otterscale-system path: config/modules/cdi/deploy diff --git a/config/modules/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml index 7114b50..ef79926 100644 --- a/config/modules/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-repository + name: otterscale-module-operator namespace: otterscale-system path: config/modules/gateway-api/deploy diff --git a/config/modules/gitrepository.yaml b/config/modules/gitrepository.yaml index cc5143f..f6e7de8 100644 --- a/config/modules/gitrepository.yaml +++ b/config/modules/gitrepository.yaml @@ -3,7 +3,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: - name: otterscale-repository + name: otterscale-module-operator namespace: otterscale-system spec: interval: 1h diff --git a/config/modules/kubevirt/moduletemplate.yaml b/config/modules/kubevirt/moduletemplate.yaml index 551fbd1..ae4fd91 100644 --- a/config/modules/kubevirt/moduletemplate.yaml +++ b/config/modules/kubevirt/moduletemplate.yaml @@ -19,6 +19,6 @@ spec: namespace: cdi sourceRef: kind: GitRepository - name: otterscale-repository + name: otterscale-module-operator namespace: otterscale-system path: config/modules/kubevirt/deploy diff --git a/config/modules/prometheus/helmrepository.yaml b/config/modules/prometheus/helmrepository.yaml index 22c65a9..08d01e2 100644 --- a/config/modules/prometheus/helmrepository.yaml +++ b/config/modules/prometheus/helmrepository.yaml @@ -1,7 +1,7 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: - name: prometheus-community + name: prometheus namespace: otterscale-system spec: interval: 24h diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 587be21..043cd71 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -35,7 +35,7 @@ spec: namespace: rook-ceph # Helm chart source: pulls kube-prometheus-stack from the - # prometheus-community HelmRepository (see helmrepository.yaml). + # prometheus HelmRepository (see helmrepository.yaml). chart: spec: chart: kube-prometheus-stack @@ -44,7 +44,7 @@ spec: version: ">=65.0.0" sourceRef: kind: HelmRepository - name: prometheus-community + name: prometheus namespace: otterscale-system # How often FluxCD polls the chart index for new versions. interval: 24h diff --git a/config/modules/rook-ceph/moduletemplate.yaml b/config/modules/rook-ceph/moduletemplate.yaml index 48f1833..3a8cd18 100644 --- a/config/modules/rook-ceph/moduletemplate.yaml +++ b/config/modules/rook-ceph/moduletemplate.yaml @@ -15,6 +15,6 @@ spec: prune: true sourceRef: kind: GitRepository - name: otterscale-repository + name: otterscale-module-operator namespace: otterscale-system path: config/modules/rook-ceph/deploy From 88db872d93e5642a67579539253b8746525be465 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:12:26 +0800 Subject: [PATCH 21/34] feat: update helm release intervals to 30m for various module templates and adjust GitRepository interval to 24h --- config/modules/gitrepository.yaml | 2 +- config/modules/gpu-operator/moduletemplate.yaml | 2 +- config/modules/hami/moduletemplate.yaml | 2 +- config/modules/istio/moduletemplate-base.yaml | 2 +- config/modules/istio/moduletemplate-gateway.yaml | 2 +- config/modules/istio/moduletemplate-istiod.yaml | 2 +- config/modules/llm-d-infra/moduletemplate.yaml | 2 +- config/modules/prometheus/moduletemplate.yaml | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/modules/gitrepository.yaml b/config/modules/gitrepository.yaml index f6e7de8..a861c48 100644 --- a/config/modules/gitrepository.yaml +++ b/config/modules/gitrepository.yaml @@ -6,7 +6,7 @@ metadata: name: otterscale-module-operator namespace: otterscale-system spec: - interval: 1h + interval: 24h url: https://github.com/otterscale/module-operator ref: tag: MODULE_OPERATOR_VERSION diff --git a/config/modules/gpu-operator/moduletemplate.yaml b/config/modules/gpu-operator/moduletemplate.yaml index d38085d..7df72b7 100644 --- a/config/modules/gpu-operator/moduletemplate.yaml +++ b/config/modules/gpu-operator/moduletemplate.yaml @@ -17,7 +17,7 @@ spec: Device plugin disabled for use with HAMI vGPU. helmRelease: - interval: 10m + interval: 30m chart: spec: diff --git a/config/modules/hami/moduletemplate.yaml b/config/modules/hami/moduletemplate.yaml index 21256eb..b83b943 100644 --- a/config/modules/hami/moduletemplate.yaml +++ b/config/modules/hami/moduletemplate.yaml @@ -18,7 +18,7 @@ spec: Integrates with NVIDIA GPU Operator via gpuOperatorToolkitReady. helmRelease: - interval: 10m + interval: 30m dependsOn: - name: gpu-operator diff --git a/config/modules/istio/moduletemplate-base.yaml b/config/modules/istio/moduletemplate-base.yaml index 2b1ff0a..8c2e72e 100644 --- a/config/modules/istio/moduletemplate-base.yaml +++ b/config/modules/istio/moduletemplate-base.yaml @@ -15,7 +15,7 @@ spec: Installs Istio base chart (CRDs). Required before istiod. helmRelease: - interval: 10m + interval: 30m chart: spec: diff --git a/config/modules/istio/moduletemplate-gateway.yaml b/config/modules/istio/moduletemplate-gateway.yaml index 97bf768..0092dfc 100644 --- a/config/modules/istio/moduletemplate-gateway.yaml +++ b/config/modules/istio/moduletemplate-gateway.yaml @@ -15,7 +15,7 @@ spec: Installs Istio ingress gateway for north-south traffic. helmRelease: - interval: 10m + interval: 30m dependsOn: - name: istiod diff --git a/config/modules/istio/moduletemplate-istiod.yaml b/config/modules/istio/moduletemplate-istiod.yaml index c2cb314..bed920a 100644 --- a/config/modules/istio/moduletemplate-istiod.yaml +++ b/config/modules/istio/moduletemplate-istiod.yaml @@ -15,7 +15,7 @@ spec: Installs Istiod (Istio control plane / discovery server). helmRelease: - interval: 10m + interval: 30m dependsOn: - name: istio-base diff --git a/config/modules/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml index cf1f588..ec5205a 100644 --- a/config/modules/llm-d-infra/moduletemplate.yaml +++ b/config/modules/llm-d-infra/moduletemplate.yaml @@ -24,7 +24,7 @@ spec: for high-performance distributed LLM inference framework. helmRelease: - interval: 10m + interval: 30m dependsOn: - name: gpu-operator diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 043cd71..34df207 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -28,7 +28,7 @@ spec: # in spec.namespace above. helmRelease: # Reconciliation interval — how often FluxCD re-checks drift. - interval: 10m + interval: 30m dependsOn: - name: rook-ceph @@ -41,7 +41,7 @@ spec: chart: kube-prometheus-stack # Pin to a specific chart version for reproducibility. # Remove or set to "*" to always track the latest. - version: ">=65.0.0" + version: "82.10.5" sourceRef: kind: HelmRepository name: prometheus From 025301f9fb7b4b7b6f3a597d98c46d1d7bd6c112 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:14:33 +0800 Subject: [PATCH 22/34] feat: add Kustomization and ModuleTemplate files for CDI, Gateway API, KubeVirt, and Rook-Ceph with updated resource paths --- config/modules/cdi/{deploy => }/kustomization.yaml | 0 config/modules/cdi/moduletemplate.yaml | 2 +- config/modules/gateway-api/{deploy => }/kustomization.yaml | 0 config/modules/gateway-api/moduletemplate.yaml | 2 +- config/modules/kubevirt/{deploy => }/kustomization.yaml | 0 config/modules/kubevirt/moduletemplate.yaml | 2 +- config/modules/rook-ceph/{deploy => }/kustomization.yaml | 0 config/modules/rook-ceph/moduletemplate.yaml | 2 +- 8 files changed, 4 insertions(+), 4 deletions(-) rename config/modules/cdi/{deploy => }/kustomization.yaml (100%) rename config/modules/gateway-api/{deploy => }/kustomization.yaml (100%) rename config/modules/kubevirt/{deploy => }/kustomization.yaml (100%) rename config/modules/rook-ceph/{deploy => }/kustomization.yaml (100%) diff --git a/config/modules/cdi/deploy/kustomization.yaml b/config/modules/cdi/kustomization.yaml similarity index 100% rename from config/modules/cdi/deploy/kustomization.yaml rename to config/modules/cdi/kustomization.yaml diff --git a/config/modules/cdi/moduletemplate.yaml b/config/modules/cdi/moduletemplate.yaml index 7ee655b..a681d0c 100644 --- a/config/modules/cdi/moduletemplate.yaml +++ b/config/modules/cdi/moduletemplate.yaml @@ -21,4 +21,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: otterscale-system - path: config/modules/cdi/deploy + path: config/modules/cdi diff --git a/config/modules/gateway-api/deploy/kustomization.yaml b/config/modules/gateway-api/kustomization.yaml similarity index 100% rename from config/modules/gateway-api/deploy/kustomization.yaml rename to config/modules/gateway-api/kustomization.yaml diff --git a/config/modules/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml index ef79926..5cc2e26 100644 --- a/config/modules/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: otterscale-system - path: config/modules/gateway-api/deploy + path: config/modules/gateway-api diff --git a/config/modules/kubevirt/deploy/kustomization.yaml b/config/modules/kubevirt/kustomization.yaml similarity index 100% rename from config/modules/kubevirt/deploy/kustomization.yaml rename to config/modules/kubevirt/kustomization.yaml diff --git a/config/modules/kubevirt/moduletemplate.yaml b/config/modules/kubevirt/moduletemplate.yaml index ae4fd91..d1479b2 100644 --- a/config/modules/kubevirt/moduletemplate.yaml +++ b/config/modules/kubevirt/moduletemplate.yaml @@ -21,4 +21,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: otterscale-system - path: config/modules/kubevirt/deploy + path: config/modules/kubevirt diff --git a/config/modules/rook-ceph/deploy/kustomization.yaml b/config/modules/rook-ceph/kustomization.yaml similarity index 100% rename from config/modules/rook-ceph/deploy/kustomization.yaml rename to config/modules/rook-ceph/kustomization.yaml diff --git a/config/modules/rook-ceph/moduletemplate.yaml b/config/modules/rook-ceph/moduletemplate.yaml index 3a8cd18..d0e6b79 100644 --- a/config/modules/rook-ceph/moduletemplate.yaml +++ b/config/modules/rook-ceph/moduletemplate.yaml @@ -17,4 +17,4 @@ spec: kind: GitRepository name: otterscale-module-operator namespace: otterscale-system - path: config/modules/rook-ceph/deploy + path: config/modules/rook-ceph From 9a653eb38efbe1bc07059a07a483eea290325433 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:16:42 +0800 Subject: [PATCH 23/34] feat: remove NodePort service type from Prometheus module template --- config/modules/prometheus/moduletemplate.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 34df207..910106d 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -92,8 +92,6 @@ spec: resources: requests: storage: "40Gi" - service: - type: NodePort # Deploy Node Exporter on every node for host-level metrics. nodeExporter: From 9c4e088ece669e000dcbbacde9a444f91e47c382 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:21:21 +0800 Subject: [PATCH 24/34] feat: remove gateway-api dependency from llm-d-infra and rook-ceph dependency from prometheus module templates --- config/modules/llm-d-infra/moduletemplate.yaml | 2 -- config/modules/prometheus/moduletemplate.yaml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/config/modules/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml index ec5205a..e4fd645 100644 --- a/config/modules/llm-d-infra/moduletemplate.yaml +++ b/config/modules/llm-d-infra/moduletemplate.yaml @@ -31,8 +31,6 @@ spec: namespace: gpu-operator - name: istio-gateway namespace: istio-ingress - - name: gateway-api - namespace: gateway-api-system chart: spec: diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 910106d..8aaff97 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -30,10 +30,6 @@ spec: # Reconciliation interval — how often FluxCD re-checks drift. interval: 30m - dependsOn: - - name: rook-ceph - namespace: rook-ceph - # Helm chart source: pulls kube-prometheus-stack from the # prometheus HelmRepository (see helmrepository.yaml). chart: From 384da96d34a6d13275f8f433e689f6b52a0d9abd Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:28:00 +0800 Subject: [PATCH 25/34] feat: add version placeholders and update module templates for CDI, Gateway API, GPU Operator, Hami, Istio, KubeVirt, LLM-D Infra, Prometheus, Rook-Ceph --- Makefile | 13 ++++++++++++- config/modules/cdi/VERSION | 1 + config/modules/cdi/kustomization.yaml | 4 ++-- config/modules/cdi/moduletemplate.yaml | 4 ++-- config/modules/gateway-api/VERSION | 1 + config/modules/gateway-api/kustomization.yaml | 4 ++-- config/modules/gateway-api/moduletemplate.yaml | 4 ++-- config/modules/gpu-operator/VERSION | 1 + config/modules/gpu-operator/moduletemplate.yaml | 2 +- config/modules/hami/VERSION | 1 + config/modules/hami/moduletemplate.yaml | 4 ++-- config/modules/istio/VERSION | 1 + config/modules/istio/moduletemplate-base.yaml | 2 +- config/modules/istio/moduletemplate-gateway.yaml | 2 +- config/modules/istio/moduletemplate-istiod.yaml | 2 +- config/modules/kubevirt/VERSION | 1 + config/modules/kubevirt/kustomization.yaml | 4 ++-- config/modules/kubevirt/moduletemplate.yaml | 4 ++-- config/modules/llm-d-infra/VERSION | 1 + config/modules/llm-d-infra/moduletemplate.yaml | 2 +- config/modules/prometheus/VERSION | 1 + config/modules/prometheus/moduletemplate.yaml | 2 +- config/modules/rook-ceph/VERSION | 1 + config/modules/rook-ceph/kustomization.yaml | 8 ++++---- config/modules/rook-ceph/moduletemplate.yaml | 4 ++-- 25 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 config/modules/cdi/VERSION create mode 100644 config/modules/gateway-api/VERSION create mode 100644 config/modules/gpu-operator/VERSION create mode 100644 config/modules/hami/VERSION create mode 100644 config/modules/istio/VERSION create mode 100644 config/modules/kubevirt/VERSION create mode 100644 config/modules/llm-d-infra/VERSION create mode 100644 config/modules/prometheus/VERSION create mode 100644 config/modules/rook-ceph/VERSION diff --git a/Makefile b/Makefile index b4c7c97..d14ea92 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,18 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRDs+deploy+HelmRepository+ModuleTemplate+GitRepository+addon ModuleTemplates). mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} - { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/modules; } | sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' > dist/install.yaml + { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/modules; } | \ + sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' | \ + sed "s|__CDI_VERSION__|$$(cat config/modules/cdi/VERSION | tr -d '\n')|g" | \ + sed "s|__KUBEVIRT_VERSION__|$$(cat config/modules/kubevirt/VERSION | tr -d '\n')|g" | \ + sed "s|__ROOK_CEPH_VERSION__|$$(cat config/modules/rook-ceph/VERSION | tr -d '\n')|g" | \ + sed "s|__GATEWAY_API_VERSION__|$$(cat config/modules/gateway-api/VERSION | tr -d '\n')|g" | \ + sed "s|__GPU_OPERATOR_VERSION__|$$(cat config/modules/gpu-operator/VERSION | tr -d '\n')|g" | \ + sed "s|__HAMI_VERSION__|$$(cat config/modules/hami/VERSION | tr -d '\n')|g" | \ + sed "s|__ISTIO_VERSION__|$$(cat config/modules/istio/VERSION | tr -d '\n')|g" | \ + sed "s|__PROMETHEUS_VERSION__|$$(cat config/modules/prometheus/VERSION | tr -d '\n')|g" | \ + sed "s|__LLM_D_INFRA_VERSION__|$$(cat config/modules/llm-d-infra/VERSION | tr -d '\n')|g" \ + > dist/install.yaml ##@ Deployment diff --git a/config/modules/cdi/VERSION b/config/modules/cdi/VERSION new file mode 100644 index 0000000..9405730 --- /dev/null +++ b/config/modules/cdi/VERSION @@ -0,0 +1 @@ +1.64.0 diff --git a/config/modules/cdi/kustomization.yaml b/config/modules/cdi/kustomization.yaml index 0c9c281..3f0a8ad 100644 --- a/config/modules/cdi/kustomization.yaml +++ b/config/modules/cdi/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://github.com/kubevirt/containerized-data-importer/releases/download/v1.64.0/cdi-operator.yaml - - https://github.com/kubevirt/containerized-data-importer/releases/download/v1.64.0/cdi-cr.yaml + - https://github.com/kubevirt/containerized-data-importer/releases/download/v__CDI_VERSION__/cdi-operator.yaml + - https://github.com/kubevirt/containerized-data-importer/releases/download/v__CDI_VERSION__/cdi-cr.yaml diff --git a/config/modules/cdi/moduletemplate.yaml b/config/modules/cdi/moduletemplate.yaml index a681d0c..9ce46d5 100644 --- a/config/modules/cdi/moduletemplate.yaml +++ b/config/modules/cdi/moduletemplate.yaml @@ -1,4 +1,4 @@ -# ModuleTemplate — CDI (Containerized Data Importer) v1.64.0 +# ModuleTemplate — CDI (Containerized Data Importer) v__CDI_VERSION__ # Uses FluxCD Kustomization (not Helm). Deploys from remote release YAMLs. # # Prerequisite: GitRepository (otterscale-module-operator) must exist in otterscale-system. @@ -11,7 +11,7 @@ spec: namespace: cdi description: >- - Containerized Data Importer v1.64.0 — PVC data import for KubeVirt VM disk images. + Containerized Data Importer v__CDI_VERSION__ — PVC data import for KubeVirt VM disk images. Deploys via FluxCD Kustomization from upstream release YAMLs. kustomization: diff --git a/config/modules/gateway-api/VERSION b/config/modules/gateway-api/VERSION new file mode 100644 index 0000000..bc80560 --- /dev/null +++ b/config/modules/gateway-api/VERSION @@ -0,0 +1 @@ +1.5.0 diff --git a/config/modules/gateway-api/kustomization.yaml b/config/modules/gateway-api/kustomization.yaml index c8d041d..b626c31 100644 --- a/config/modules/gateway-api/kustomization.yaml +++ b/config/modules/gateway-api/kustomization.yaml @@ -1,6 +1,6 @@ -# Gateway API v1.5.0 — Standard channel CRDs +# Gateway API v__GATEWAY_API_VERSION__ — Standard channel CRDs apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/standard-install.yaml + - https://github.com/kubernetes-sigs/gateway-api/releases/download/v__GATEWAY_API_VERSION__/standard-install.yaml diff --git a/config/modules/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml index 5cc2e26..f3020fb 100644 --- a/config/modules/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -1,4 +1,4 @@ -# ModuleTemplate — Kubernetes Gateway API v1.5.0 (Standard channel) +# ModuleTemplate — Kubernetes Gateway API v__GATEWAY_API_VERSION__ (Standard channel) # Uses FluxCD Kustomization. CRDs only (GatewayClass, Gateway, HTTPRoute, etc.) apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -8,7 +8,7 @@ spec: namespace: gateway-api-system description: >- - Kubernetes Gateway API v1.5.0 — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). + Kubernetes Gateway API v__GATEWAY_API_VERSION__ — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). kustomization: interval: 30m diff --git a/config/modules/gpu-operator/VERSION b/config/modules/gpu-operator/VERSION new file mode 100644 index 0000000..12f11ba --- /dev/null +++ b/config/modules/gpu-operator/VERSION @@ -0,0 +1 @@ +25.10.1 diff --git a/config/modules/gpu-operator/moduletemplate.yaml b/config/modules/gpu-operator/moduletemplate.yaml index 7df72b7..01eb8d3 100644 --- a/config/modules/gpu-operator/moduletemplate.yaml +++ b/config/modules/gpu-operator/moduletemplate.yaml @@ -22,7 +22,7 @@ spec: chart: spec: chart: gpu-operator - version: "25.10.1" + version: "__GPU_OPERATOR_VERSION__" sourceRef: kind: HelmRepository name: nvidia-gpu-operator diff --git a/config/modules/hami/VERSION b/config/modules/hami/VERSION new file mode 100644 index 0000000..834f262 --- /dev/null +++ b/config/modules/hami/VERSION @@ -0,0 +1 @@ +2.8.0 diff --git a/config/modules/hami/moduletemplate.yaml b/config/modules/hami/moduletemplate.yaml index b83b943..59e83b6 100644 --- a/config/modules/hami/moduletemplate.yaml +++ b/config/modules/hami/moduletemplate.yaml @@ -27,7 +27,7 @@ spec: chart: spec: chart: hami - version: "2.8.0" + version: "__HAMI_VERSION__" sourceRef: kind: HelmRepository name: hami @@ -47,7 +47,7 @@ spec: values: global: - imageTag: "v2.8.0" + imageTag: "v__HAMI_VERSION__" annotations: prometheus.io/scrape: "true" prometheus.io/port: "31992" diff --git a/config/modules/istio/VERSION b/config/modules/istio/VERSION new file mode 100644 index 0000000..83cf0d9 --- /dev/null +++ b/config/modules/istio/VERSION @@ -0,0 +1 @@ +1.29.1 diff --git a/config/modules/istio/moduletemplate-base.yaml b/config/modules/istio/moduletemplate-base.yaml index 8c2e72e..46725f6 100644 --- a/config/modules/istio/moduletemplate-base.yaml +++ b/config/modules/istio/moduletemplate-base.yaml @@ -20,7 +20,7 @@ spec: chart: spec: chart: base - version: "1.29.1" + version: "__ISTIO_VERSION__" sourceRef: kind: HelmRepository name: istio diff --git a/config/modules/istio/moduletemplate-gateway.yaml b/config/modules/istio/moduletemplate-gateway.yaml index 0092dfc..739a9d9 100644 --- a/config/modules/istio/moduletemplate-gateway.yaml +++ b/config/modules/istio/moduletemplate-gateway.yaml @@ -24,7 +24,7 @@ spec: chart: spec: chart: gateway - version: "1.29.1" + version: "__ISTIO_VERSION__" sourceRef: kind: HelmRepository name: istio diff --git a/config/modules/istio/moduletemplate-istiod.yaml b/config/modules/istio/moduletemplate-istiod.yaml index bed920a..3d6f1a6 100644 --- a/config/modules/istio/moduletemplate-istiod.yaml +++ b/config/modules/istio/moduletemplate-istiod.yaml @@ -24,7 +24,7 @@ spec: chart: spec: chart: istiod - version: "1.29.1" + version: "__ISTIO_VERSION__" sourceRef: kind: HelmRepository name: istio diff --git a/config/modules/kubevirt/VERSION b/config/modules/kubevirt/VERSION new file mode 100644 index 0000000..8039840 --- /dev/null +++ b/config/modules/kubevirt/VERSION @@ -0,0 +1 @@ +1.8.0-rc.0 diff --git a/config/modules/kubevirt/kustomization.yaml b/config/modules/kubevirt/kustomization.yaml index 82cf395..12dd594 100644 --- a/config/modules/kubevirt/kustomization.yaml +++ b/config/modules/kubevirt/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://github.com/kubevirt/kubevirt/releases/download/v1.8.0-rc.0/kubevirt-operator.yaml - - https://github.com/kubevirt/kubevirt/releases/download/v1.8.0-rc.0/kubevirt-cr.yaml + - https://github.com/kubevirt/kubevirt/releases/download/v__KUBEVIRT_VERSION__/kubevirt-operator.yaml + - https://github.com/kubevirt/kubevirt/releases/download/v__KUBEVIRT_VERSION__/kubevirt-cr.yaml diff --git a/config/modules/kubevirt/moduletemplate.yaml b/config/modules/kubevirt/moduletemplate.yaml index d1479b2..57b8bb3 100644 --- a/config/modules/kubevirt/moduletemplate.yaml +++ b/config/modules/kubevirt/moduletemplate.yaml @@ -1,4 +1,4 @@ -# ModuleTemplate — KubeVirt v1.8.0-rc.0 +# ModuleTemplate — KubeVirt v__KUBEVIRT_VERSION__ # Uses FluxCD Kustomization. Deploy CDI first. apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -8,7 +8,7 @@ spec: namespace: kubevirt description: >- - KubeVirt v1.8.0-rc.0 — enables Kubernetes to manage VMs natively. + KubeVirt v__KUBEVIRT_VERSION__ — enables Kubernetes to manage VMs natively. Requires CDI for VM disk image import. kustomization: diff --git a/config/modules/llm-d-infra/VERSION b/config/modules/llm-d-infra/VERSION new file mode 100644 index 0000000..0c00f61 --- /dev/null +++ b/config/modules/llm-d-infra/VERSION @@ -0,0 +1 @@ +1.3.10 diff --git a/config/modules/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml index e4fd645..fbcb6ab 100644 --- a/config/modules/llm-d-infra/moduletemplate.yaml +++ b/config/modules/llm-d-infra/moduletemplate.yaml @@ -35,7 +35,7 @@ spec: chart: spec: chart: llm-d-infra - version: "1.3.10" + version: "__LLM_D_INFRA_VERSION__" sourceRef: kind: HelmRepository name: llm-d-infra diff --git a/config/modules/prometheus/VERSION b/config/modules/prometheus/VERSION new file mode 100644 index 0000000..16913a8 --- /dev/null +++ b/config/modules/prometheus/VERSION @@ -0,0 +1 @@ +82.10.5 diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 8aaff97..40062c4 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -37,7 +37,7 @@ spec: chart: kube-prometheus-stack # Pin to a specific chart version for reproducibility. # Remove or set to "*" to always track the latest. - version: "82.10.5" + version: "__PROMETHEUS_VERSION__" sourceRef: kind: HelmRepository name: prometheus diff --git a/config/modules/rook-ceph/VERSION b/config/modules/rook-ceph/VERSION new file mode 100644 index 0000000..836ae4e --- /dev/null +++ b/config/modules/rook-ceph/VERSION @@ -0,0 +1 @@ +1.19.2 diff --git a/config/modules/rook-ceph/kustomization.yaml b/config/modules/rook-ceph/kustomization.yaml index 454c5e3..1f459e6 100644 --- a/config/modules/rook-ceph/kustomization.yaml +++ b/config/modules/rook-ceph/kustomization.yaml @@ -1,8 +1,8 @@ -# Rook-Ceph Operator v1.19.2 — Phase 1: CRDs + Operator (no CephCluster) +# Rook-Ceph Operator v__ROOK_CEPH_VERSION__ — Phase 1: CRDs + Operator (no CephCluster) apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/crds.yaml - - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/common.yaml - - https://raw.githubusercontent.com/rook/rook/v1.19.2/deploy/examples/operator.yaml + - https://raw.githubusercontent.com/rook/rook/v__ROOK_CEPH_VERSION__/deploy/examples/crds.yaml + - https://raw.githubusercontent.com/rook/rook/v__ROOK_CEPH_VERSION__/deploy/examples/common.yaml + - https://raw.githubusercontent.com/rook/rook/v__ROOK_CEPH_VERSION__/deploy/examples/operator.yaml diff --git a/config/modules/rook-ceph/moduletemplate.yaml b/config/modules/rook-ceph/moduletemplate.yaml index d0e6b79..3e193a9 100644 --- a/config/modules/rook-ceph/moduletemplate.yaml +++ b/config/modules/rook-ceph/moduletemplate.yaml @@ -1,4 +1,4 @@ -# ModuleTemplate — Rook-Ceph Operator v1.19.2 (Phase 1: Operator only) +# ModuleTemplate — Rook-Ceph Operator v__ROOK_CEPH_VERSION__ (Phase 1: Operator only) # Uses FluxCD Kustomization. Phase 2: Apply rook-ceph-cluster Module for CephCluster. apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate @@ -8,7 +8,7 @@ spec: namespace: rook-ceph description: >- - Rook-Ceph Operator v1.19.2 — CRDs, Operator Deployment. Create CephCluster separately via rook-ceph-cluster Module. + Rook-Ceph Operator v__ROOK_CEPH_VERSION__ — CRDs, Operator Deployment. Create CephCluster separately via rook-ceph-cluster Module. kustomization: interval: 30m From 65c8ece9903494a507c5ce10fb7c714bf8a4df61 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:31:55 +0800 Subject: [PATCH 26/34] feat: add Gateway API Inference Extension module with versioning and kustomization support --- Makefile | 3 ++- .../gateway-api-inference-extension/VERSION | 1 + .../kustomization.yaml | 6 +++++ .../moduletemplate.yaml | 24 +++++++++++++++++++ config/modules/kustomization.yaml | 1 + ...odule-gateway-api-inference-extension.yaml | 7 ++++++ 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 config/modules/gateway-api-inference-extension/VERSION create mode 100644 config/modules/gateway-api-inference-extension/kustomization.yaml create mode 100644 config/modules/gateway-api-inference-extension/moduletemplate.yaml create mode 100644 config/samples/module-gateway-api-inference-extension.yaml diff --git a/Makefile b/Makefile index d14ea92..7fa0dcf 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,8 @@ build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRD sed "s|__HAMI_VERSION__|$$(cat config/modules/hami/VERSION | tr -d '\n')|g" | \ sed "s|__ISTIO_VERSION__|$$(cat config/modules/istio/VERSION | tr -d '\n')|g" | \ sed "s|__PROMETHEUS_VERSION__|$$(cat config/modules/prometheus/VERSION | tr -d '\n')|g" | \ - sed "s|__LLM_D_INFRA_VERSION__|$$(cat config/modules/llm-d-infra/VERSION | tr -d '\n')|g" \ + sed "s|__LLM_D_INFRA_VERSION__|$$(cat config/modules/llm-d-infra/VERSION | tr -d '\n')|g" | \ + sed "s|__GAIE_VERSION__|$$(cat config/modules/gateway-api-inference-extension/VERSION | tr -d '\n')|g" \ > dist/install.yaml ##@ Deployment diff --git a/config/modules/gateway-api-inference-extension/VERSION b/config/modules/gateway-api-inference-extension/VERSION new file mode 100644 index 0000000..3a3cd8c --- /dev/null +++ b/config/modules/gateway-api-inference-extension/VERSION @@ -0,0 +1 @@ +1.3.1 diff --git a/config/modules/gateway-api-inference-extension/kustomization.yaml b/config/modules/gateway-api-inference-extension/kustomization.yaml new file mode 100644 index 0000000..4427dea --- /dev/null +++ b/config/modules/gateway-api-inference-extension/kustomization.yaml @@ -0,0 +1,6 @@ +# Gateway API Inference Extension v__GAIE_VERSION__ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/download/v__GAIE_VERSION__/manifests.yaml diff --git a/config/modules/gateway-api-inference-extension/moduletemplate.yaml b/config/modules/gateway-api-inference-extension/moduletemplate.yaml new file mode 100644 index 0000000..1c37c81 --- /dev/null +++ b/config/modules/gateway-api-inference-extension/moduletemplate.yaml @@ -0,0 +1,24 @@ +# ModuleTemplate — Gateway API Inference Extension v__GAIE_VERSION__ +# Uses FluxCD Kustomization. Requires Gateway API CRDs. +apiVersion: module.otterscale.io/v1alpha1 +kind: ModuleTemplate +metadata: + name: gateway-api-inference-extension +spec: + namespace: gateway-api-inference-extension + + description: >- + Gateway API Inference Extension v__GAIE_VERSION__ — CRDs and controllers + for AI/ML inference routing via Gateway API. + + kustomization: + interval: 30m + prune: true + dependsOn: + - name: gateway-api + namespace: gateway-api-system + sourceRef: + kind: GitRepository + name: otterscale-module-operator + namespace: otterscale-system + path: config/modules/gateway-api-inference-extension diff --git a/config/modules/kustomization.yaml b/config/modules/kustomization.yaml index 33c1fb2..26d26d6 100644 --- a/config/modules/kustomization.yaml +++ b/config/modules/kustomization.yaml @@ -24,6 +24,7 @@ resources: # --- GitRepository ModuleTemplates --- - gateway-api/moduletemplate.yaml + - gateway-api-inference-extension/moduletemplate.yaml - cdi/moduletemplate.yaml - kubevirt/moduletemplate.yaml - rook-ceph/moduletemplate.yaml diff --git a/config/samples/module-gateway-api-inference-extension.yaml b/config/samples/module-gateway-api-inference-extension.yaml new file mode 100644 index 0000000..cd497fd --- /dev/null +++ b/config/samples/module-gateway-api-inference-extension.yaml @@ -0,0 +1,7 @@ +apiVersion: module.otterscale.io/v1alpha1 +kind: Module +metadata: + name: gateway-api-inference-extension +spec: + templateRef: + name: gateway-api-inference-extension From 7b303d365e58c83ebd5914dd1cbd45dcee821eb3 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:32:33 +0800 Subject: [PATCH 27/34] feat: update GitRepository version placeholder to use double underscores for consistency --- AGENTS.md | 2 +- Makefile | 2 +- config/modules/gitrepository.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d9916ff..efc06e3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -279,7 +279,7 @@ make build-installer IMG=/:tag **GitRepository version substitution:** -- `config/modules/gitrepository.yaml` uses the placeholder `MODULE_OPERATOR_VERSION` for the Git ref tag +- `config/modules/gitrepository.yaml` uses the placeholder `__MODULE_OPERATOR_VERSION__` for the Git ref tag - The `build-installer` target replaces it with the current version (`git describe --tags --always`) via `sed` before writing `dist/install.yaml` - Modules (CDI, KubeVirt, etc.) are thus sourced from the same version as the operator being built, enabling feature-branch testing without hardcoded tags diff --git a/Makefile b/Makefile index 7fa0dcf..cea544e 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,7 @@ build-installer: manifests generate kustomize ## Generate dist/install.yaml (CRD mkdir -p dist cd config/manager && "$(KUSTOMIZE)" edit set image controller=${IMG} { "$(KUSTOMIZE)" build config/default; echo "---"; "$(KUSTOMIZE)" build config/modules; } | \ - sed 's|MODULE_OPERATOR_VERSION|$(VERSION)|g' | \ + sed 's|__MODULE_OPERATOR_VERSION__|$(VERSION)|g' | \ sed "s|__CDI_VERSION__|$$(cat config/modules/cdi/VERSION | tr -d '\n')|g" | \ sed "s|__KUBEVIRT_VERSION__|$$(cat config/modules/kubevirt/VERSION | tr -d '\n')|g" | \ sed "s|__ROOK_CEPH_VERSION__|$$(cat config/modules/rook-ceph/VERSION | tr -d '\n')|g" | \ diff --git a/config/modules/gitrepository.yaml b/config/modules/gitrepository.yaml index a861c48..ac535a8 100644 --- a/config/modules/gitrepository.yaml +++ b/config/modules/gitrepository.yaml @@ -9,4 +9,4 @@ spec: interval: 24h url: https://github.com/otterscale/module-operator ref: - tag: MODULE_OPERATOR_VERSION + tag: __MODULE_OPERATOR_VERSION__ From c38d27ecc2165aca0d0002482fd8b1c9e5b037b8 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:34:26 +0800 Subject: [PATCH 28/34] feat: update version numbers for CDI, Gateway API, and KubeVirt modules --- config/modules/cdi/VERSION | 2 +- config/modules/gateway-api/VERSION | 2 +- config/modules/kubevirt/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/modules/cdi/VERSION b/config/modules/cdi/VERSION index 9405730..902c741 100644 --- a/config/modules/cdi/VERSION +++ b/config/modules/cdi/VERSION @@ -1 +1 @@ -1.64.0 +1.65.0 diff --git a/config/modules/gateway-api/VERSION b/config/modules/gateway-api/VERSION index bc80560..26ca594 100644 --- a/config/modules/gateway-api/VERSION +++ b/config/modules/gateway-api/VERSION @@ -1 +1 @@ -1.5.0 +1.5.1 diff --git a/config/modules/kubevirt/VERSION b/config/modules/kubevirt/VERSION index 8039840..27f9cd3 100644 --- a/config/modules/kubevirt/VERSION +++ b/config/modules/kubevirt/VERSION @@ -1 +1 @@ -1.8.0-rc.0 +1.8.0 From 13c34e9a48b633753a497f3c1ed2edb7ee383f58 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 14:36:24 +0800 Subject: [PATCH 29/34] feat: reorganize kustomization.yaml for clarity and consistency in resource categorization --- config/modules/kustomization.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/config/modules/kustomization.yaml b/config/modules/kustomization.yaml index 26d26d6..0bd8c7a 100644 --- a/config/modules/kustomization.yaml +++ b/config/modules/kustomization.yaml @@ -5,26 +5,30 @@ kind: Kustomization # Used by build-installer to generate dist/install.yaml. # Module CRs are in config/samples/ for users to apply selectively. resources: - # --- GitRepository source --- + # --- Sources --- - gitrepository.yaml - # --- HelmRepository sources + ModuleTemplates --- + # --- Helm-based ModuleTemplates --- - gpu-operator/helmrepository.yaml - gpu-operator/moduletemplate.yaml + - hami/helmrepository.yaml - hami/moduletemplate.yaml - - prometheus/helmrepository.yaml - - prometheus/moduletemplate.yaml + - istio/helmrepository.yaml - istio/moduletemplate-base.yaml - istio/moduletemplate-istiod.yaml - istio/moduletemplate-gateway.yaml + - llm-d-infra/helmrepository.yaml - llm-d-infra/moduletemplate.yaml - # --- GitRepository ModuleTemplates --- + - prometheus/helmrepository.yaml + - prometheus/moduletemplate.yaml + + # --- Kustomize-based ModuleTemplates --- + - cdi/moduletemplate.yaml - gateway-api/moduletemplate.yaml - gateway-api-inference-extension/moduletemplate.yaml - - cdi/moduletemplate.yaml - kubevirt/moduletemplate.yaml - rook-ceph/moduletemplate.yaml From 1c702b0b52b44dc2d139b2b3e22fb3a92f91c717 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 15:35:38 +0800 Subject: [PATCH 30/34] feat: update namespaces in module templates for consistency --- .../gateway-api-inference-extension/moduletemplate.yaml | 4 ++-- config/modules/gateway-api/moduletemplate.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/modules/gateway-api-inference-extension/moduletemplate.yaml b/config/modules/gateway-api-inference-extension/moduletemplate.yaml index 1c37c81..326118a 100644 --- a/config/modules/gateway-api-inference-extension/moduletemplate.yaml +++ b/config/modules/gateway-api-inference-extension/moduletemplate.yaml @@ -5,7 +5,7 @@ kind: ModuleTemplate metadata: name: gateway-api-inference-extension spec: - namespace: gateway-api-inference-extension + namespace: default description: >- Gateway API Inference Extension v__GAIE_VERSION__ — CRDs and controllers @@ -16,7 +16,7 @@ spec: prune: true dependsOn: - name: gateway-api - namespace: gateway-api-system + namespace: default sourceRef: kind: GitRepository name: otterscale-module-operator diff --git a/config/modules/gateway-api/moduletemplate.yaml b/config/modules/gateway-api/moduletemplate.yaml index f3020fb..4eecac1 100644 --- a/config/modules/gateway-api/moduletemplate.yaml +++ b/config/modules/gateway-api/moduletemplate.yaml @@ -5,7 +5,7 @@ kind: ModuleTemplate metadata: name: gateway-api spec: - namespace: gateway-api-system + namespace: default description: >- Kubernetes Gateway API v__GATEWAY_API_VERSION__ — Standard channel CRDs (GatewayClass, Gateway, HTTPRoute, GRPCRoute, ReferenceGrant). From 44935854fce92dc0ab090745f42a059e6d67ec51 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 15:35:42 +0800 Subject: [PATCH 31/34] feat: update namespace in prometheus module template for consistency --- config/modules/prometheus/moduletemplate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/modules/prometheus/moduletemplate.yaml b/config/modules/prometheus/moduletemplate.yaml index 40062c4..d001b27 100644 --- a/config/modules/prometheus/moduletemplate.yaml +++ b/config/modules/prometheus/moduletemplate.yaml @@ -16,7 +16,7 @@ spec: # Target namespace where the FluxCD HelmRelease object (and by default the # Helm release itself) will be created. Can be overridden per-Module via # Module.spec.namespace. - namespace: prometheus-stack + namespace: monitoring description: >- Deploys kube-prometheus-stack (Prometheus, Alertmanager, Node Exporter) From c6a36c2cc7de07e597e82b75ee09d4877e20dde7 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 15:36:02 +0800 Subject: [PATCH 32/34] feat: update namespace in llm-d-infra module template for consistency --- config/modules/llm-d-infra/moduletemplate.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/modules/llm-d-infra/moduletemplate.yaml b/config/modules/llm-d-infra/moduletemplate.yaml index fbcb6ab..81b6f34 100644 --- a/config/modules/llm-d-infra/moduletemplate.yaml +++ b/config/modules/llm-d-infra/moduletemplate.yaml @@ -17,7 +17,7 @@ kind: ModuleTemplate metadata: name: llm-d-infra spec: - namespace: llm-d-infra + namespace: llm-d description: >- Deploys llm-d infrastructure (Gateway API, service mesh integration) @@ -29,8 +29,8 @@ spec: dependsOn: - name: gpu-operator namespace: gpu-operator - - name: istio-gateway - namespace: istio-ingress + - name: istiod + namespace: istio-system chart: spec: From 5246f683823459cff3863dbe03d658ef173519f0 Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 15:36:13 +0800 Subject: [PATCH 33/34] feat: remove istio-gateway module template and update apply order in istio templates for consistency --- config/modules/istio/moduletemplate-base.yaml | 2 +- .../modules/istio/moduletemplate-gateway.yaml | 45 ------------------- .../modules/istio/moduletemplate-istiod.yaml | 2 +- config/modules/kustomization.yaml | 1 - 4 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 config/modules/istio/moduletemplate-gateway.yaml diff --git a/config/modules/istio/moduletemplate-base.yaml b/config/modules/istio/moduletemplate-base.yaml index 46725f6..0aa1555 100644 --- a/config/modules/istio/moduletemplate-base.yaml +++ b/config/modules/istio/moduletemplate-base.yaml @@ -3,7 +3,7 @@ # Installs Istio base chart (CRDs). Must be applied before istiod. # See: https://istio.io/latest/docs/setup/install/helm/ # -# Apply order: base → istiod → gateway +# Apply order: base → istiod apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate metadata: diff --git a/config/modules/istio/moduletemplate-gateway.yaml b/config/modules/istio/moduletemplate-gateway.yaml deleted file mode 100644 index 739a9d9..0000000 --- a/config/modules/istio/moduletemplate-gateway.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# ModuleTemplate — Istio Ingress Gateway -# -# Installs Istio ingress gateway. Optional; deploy after istiod. -# See: https://istio.io/latest/docs/setup/additional-setup/gateway/ -# -# Apply order: base → istiod → gateway -apiVersion: module.otterscale.io/v1alpha1 -kind: ModuleTemplate -metadata: - name: istio-gateway -spec: - namespace: istio-ingress - - description: >- - Installs Istio ingress gateway for north-south traffic. - - helmRelease: - interval: 30m - - dependsOn: - - name: istiod - namespace: istio-system - - chart: - spec: - chart: gateway - version: "__ISTIO_VERSION__" - sourceRef: - kind: HelmRepository - name: istio - namespace: otterscale-system - interval: 24h - - install: - remediation: - retries: 3 - - upgrade: - remediation: - retries: 3 - force: false - - timeout: 10m - - values: {} diff --git a/config/modules/istio/moduletemplate-istiod.yaml b/config/modules/istio/moduletemplate-istiod.yaml index 3d6f1a6..e2b3e9c 100644 --- a/config/modules/istio/moduletemplate-istiod.yaml +++ b/config/modules/istio/moduletemplate-istiod.yaml @@ -3,7 +3,7 @@ # Installs Istiod control plane. Requires istio-base to be installed first. # See: https://istio.io/latest/docs/setup/install/helm/ # -# Apply order: base → istiod → gateway +# Apply order: base → istiod apiVersion: module.otterscale.io/v1alpha1 kind: ModuleTemplate metadata: diff --git a/config/modules/kustomization.yaml b/config/modules/kustomization.yaml index 0bd8c7a..10ee2de 100644 --- a/config/modules/kustomization.yaml +++ b/config/modules/kustomization.yaml @@ -18,7 +18,6 @@ resources: - istio/helmrepository.yaml - istio/moduletemplate-base.yaml - istio/moduletemplate-istiod.yaml - - istio/moduletemplate-gateway.yaml - llm-d-infra/helmrepository.yaml - llm-d-infra/moduletemplate.yaml From 95533652aaca6b81ba891c8c5aa12f2ebc63f90e Mon Sep 17 00:00:00 2001 From: Paul Tsai Date: Wed, 18 Mar 2026 15:39:48 +0800 Subject: [PATCH 34/34] feat: change CreateOrUpdate to CreateOrPatch in helmrelease and kustomization reconciliation --- internal/module/helmrelease.go | 2 +- internal/module/kustomization.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/module/helmrelease.go b/internal/module/helmrelease.go index 2accae6..7afab7a 100644 --- a/internal/module/helmrelease.go +++ b/internal/module/helmrelease.go @@ -74,7 +74,7 @@ func ReconcileHelmRelease( }, } - op, err := ctrlutil.CreateOrUpdate(ctx, c, hr, func() error { + op, err := ctrlutil.CreateOrPatch(ctx, c, hr, func() error { if m.Spec.Values != nil { templateSpec.Values = &apiextensionsv1.JSON{Raw: m.Spec.Values.Raw} } diff --git a/internal/module/kustomization.go b/internal/module/kustomization.go index 50e85f8..8557209 100644 --- a/internal/module/kustomization.go +++ b/internal/module/kustomization.go @@ -73,7 +73,7 @@ func ReconcileKustomization( }, } - op, err := ctrlutil.CreateOrUpdate(ctx, c, ks, func() error { + op, err := ctrlutil.CreateOrPatch(ctx, c, ks, func() error { ks.Spec = templateSpec // Ensure labels are set for identification and filtering