From 752a56fa4eda1ee893bbcfcf221fc079f92f6860 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 11:59:27 +0200 Subject: [PATCH 1/8] delete ubuntu 3 and echo server --- echo-server/app/helmrelease.yaml | 103 ------------------------------ echo-server/ks.yaml | 20 ------ kustomization.yaml | 2 - repos/helm/bjw-s.yaml | 11 ---- ubuntu-vm-3/ks.yaml | 18 ------ ubuntu-vm-3/ubuntu/ubuntu-vm.yaml | 48 -------------- 6 files changed, 202 deletions(-) delete mode 100644 echo-server/app/helmrelease.yaml delete mode 100644 echo-server/ks.yaml delete mode 100644 repos/helm/bjw-s.yaml delete mode 100644 ubuntu-vm-3/ks.yaml delete mode 100644 ubuntu-vm-3/ubuntu/ubuntu-vm.yaml diff --git a/echo-server/app/helmrelease.yaml b/echo-server/app/helmrelease.yaml deleted file mode 100644 index 7250687..0000000 --- a/echo-server/app/helmrelease.yaml +++ /dev/null @@ -1,103 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: &app echo-server -spec: - serviceAccountName: ${TECHNICAL_ACCOUNT} - interval: 30m - chart: - spec: - chart: app-template - version: 3.2.1 - sourceRef: - kind: HelmRepository - name: bjw-s - namespace: ${TENANT_NAMESPACE} - install: - remediation: - retries: 3 - upgrade: - cleanupOnFail: true - remediation: - strategy: rollback - retries: 3 - values: - controllers: - echo-server: - replicas: 2 - strategy: RollingUpdate - containers: - app: - image: - repository: ghcr.io/mendhak/http-https-echo - tag: 33 - env: - HTTP_PORT: &port 8080 - LOG_WITHOUT_NEWLINE: true - LOG_IGNORE_PATH: /healthz - PROMETHEUS_ENABLED: true - probes: - liveness: &probes - enabled: true - custom: true - spec: - httpGet: - path: /healthz - port: *port - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - failureThreshold: 3 - readiness: *probes - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - capabilities: { drop: ["ALL"] } - seccompProfile: - type: RuntimeDefault - resources: - requests: - cpu: 10m - memory: 64Mi - limits: - memory: 64Mi - cpu: 100m - defaultPodOptions: - securityContext: - runAsNonRoot: true - seccompProfile: { type: RuntimeDefault } - topologySpreadConstraints: - - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: DoNotSchedule - labelSelector: - matchLabels: - app.kubernetes.io/name: *app - service: - app: - controller: echo-server - ports: - http: - port: *port - serviceMonitor: - app: - serviceName: echo-server - endpoints: - - port: http - scheme: http - path: /metrics - interval: 1m - scrapeTimeout: 10s - ingress: - app: - className: external - hosts: - - host: "{{ .Release.Name }}-${TENANT_DOMAIN}" - paths: - - path: / - service: - identifier: app - port: http - diff --git a/echo-server/ks.yaml b/echo-server/ks.yaml deleted file mode 100644 index 4448636..0000000 --- a/echo-server/ks.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# 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: &app echo-server - namespace: ${TENANT_NAMESPACE} -spec: - commonMetadata: - labels: - app.kubernetes.io/name: *app - path: ./echo-server/app - prune: true - sourceRef: - kind: GitRepository - name: tenant-repos - wait: false - interval: 30m - retryInterval: 1m - timeout: 5m diff --git a/kustomization.yaml b/kustomization.yaml index 80d2821..194155a 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -3,10 +3,8 @@ kind: Kustomization resources: - vars/ks.yaml - repos/ks.yaml - - echo-server/ks.yaml - ubuntu-vm-1/ks.yaml - ubuntu-vm-2/ks.yaml - - ubuntu-vm-3/ks.yaml - container/ks-debug.yaml - templates/image-server/ks-nginx.yaml - templates/image-server/ks-pvc.yaml diff --git a/repos/helm/bjw-s.yaml b/repos/helm/bjw-s.yaml deleted file mode 100644 index 90cdc7f..0000000 --- a/repos/helm/bjw-s.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/source.toolkit.fluxcd.io/helmrepository_v1.json -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: bjw-s - namespace: ${TENANT_NAMESPACE} -spec: - interval: 5m - url: https://bjw-s-labs.github.io/helm-charts - diff --git a/ubuntu-vm-3/ks.yaml b/ubuntu-vm-3/ks.yaml deleted file mode 100644 index 12912dc..0000000 --- a/ubuntu-vm-3/ks.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: &app ubuntu-vm-3 - namespace: ${TENANT_NAMESPACE} -spec: - commonMetadata: - labels: - app.kubernetes.io/name: *app - path: ./ubuntu-vm-3/ubuntu - prune: true - sourceRef: - kind: GitRepository - name: tenant-repos - wait: false - interval: 30m - retryInterval: 1m - timeout: 5m diff --git a/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml deleted file mode 100644 index 3164a85..0000000 --- a/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - name: ubuntu-vm-3 - namespace: demo -spec: - running: true - template: - metadata: - labels: - kubevirt.io/domain: ubuntu-vm-3 - spec: - domain: - cpu: - cores: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - resources: - requests: - memory: 2Gi - cpu: 1 - limits: - memory: 2Gi - cpu: 1 - memory: - guest: 2Gi - volumes: - - name: containerdisk - containerDisk: - image: quay.io/containerdisks/ubuntu:22.04 - - name: cloudinitdisk - cloudInitNoCloud: - userData: | - #cloud-config - hostname: ubuntu-vm-3 - ssh_pwauth: True - users: - - name: ubuntu - ssh-authorized-keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqlhZW/pPLK8zENt3o6tgl0QVinhGAF1sHvajqq3UvI ubuntu - sudo: ['ALL=(ALL) NOPASSWD:ALL'] - shell: /bin/bash \ No newline at end of file From cebdd2ad2c24d9e31b436830a8ce0e51d24641b9 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:35:31 +0200 Subject: [PATCH 2/8] added template provided by redhat --- kustomization.yaml | 3 +- templates/windowsserver-rh/flavor/small.yaml | 104 +++++++++++++++++++ templates/windowsserver-rh/ks-flavor.yaml | 18 ++++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 templates/windowsserver-rh/flavor/small.yaml create mode 100644 templates/windowsserver-rh/ks-flavor.yaml diff --git a/kustomization.yaml b/kustomization.yaml index 194155a..ca06816 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -9,4 +9,5 @@ resources: - templates/image-server/ks-nginx.yaml - templates/image-server/ks-pvc.yaml - templates/image-server/ks-route.yaml - - templates/windowsserver/ks-flavor.yaml \ No newline at end of file + - templates/windowsserver/ks-flavor.yaml + - templates/windowsserver-rh/ks-flavor.yaml \ No newline at end of file diff --git a/templates/windowsserver-rh/flavor/small.yaml b/templates/windowsserver-rh/flavor/small.yaml new file mode 100644 index 0000000..6bd91ec --- /dev/null +++ b/templates/windowsserver-rh/flavor/small.yaml @@ -0,0 +1,104 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: windows-server-2022-small-redhat + namespace: '${TENANT_NAMESPACE}' + labels: + template.kubevirt.io/type: 'vm' + os.template.kubevirt.io/win2k22: 'true' + workload.template.kubevirt.io/server: 'true' + annotations: + name.os.template.kubevirt.io/win2k22: Windows Server 2022 + description: Windows Server 2022 VM + openshift.io/display-name: Windows Server 2022 + iconClass: icon-windows +objects: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + name: '${NAME}' + annotations: + description: Windows Server 2022 VM example + labels: + app: '${NAME}' + vm.kubevirt.io/template: 'windows-server-2022-template' + os.template.kubevirt.io/win2k22: 'true' + spec: + running: false + template: + metadata: + annotations: + vm.kubevirt.io/flavor: small + vm.kubevirt.io/os: win2k22 + vm.kubevirt.io/workload: server + labels: + kubevirt.io/domain: '${NAME}' + kubevirt.io/size: small + spec: + domain: + cpu: + cores: 1 + sockets: 1 + threads: 1 + devices: + disks: + - disk: + bus: virtio + name: rootdisk + interfaces: + - masquerade: {} + model: virtio + name: default + networkInterfaceMultiqueue: true + rng: {} + features: + acpi: {} + smm: + enabled: true + firmware: + bootloader: + efi: {} + memory: + guest: 4Gi + hostname: '${NAME}' + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 180 + volumes: + - name: rootdisk + dataVolume: + name: '${NAME}-dv' + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: '${NAME}-dv' + namespace: '${TENANT_NAMESPACE}' + spec: + source: + http: + url: '${IMAGE_URL}' + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: '${PVC_SIZE}' + storageClassName: '${STORAGE_CLASS}' +parameters: + - name: NAME + description: Name for the new VM + generate: expression + from: 'windows-[a-z0-9]{8}' + - name: IMAGE_URL + description: Public or internal HTTP(S) URL to a sysprepped Windows .qcow2 image + required: true + value: http://nginx.demo.svc.cluster.local:8080/win2022.qcow2 + - name: PVC_SIZE + description: Size of the root disk PVC + required: true + value: 120Gi + - name: STORAGE_CLASS + description: The StorageClass to use for the root disk PVC + required: true + value: ibm-spectrum-scale-fileset \ No newline at end of file diff --git a/templates/windowsserver-rh/ks-flavor.yaml b/templates/windowsserver-rh/ks-flavor.yaml new file mode 100644 index 0000000..2b04e73 --- /dev/null +++ b/templates/windowsserver-rh/ks-flavor.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app flavor + namespace: ${TENANT_NAMESPACE} +spec: + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./templates/windowsserver-rh/flavor + prune: true + sourceRef: + kind: GitRepository + name: tenant-repos + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m From 70f0098dbd031233c6365a3df6635cc3c74b70a3 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:39:14 +0200 Subject: [PATCH 3/8] changed app name --- templates/windowsserver-rh/ks-flavor.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/windowsserver-rh/ks-flavor.yaml b/templates/windowsserver-rh/ks-flavor.yaml index 2b04e73..efaa0d1 100644 --- a/templates/windowsserver-rh/ks-flavor.yaml +++ b/templates/windowsserver-rh/ks-flavor.yaml @@ -1,7 +1,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: &app flavor + name: &app flavor-rh namespace: ${TENANT_NAMESPACE} spec: commonMetadata: From 65c809bb445470ec71aa564ff327cd8fbfc1d160 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:42:15 +0200 Subject: [PATCH 4/8] changed label to be string rather than variable --- templates/windowsserver-rh/flavor/small.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/windowsserver-rh/flavor/small.yaml b/templates/windowsserver-rh/flavor/small.yaml index 6bd91ec..5d092ae 100644 --- a/templates/windowsserver-rh/flavor/small.yaml +++ b/templates/windowsserver-rh/flavor/small.yaml @@ -32,7 +32,7 @@ objects: vm.kubevirt.io/os: win2k22 vm.kubevirt.io/workload: server labels: - kubevirt.io/domain: '${NAME}' + kubevirt.io/domain: windows-server-2022-small-redhat kubevirt.io/size: small spec: domain: From a9df0a48c65ffff1e5dcd7e585809d833de9c964 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:47:39 +0200 Subject: [PATCH 5/8] changed name variable to value --- templates/windowsserver-rh/flavor/small.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/templates/windowsserver-rh/flavor/small.yaml b/templates/windowsserver-rh/flavor/small.yaml index 5d092ae..73cd091 100644 --- a/templates/windowsserver-rh/flavor/small.yaml +++ b/templates/windowsserver-rh/flavor/small.yaml @@ -16,11 +16,11 @@ objects: - apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: - name: '${NAME}' + name: windows-server-2022-small-redhat annotations: description: Windows Server 2022 VM example labels: - app: '${NAME}' + app: windows-server-2022-small-redhat vm.kubevirt.io/template: 'windows-server-2022-template' os.template.kubevirt.io/win2k22: 'true' spec: @@ -60,7 +60,7 @@ objects: efi: {} memory: guest: 4Gi - hostname: '${NAME}' + hostname: windows-server-2022-small-redhat networks: - name: default pod: {} @@ -68,11 +68,11 @@ objects: volumes: - name: rootdisk dataVolume: - name: '${NAME}-dv' + name: windows-server-2022-small-redhat-dv - apiVersion: cdi.kubevirt.io/v1beta1 kind: DataVolume metadata: - name: '${NAME}-dv' + name: windows-server-2022-small-redhat-dv namespace: '${TENANT_NAMESPACE}' spec: source: @@ -86,10 +86,6 @@ objects: storage: '${PVC_SIZE}' storageClassName: '${STORAGE_CLASS}' parameters: - - name: NAME - description: Name for the new VM - generate: expression - from: 'windows-[a-z0-9]{8}' - name: IMAGE_URL description: Public or internal HTTP(S) URL to a sysprepped Windows .qcow2 image required: true From 029664c6f7e02088de9434cbb4e56226de750de7 Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:52:13 +0200 Subject: [PATCH 6/8] change variable --- templates/windowsserver-rh/flavor/small.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/windowsserver-rh/flavor/small.yaml b/templates/windowsserver-rh/flavor/small.yaml index 73cd091..1373328 100644 --- a/templates/windowsserver-rh/flavor/small.yaml +++ b/templates/windowsserver-rh/flavor/small.yaml @@ -77,7 +77,7 @@ objects: spec: source: http: - url: '${IMAGE_URL}' + url: http://nginx.demo.svc.cluster.local:8080/win2022.qcow2 pvc: accessModes: - ReadWriteOnce @@ -86,10 +86,6 @@ objects: storage: '${PVC_SIZE}' storageClassName: '${STORAGE_CLASS}' parameters: - - name: IMAGE_URL - description: Public or internal HTTP(S) URL to a sysprepped Windows .qcow2 image - required: true - value: http://nginx.demo.svc.cluster.local:8080/win2022.qcow2 - name: PVC_SIZE description: Size of the root disk PVC required: true From 364d47707cc9d1aeeb463bb22cc3f6ea4066b61b Mon Sep 17 00:00:00 2001 From: "maximilian.bartz" Date: Thu, 8 May 2025 12:54:21 +0200 Subject: [PATCH 7/8] change variable again --- templates/windowsserver-rh/flavor/small.yaml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/templates/windowsserver-rh/flavor/small.yaml b/templates/windowsserver-rh/flavor/small.yaml index 1373328..9e4793b 100644 --- a/templates/windowsserver-rh/flavor/small.yaml +++ b/templates/windowsserver-rh/flavor/small.yaml @@ -83,14 +83,5 @@ objects: - ReadWriteOnce resources: requests: - storage: '${PVC_SIZE}' - storageClassName: '${STORAGE_CLASS}' -parameters: - - name: PVC_SIZE - description: Size of the root disk PVC - required: true - value: 120Gi - - name: STORAGE_CLASS - description: The StorageClass to use for the root disk PVC - required: true - value: ibm-spectrum-scale-fileset \ No newline at end of file + storage: 120Gi + storageClassName: ibm-spectrum-scale-fileset \ No newline at end of file From 595b1335214f56412c9042c118d71b757a2f5f5b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 8 May 2025 11:15:15 +0000 Subject: [PATCH 8/8] feat(docker-image)!: Update quay.io/containerdisks/ubuntu Docker tag to v24 --- ubuntu-vm-1/ubuntu/ubuntu-vm.yaml | 2 +- ubuntu-vm-2/ubuntu/ubuntu-vm.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ubuntu-vm-1/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-1/ubuntu/ubuntu-vm.yaml index af8a38c..ca1cb48 100644 --- a/ubuntu-vm-1/ubuntu/ubuntu-vm.yaml +++ b/ubuntu-vm-1/ubuntu/ubuntu-vm.yaml @@ -33,7 +33,7 @@ spec: volumes: - name: containerdisk containerDisk: - image: quay.io/containerdisks/ubuntu:22.04 + image: quay.io/containerdisks/ubuntu:24.04 - name: cloudinitdisk cloudInitNoCloud: userData: | diff --git a/ubuntu-vm-2/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-2/ubuntu/ubuntu-vm.yaml index 78e909a..85e3a0d 100644 --- a/ubuntu-vm-2/ubuntu/ubuntu-vm.yaml +++ b/ubuntu-vm-2/ubuntu/ubuntu-vm.yaml @@ -33,7 +33,7 @@ spec: volumes: - name: containerdisk containerDisk: - image: quay.io/containerdisks/ubuntu:22.04 + image: quay.io/containerdisks/ubuntu:24.04 - name: cloudinitdisk cloudInitNoCloud: userData: |