diff --git a/README.md b/README.md index 5f29893..753db67 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,3 @@ $ oc get all -n tenant-tpl ``` - Great big fire diff --git a/deployment/ubuntu-deployment/datadisk.yaml b/deployment/ubuntu-deployment/datadisk.yaml index 9381bc3..e314c58 100644 --- a/deployment/ubuntu-deployment/datadisk.yaml +++ b/deployment/ubuntu-deployment/datadisk.yaml @@ -8,7 +8,7 @@ metadata: spec: volumeMode: Filesystem accessModes: [ "ReadWriteOnce" ] - storageClassName: ibm-spectrum-scale-fileset + storageClassName: ocs-storagecluster-ceph-rbd resources: requests: storage: 50Gi \ No newline at end of file diff --git a/deployment/ubuntu-deployment/pod.yaml b/deployment/ubuntu-deployment/pod.yaml index 345c66f..dad687f 100644 --- a/deployment/ubuntu-deployment/pod.yaml +++ b/deployment/ubuntu-deployment/pod.yaml @@ -19,13 +19,13 @@ spec: subdomain: pod securityContext: runAsNonRoot: true - fsGroup: 1001070000 + fsGroup: 1002070000 fsGroupChangePolicy: OnRootMismatch seccompProfile: type: RuntimeDefault containers: - name: ubuntu-deployment-pod - image: ubuntu:22.04 + image: ubuntu:24.04 imagePullPolicy: IfNotPresent command: ["bash","-lc","sleep infinity"] securityContext: diff --git a/kustomization.yaml b/kustomization.yaml index 9b41353..b4ef8ad 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -12,7 +12,10 @@ resources: - ubuntu-vm-1/ks.yaml - ubuntu-vm-2/ks.yaml - ubuntu-vm-3/ks.yaml - - deployment/ks.yaml + - ubuntu-vm-4-john/ks.yaml + - ubuntu-vm-5/ks.yaml + - ubuntu-vm-6/ks.yaml + - deployment/ubuntu-deployment/ks.yaml - container/ks-debug.yaml - templates/image-server/ks-nginx.yaml - templates/image-server/ks-pvc.yaml @@ -20,3 +23,5 @@ resources: - templates/windowsserver/ks-flavor.yaml - templates/windowsserver-rh/ks-flavor.yaml - postgres/ks.yaml +# - windows-vm-standard-john/ks-vm.yaml +# - windows-vm-standard-john/ks-pvc.yaml diff --git a/ubuntu-vm-3/ks.yaml b/ubuntu-vm-3/ks.yaml index 248c295..12912dc 100644 --- a/ubuntu-vm-3/ks.yaml +++ b/ubuntu-vm-3/ks.yaml @@ -7,7 +7,7 @@ spec: commonMetadata: labels: app.kubernetes.io/name: *app - path: ./ubuntu-vm-3/vm + path: ./ubuntu-vm-3/ubuntu prune: true sourceRef: kind: GitRepository diff --git a/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml new file mode 100644 index 0000000..ae02fee --- /dev/null +++ b/ubuntu-vm-3/ubuntu/ubuntu-vm.yaml @@ -0,0 +1,50 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + name: ubuntu-vm-3 + namespace: ${TENANT_NAMESPACE} +spec: + running: true + template: + metadata: + labels: + kubevirt.io/domain: ubuntu-vm-3 + spec: + domain: + cpu: + cores: 2 + devices: + disks: + - disk: + bus: virtio + name: containerdisk + - disk: + bus: virtio + name: cloudinitdisk + resources: + requests: + memory: 2Gi + cpu: 1 + limits: + memory: 2Gi + cpu: 2 + memory: + guest: 2Gi + volumes: + - name: containerdisk + containerDisk: + image: quay.io/containerdisks/ubuntu:22.04 + - name: cloudinitdisk + cloudInitNoCloud: + userData: | + #cloud-config + users: + - name: testuser + groups: [sudo] + sudo: "ALL=(ALL) NOPASSWD:ALL" + lock_passwd: false + passwd: "$6$oMZf5uou7t0.oAJ1$825Te06yt7JZwHSSj4MGQMjpd87LflANQpajCwIVPASkKZdOJo4L2bAEDDuK.jtu.fsRNc9bZAsYefmoqdN8O1" + + chpasswd: + expire: false + ssh_pwauth: true \ No newline at end of file diff --git a/ubuntu-vm-4-john/ks.yaml b/ubuntu-vm-4-john/ks.yaml new file mode 100644 index 0000000..f117b31 --- /dev/null +++ b/ubuntu-vm-4-john/ks.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app ubuntu-vm-4-john + namespace: ${TENANT_NAMESPACE} +spec: + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./ubuntu-vm-4-john/ubuntu + prune: true + sourceRef: + kind: GitRepository + name: tenant-repos + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/ubuntu-vm-4-john/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-4-john/ubuntu/ubuntu-vm.yaml new file mode 100644 index 0000000..a7448b3 --- /dev/null +++ b/ubuntu-vm-4-john/ubuntu/ubuntu-vm.yaml @@ -0,0 +1,48 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + name: ubuntu-vm-4-john + namespace: kubevirt-vms +spec: + running: true + template: + metadata: + labels: + kubevirt.io/domain: ubuntu-vm-4-john + spec: + domain: + cpu: + cores: 2 + devices: + disks: + - disk: + bus: virtio + name: containerdisk + - disk: + bus: virtio + name: cloudinitdisk + resources: + requests: + memory: 2Gi + cpu: 1 + limits: + memory: 2Gi + cpu: 2 + memory: + guest: 2Gi + volumes: + - name: containerdisk + containerDisk: + image: quay.io/containerdisks/ubuntu:22.04 + - name: cloudinitdisk + cloudInitNoCloud: + userData: | + #cloud-config + hostname: ubuntu-vm-2 + 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 diff --git a/ubuntu-vm-5/ks.yaml b/ubuntu-vm-5/ks.yaml new file mode 100644 index 0000000..d540852 --- /dev/null +++ b/ubuntu-vm-5/ks.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app ubuntu-vm-5 + namespace: ${TENANT_NAMESPACE} +spec: + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./ubuntu-vm-5/vm + prune: true + sourceRef: + kind: GitRepository + name: tenant-repos + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/ubuntu-vm-3/vm/pvc/ubuntu-datadisk.yaml b/ubuntu-vm-5/vm/pvc/ubuntu-datadisk.yaml similarity index 81% rename from ubuntu-vm-3/vm/pvc/ubuntu-datadisk.yaml rename to ubuntu-vm-5/vm/pvc/ubuntu-datadisk.yaml index 76aa597..d6ce155 100644 --- a/ubuntu-vm-3/vm/pvc/ubuntu-datadisk.yaml +++ b/ubuntu-vm-5/vm/pvc/ubuntu-datadisk.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: ubuntu-datadisk-3 + name: ubuntu-datadisk-1 namespace: ${TENANT_NAMESPACE} labels: - app: ubuntu-vm-3 + app: ubuntu-vm-1 spec: volumeMode: Filesystem accessModes: diff --git a/ubuntu-vm-3/vm/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-5/vm/ubuntu/ubuntu-vm.yaml similarity index 86% rename from ubuntu-vm-3/vm/ubuntu/ubuntu-vm.yaml rename to ubuntu-vm-5/vm/ubuntu/ubuntu-vm.yaml index 09a6912..a30a590 100644 --- a/ubuntu-vm-3/vm/ubuntu/ubuntu-vm.yaml +++ b/ubuntu-vm-5/vm/ubuntu/ubuntu-vm.yaml @@ -1,7 +1,7 @@ apiVersion: kubevirt.io/v1 kind: VirtualMachine metadata: - name: &name ubuntu-vm-3 + name: &name ubuntu-vm-1 namespace: ${TENANT_NAMESPACE} spec: running: true @@ -12,13 +12,13 @@ spec: kubevirt.io/domain: *name spec: hostname: ubuntu - subdomain: test + subdomain: vitabyte domain: devices: disks: - disk: bus: scsi - name: ubuntu-rootdisk-3 + name: ubuntu-rootdisk - disk: bus: scsi name: ubuntu-datadisk @@ -37,12 +37,12 @@ spec: cpu: 2 memory: 2Gi volumes: - - name: ubuntu-rootdisk-3 + - name: ubuntu-rootdisk containerDisk: image: quay.io/containerdisks/ubuntu:22.04 - name: ubuntu-datadisk persistentVolumeClaim: - claimName: ubuntu-datadisk-3 + claimName: ubuntu-datadisk-1 - name: cloudinit-disk cloudInitNoCloud: secretRef: diff --git a/ubuntu-vm-6/ks.yaml b/ubuntu-vm-6/ks.yaml new file mode 100644 index 0000000..d030e48 --- /dev/null +++ b/ubuntu-vm-6/ks.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app ubuntu-vm-6 + 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-6/ubuntu/ubuntu-vm.yaml b/ubuntu-vm-6/ubuntu/ubuntu-vm.yaml new file mode 100644 index 0000000..ae02fee --- /dev/null +++ b/ubuntu-vm-6/ubuntu/ubuntu-vm.yaml @@ -0,0 +1,50 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + name: ubuntu-vm-3 + namespace: ${TENANT_NAMESPACE} +spec: + running: true + template: + metadata: + labels: + kubevirt.io/domain: ubuntu-vm-3 + spec: + domain: + cpu: + cores: 2 + devices: + disks: + - disk: + bus: virtio + name: containerdisk + - disk: + bus: virtio + name: cloudinitdisk + resources: + requests: + memory: 2Gi + cpu: 1 + limits: + memory: 2Gi + cpu: 2 + memory: + guest: 2Gi + volumes: + - name: containerdisk + containerDisk: + image: quay.io/containerdisks/ubuntu:22.04 + - name: cloudinitdisk + cloudInitNoCloud: + userData: | + #cloud-config + users: + - name: testuser + groups: [sudo] + sudo: "ALL=(ALL) NOPASSWD:ALL" + lock_passwd: false + passwd: "$6$oMZf5uou7t0.oAJ1$825Te06yt7JZwHSSj4MGQMjpd87LflANQpajCwIVPASkKZdOJo4L2bAEDDuK.jtu.fsRNc9bZAsYefmoqdN8O1" + + chpasswd: + expire: false + ssh_pwauth: true \ No newline at end of file diff --git a/windows-vm-standard-john/ks-pvc.yaml b/windows-vm-standard-john/ks-pvc.yaml new file mode 100644 index 0000000..68e3154 --- /dev/null +++ b/windows-vm-standard-john/ks-pvc.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app windows-pvc-john + namespace: ${TENANT_NAMESPACE} +spec: + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./windows-vm-standard-john/pvc + prune: true + sourceRef: + kind: GitRepository + name: tenant-repos + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m \ No newline at end of file diff --git a/windows-vm-standard-john/ks-vm.yaml b/windows-vm-standard-john/ks-vm.yaml new file mode 100644 index 0000000..4b8608c --- /dev/null +++ b/windows-vm-standard-john/ks-vm.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app windows-vm-standard-john + namespace: ${TENANT_NAMESPACE} +spec: + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./windows-vm-standard-john/vm + prune: true + sourceRef: + kind: GitRepository + name: tenant-repos + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m \ No newline at end of file diff --git a/windows-vm-standard-john/pvc/datadisk.yaml b/windows-vm-standard-john/pvc/datadisk.yaml new file mode 100644 index 0000000..6c901ab --- /dev/null +++ b/windows-vm-standard-john/pvc/datadisk.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: windows-vm-datadisk-john +spec: + storageClassName: ibm-spectrum-scale-fileset + volumeMode: Filesystem + accessModes: + - ReadWriteMany + resources: + requests: + storage: 200Gi diff --git a/windows-vm-standard-john/vm/server.yaml b/windows-vm-standard-john/vm/server.yaml new file mode 100644 index 0000000..bf952a8 --- /dev/null +++ b/windows-vm-standard-john/vm/server.yaml @@ -0,0 +1,82 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + name: windows-vm-standard-john + namespace: ${TENANT_NAMESPACE} +spec: + dataVolumeTemplates: + - metadata: + name: windows-rootdisk-john + spec: + source: + http: + url: http://nginx.demo.svc.cluster.local:80/windows-server-2022-uefi-ns.qcow2 + storage: + resources: + requests: + storage: 80Gi +# sourceRef: +# kind: DataSource +# name: win2k22 +# namespace: openshift-virtualization-os-images + runStrategy: Always + template: + metadata: + labels: + kubevirt.io/domain: windows-vm-standard-john + spec: + domain: + cpu: + cores: 4 + memory: + guest: 8Gi + features: + acpi: {} + smm: + enabled: true + firmware: + bootloader: + efi: {} + devices: + rng: {} + networkInterfaceMultiqueue: true + interfaces: + - name: default + masquerade: {} + ports: + - port: 8080 + - port: 443 + - port: 22 + - port: 3389 + disks: + - disk: + bus: sata + name: rootdisk-john + - disk: + bus: sata + name: datadisk-john + # - disk: + # bus: scsi + # name: cloudinitdisk + resources: + requests: + memory: 8Gi + cpu: 4 + limits: + memory: 8Gi + cpu: 4 + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 180 + volumes: + - name: rootdisk-john + dataVolume: + name: windows-rootdisk-john + - name: datadisk-john + persistentVolumeClaim: + claimName: windows-vm-datadisk-john + #- name: cloudinitdisk + # cloudInitNoCloud: + # secretRef: + # name: windows-cloud-init diff --git a/windows-vm-standard/vm/server.yaml b/windows-vm-standard/vm/server.yaml index e9041f1..8e381e4 100644 --- a/windows-vm-standard/vm/server.yaml +++ b/windows-vm-standard/vm/server.yaml @@ -10,15 +10,15 @@ spec: spec: source: http: - url: "https://glacier-1.kvant.cloud/ocp-virt-images/sources/windows-server-2022-uefi-ns.qcow2" + url: http://nginx.demo.svc.cluster.local:8080/windows-server-2022-uefi-ns.qcow2 storage: resources: requests: storage: 80Gi - #sourceRef: - #kind: DataSource - #name: win2k22 - #namespace: openshift-virtualization-os-images + sourceRef: + kind: DataSource + name: win2k22 + namespace: kubevirt-os-images runStrategy: Always template: metadata: @@ -38,13 +38,10 @@ spec: bootloader: efi: {} devices: - #gpus: - #- name: gpu01 - #deviceName: nvidia.com/gpu rng: {} networkInterfaceMultiqueue: true interfaces: - - name: ingress + - name: default masquerade: {} ports: - port: 8080 @@ -56,7 +53,7 @@ spec: bus: sata name: rootdisk - disk: - bus: scsi + bus: sata name: datadisk # - disk: # bus: scsi @@ -68,9 +65,8 @@ spec: limits: memory: 8Gi cpu: 4 - #nvidia.com/gpu: 1 networks: - - name: ingress + - name: default pod: {} terminationGracePeriodSeconds: 180 volumes: