From e514df2f3e1ece5f37851fc8d24ad2fade82260a Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 18 Sep 2024 18:29:57 -0400 Subject: [PATCH] feat: add kubevirt to thin cluster --- .../apps/kubevirt-cdi/cr/kustomization.yaml | 7 +++ kubernetes/thin/apps/kubevirt-cdi/ks.yaml | 62 +++++++++++++++++++ .../kubevirt-cdi/namespace-transformer.yaml | 11 ++++ .../kubevirt-cdi/operator/kustomization.yaml | 7 +++ kubernetes/thin/apps/kubevirt/ks.yaml | 30 +++++++++ .../kubevirt/operator/app/kustomization.yaml | 4 ++ .../kubevirt/operator/cr/kustomization.yaml | 4 ++ .../thin/apps/kubevirt/operator/ks.yaml | 60 ++++++++++++++++++ kubernetes/thin/apps/kustomization.yaml | 3 + 9 files changed, 188 insertions(+) create mode 100644 kubernetes/thin/apps/kubevirt-cdi/cr/kustomization.yaml create mode 100644 kubernetes/thin/apps/kubevirt-cdi/ks.yaml create mode 100644 kubernetes/thin/apps/kubevirt-cdi/namespace-transformer.yaml create mode 100644 kubernetes/thin/apps/kubevirt-cdi/operator/kustomization.yaml create mode 100644 kubernetes/thin/apps/kubevirt/ks.yaml create mode 100644 kubernetes/thin/apps/kubevirt/operator/app/kustomization.yaml create mode 100644 kubernetes/thin/apps/kubevirt/operator/cr/kustomization.yaml create mode 100644 kubernetes/thin/apps/kubevirt/operator/ks.yaml diff --git a/kubernetes/thin/apps/kubevirt-cdi/cr/kustomization.yaml b/kubernetes/thin/apps/kubevirt-cdi/cr/kustomization.yaml new file mode 100644 index 0000000..da2fdfc --- /dev/null +++ b/kubernetes/thin/apps/kubevirt-cdi/cr/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.60.3/cdi-cr.yaml +# change namespace to kubevirt-cdi +transformers: +- ../namespace-transformer.yaml \ No newline at end of file diff --git a/kubernetes/thin/apps/kubevirt-cdi/ks.yaml b/kubernetes/thin/apps/kubevirt-cdi/ks.yaml new file mode 100644 index 0000000..3ef5620 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt-cdi/ks.yaml @@ -0,0 +1,62 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: kubevirt-cdi-operator + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/kubevirt-cdi/operator + prune: true + targetNamespace: kubevirt-cdi + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: kubevirt-operator + namespace: flux-system + - name: kubevirt-operator-cr + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: kubevirt-cdi-cr + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/kubevirt-cdi/cr + prune: true + targetNamespace: kubevirt-cdi + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: kubevirt-cdi-operator + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets \ No newline at end of file diff --git a/kubernetes/thin/apps/kubevirt-cdi/namespace-transformer.yaml b/kubernetes/thin/apps/kubevirt-cdi/namespace-transformer.yaml new file mode 100644 index 0000000..9522f11 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt-cdi/namespace-transformer.yaml @@ -0,0 +1,11 @@ +apiVersion: builtin +kind: NamespaceTransformer +metadata: + name: change-cdi-namespace + namespace: kubevirt-cdi +setRoleBindingSubjects: none +unsetOnly: false +fieldSpecs: +- path: metadata/name + kind: Namespace + create: true \ No newline at end of file diff --git a/kubernetes/thin/apps/kubevirt-cdi/operator/kustomization.yaml b/kubernetes/thin/apps/kubevirt-cdi/operator/kustomization.yaml new file mode 100644 index 0000000..1beca53 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt-cdi/operator/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.60.3/cdi-operator.yaml +# change namespace to kubevirt-cdi +transformers: +- ../namespace-transformer.yaml \ No newline at end of file diff --git a/kubernetes/thin/apps/kubevirt/ks.yaml b/kubernetes/thin/apps/kubevirt/ks.yaml new file mode 100644 index 0000000..a4b0510 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt/ks.yaml @@ -0,0 +1,30 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: kubevirt-operator + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/kubevirt/operator + prune: true + targetNamespace: kubevirt + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets diff --git a/kubernetes/thin/apps/kubevirt/operator/app/kustomization.yaml b/kubernetes/thin/apps/kubevirt/operator/app/kustomization.yaml new file mode 100644 index 0000000..e89fad7 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt/operator/app/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/kubevirt/kubevirt/releases/download/v1.3.1/kubevirt-operator.yaml diff --git a/kubernetes/thin/apps/kubevirt/operator/cr/kustomization.yaml b/kubernetes/thin/apps/kubevirt/operator/cr/kustomization.yaml new file mode 100644 index 0000000..460bd3e --- /dev/null +++ b/kubernetes/thin/apps/kubevirt/operator/cr/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/kubevirt/kubevirt/releases/download/v1.3.1/kubevirt-cr.yaml diff --git a/kubernetes/thin/apps/kubevirt/operator/ks.yaml b/kubernetes/thin/apps/kubevirt/operator/ks.yaml new file mode 100644 index 0000000..963f952 --- /dev/null +++ b/kubernetes/thin/apps/kubevirt/operator/ks.yaml @@ -0,0 +1,60 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: kubevirt-operator + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/kubevirt/operator/app + prune: true + targetNamespace: kubevirt + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: kubevirt-operator-cr + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/kubevirt/operator/cr + prune: true + targetNamespace: kubevirt + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: kubevirt-operator + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets \ No newline at end of file diff --git a/kubernetes/thin/apps/kustomization.yaml b/kubernetes/thin/apps/kustomization.yaml index b4a0f7a..339bda0 100644 --- a/kubernetes/thin/apps/kustomization.yaml +++ b/kubernetes/thin/apps/kustomization.yaml @@ -12,6 +12,9 @@ resources: # hardware - ../../common/apps/nfd/ks.yaml - ../../common/apps/intel-gpu/ks.yaml +# VMs +- ./kubevirt/ks.yaml +- ./kubevirt-cdi/ks.yaml - ../../common/apps/database - ./default \ No newline at end of file