automating kubevirt upgrade and managing through flux #398
13 changed files with 233 additions and 0 deletions
9
kubernetes/apps/cdi/cdi/app/kustomization.yaml
Normal file
9
kubernetes/apps/cdi/cdi/app/kustomization.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
# Flux-Kustomizations
|
||||||
|
- ./ingress.yaml
|
||||||
|
- ./nixosdv.yaml
|
||||||
|
- ./storageprofile.yaml
|
17
kubernetes/apps/cdi/cdi/app/nixosdv.yaml
Normal file
17
kubernetes/apps/cdi/cdi/app/nixosdv.yaml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://ks.hsn.dev/cdi.kubevirt.io/datavolume_v1beta1.json
|
||||||
|
apiVersion: cdi.kubevirt.io/v1beta1
|
||||||
|
kind: DataVolume
|
||||||
|
metadata:
|
||||||
|
name: "nixos-minimal"
|
||||||
|
spec:
|
||||||
|
storage:
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: "openebs-zfs"
|
||||||
|
accessModes:
|
||||||
|
- "ReadWriteOnce"
|
||||||
|
source:
|
||||||
|
http:
|
||||||
|
url: "https://channels.nixos.org/nixos-24.05/latest-nixos-minimal-x86_64-linux.iso"
|
26
kubernetes/apps/cdi/cdi/app/storageprofile.yaml
Normal file
26
kubernetes/apps/cdi/cdi/app/storageprofile.yaml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://ks.hsn.dev/cdi.kubevirt.io/storageprofile_v1beta1.json
|
||||||
|
apiVersion: cdi.kubevirt.io/v1beta1
|
||||||
|
kind: StorageProfile
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: containerized-data-importer
|
||||||
|
app.kubernetes.io/component: storage
|
||||||
|
app.kubernetes.io/managed-by: cdi-controller
|
||||||
|
cdi.kubevirt.io: ""
|
||||||
|
name: openebs-zfs
|
||||||
|
spec:
|
||||||
|
claimPropertySets:
|
||||||
|
- accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeMode: Block
|
||||||
|
status:
|
||||||
|
claimPropertySets:
|
||||||
|
- accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeMode: Block
|
||||||
|
cloneStrategy: snapshot
|
||||||
|
dataImportCronSourceFormat: pvc
|
||||||
|
provisioner: zfs.csi.openebs.io
|
||||||
|
snapshotClass: openebs-zfs
|
||||||
|
storageClass: openebs-zfs
|
73
kubernetes/apps/cdi/cdi/ks.yaml
Normal file
73
kubernetes/apps/cdi/cdi/ks.yaml
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app kubevirt-cdi
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: cdi
|
||||||
|
dependsOn:
|
||||||
|
- name: kubevirt
|
||||||
|
- name: openebs-cluster
|
||||||
|
path: ./deploy
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: kubevirt-cdi
|
||||||
|
wait: true
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
||||||
|
patches:
|
||||||
|
- patch: |
|
||||||
|
$patch: delete
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: cdi
|
||||||
|
target:
|
||||||
|
kind: Namespace
|
||||||
|
name: cdi
|
||||||
|
- patch: |
|
||||||
|
apiVersion: cdi.kubevirt.io/v1beta1
|
||||||
|
kind: CDI
|
||||||
|
metadata:
|
||||||
|
name: not-used
|
||||||
|
spec:
|
||||||
|
cloneStrategyOverride: snapshot
|
||||||
|
config:
|
||||||
|
featureGates:
|
||||||
|
- HonorWaitForFirstConsumer
|
||||||
|
customizeComponents: {}
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
infra:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
tolerations:
|
||||||
|
- key: CriticalAddonsOnly
|
||||||
|
operator: Exists
|
||||||
|
workload:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
target:
|
||||||
|
group: cdi.kubevirt.io
|
||||||
|
kind: CDI
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app kubevirt-cdi-addl
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: cdi
|
||||||
|
dependsOn:
|
||||||
|
- name: kubevirt-cdi
|
||||||
|
interval: 10m
|
||||||
|
path: "./kubernetes/apps/cdi/cdi/app/"
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: homelab
|
||||||
|
wait: false
|
9
kubernetes/apps/cdi/kustomization.yaml
Normal file
9
kubernetes/apps/cdi/kustomization.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
# Pre Flux-Kustomizations
|
||||||
|
- ./namespace.yaml
|
||||||
|
# Flux-Kustomizations
|
||||||
|
- ./app/ks.yaml
|
9
kubernetes/apps/cdi/namespace.yaml
Normal file
9
kubernetes/apps/cdi/namespace.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: cdi
|
||||||
|
labels:
|
||||||
|
kustomize.toolkit.fluxcd.io/prune: disabled
|
||||||
|
volsync.backube/privileged-movers: "true"
|
||||||
|
cdi.kubevirt.io: ""
|
46
kubernetes/apps/kubevirt/app/ks.yaml
Normal file
46
kubernetes/apps/kubevirt/app/ks.yaml
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app kubevirt
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: kubevirt
|
||||||
|
dependsOn:
|
||||||
|
- name: openebs-cluster
|
||||||
|
path: ./deploy
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: kubevirt
|
||||||
|
wait: true
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
||||||
|
patches:
|
||||||
|
# namespace is managed separately by main ks, no need for this ks to also manage it, KubeVirt bundles namespace into kubevirt-operator.yaml
|
||||||
|
- patch: |
|
||||||
|
$patch: delete
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: kubevirt
|
||||||
|
target:
|
||||||
|
kind: Namespace
|
||||||
|
name: kubevirt
|
||||||
|
- patch: |
|
||||||
|
apiVersion: kubevirt.io/v1
|
||||||
|
kind: KubeVirt
|
||||||
|
metadata:
|
||||||
|
name: not-used
|
||||||
|
spec:
|
||||||
|
configuration:
|
||||||
|
developerConfiguration:
|
||||||
|
featureGates:
|
||||||
|
- CPUNodeDiscovery
|
||||||
|
- ExpandDisks
|
||||||
|
vmStateStorageClass: openebs-zfs
|
||||||
|
target:
|
||||||
|
group: kubevirt.io
|
||||||
|
kind: KubeVirt
|
|
@ -7,3 +7,5 @@ resources:
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
# Flux-Kustomizations
|
# Flux-Kustomizations
|
||||||
- ./manager/ks.yaml
|
- ./manager/ks.yaml
|
||||||
|
- ./app/ks.yaml
|
||||||
|
- ./cdi/ks.yaml
|
||||||
|
|
17
kubernetes/flux/repositories/git/kubevirt-cdi.yaml
Normal file
17
kubernetes/flux/repositories/git/kubevirt-cdi.yaml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/gitrepository-source-v1.json
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: kubevirt-cdi
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 30m
|
||||||
|
url: https://git.hsn.dev/jahanson/kubevirt-flux.git
|
||||||
|
ref:
|
||||||
|
branch: cdi-v1.59.0
|
||||||
|
ignore: |
|
||||||
|
# exclude all
|
||||||
|
/*
|
||||||
|
# include files
|
||||||
|
!/deploy
|
17
kubernetes/flux/repositories/git/kubevirt.yaml
Normal file
17
kubernetes/flux/repositories/git/kubevirt.yaml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/gitrepository-source-v1.json
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: kubevirt
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 30m
|
||||||
|
url: https://git.hsn.dev/jahanson/kubevirt-flux.git
|
||||||
|
ref:
|
||||||
|
branch: v1.2.2
|
||||||
|
ignore: |
|
||||||
|
# exclude all
|
||||||
|
/*
|
||||||
|
# include files
|
||||||
|
!/deploy
|
7
kubernetes/flux/repositories/git/kutomization.yaml
Normal file
7
kubernetes/flux/repositories/git/kutomization.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- kubevirt.yaml
|
||||||
|
- kubevirt-cdi.yaml
|
|
@ -5,3 +5,4 @@ kind: Kustomization
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
resources:
|
resources:
|
||||||
- ./helm
|
- ./helm
|
||||||
|
- ./git
|
||||||
|
|
Loading…
Reference in a new issue