mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-30 18:20:38 +02:00
feat: kubevirt on k3s
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
from .kubevirt import *
|
||||
from .virtual_machines import *
|
||||
@@ -0,0 +1,22 @@
|
||||
from pulumi_kubernetes.yaml import ConfigGroup
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
currentDir = Path(__file__).parent
|
||||
|
||||
|
||||
def virtHandlerNodePlacement(obj, opts):
|
||||
if obj["kind"] == "KubeVirt":
|
||||
obj["spec"]["workloads"] = {
|
||||
"nodePlacement": {
|
||||
"nodeSelector": {"node-type": "worker"}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
kubevirt = ConfigGroup(
|
||||
"kubevirt",
|
||||
files=[currentDir.as_posix() + "/yaml/*.yaml"],
|
||||
# A set of transformations to apply to Kubernetes resource definitions before registering with engine.
|
||||
transformations=[virtHandlerNodePlacement],
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
from .test import *
|
||||
@@ -0,0 +1,10 @@
|
||||
from pulumi_kubernetes.yaml import ConfigGroup
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
currentDir = Path(__file__).parent
|
||||
|
||||
kubevirt = ConfigGroup(
|
||||
"virtual-machines",
|
||||
files=[currentDir.as_posix() + "/yaml/*.yaml"],
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: kubevirt.io/v1
|
||||
kind: VirtualMachineInstance
|
||||
metadata:
|
||||
name: testvmi-nocloud
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 30
|
||||
domain:
|
||||
resources:
|
||||
requests:
|
||||
memory: 1024M
|
||||
devices:
|
||||
disks:
|
||||
- name: containerdisk
|
||||
disk:
|
||||
bus: virtio
|
||||
- name: emptydisk
|
||||
disk:
|
||||
bus: virtio
|
||||
- disk:
|
||||
bus: virtio
|
||||
name: cloudinitdisk
|
||||
volumes:
|
||||
- name: containerdisk
|
||||
containerDisk:
|
||||
image: kubevirt/fedora-cloud-container-disk-demo:latest
|
||||
- name: emptydisk
|
||||
emptyDisk:
|
||||
capacity: "2Gi"
|
||||
- name: cloudinitdisk
|
||||
cloudInitNoCloud:
|
||||
userData: |-
|
||||
#cloud-config
|
||||
password: fedora
|
||||
chpasswd: { expire: False }
|
||||
@@ -0,0 +1,5 @@
|
||||
export RELEASE=$(curl https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)
|
||||
echo "The latest kubevirt's version is $RELEASE"
|
||||
|
||||
curl -Lo kubevirt-operator-${RELEASE}.yaml https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-operator.yaml
|
||||
curl -Lo kubevirt-cr-${RELEASE}.yaml https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-cr.yaml
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
apiVersion: kubevirt.io/v1
|
||||
kind: KubeVirt
|
||||
metadata:
|
||||
name: kubevirt
|
||||
namespace: kubevirt
|
||||
spec:
|
||||
certificateRotateStrategy: {}
|
||||
configuration:
|
||||
developerConfiguration:
|
||||
featureGates: []
|
||||
customizeComponents: {}
|
||||
imagePullPolicy: IfNotPresent
|
||||
workloadUpdateStrategy: {}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user