Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.243.0.0/16
services:
cidrBlocks:
- 10.95.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: KamajiControlPlane
name: '${CLUSTER_NAME}-control-plane'
namespace: "${NAMESPACE}"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
name: '${CLUSTER_NAME}'
namespace: "${NAMESPACE}"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
metadata:
annotations:
cluster.x-k8s.io/managed-by: kamaji
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec: {}
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: KamajiControlPlane
metadata:
name: '${CLUSTER_NAME}-control-plane'
namespace: "${NAMESPACE}"
spec:
dataStoreName: default
addons:
coreDNS:
dnsServiceIPs:
- 10.95.0.10
kubeProxy: {}
konnectivity: {}
kubelet:
cgroupfs: systemd
preferredAddressTypes:
- InternalIP
- ExternalIP
network:
serviceType: LoadBalancer
serviceAnnotations:
kube-vip.io/loadbalancerIPs: 0.0.0.0
deployment:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: "${KUBERNETES_VERSION}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.243.0.0/16
services:
cidrBlocks:
- 10.95.0.0/16
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
name: '${CLUSTER_NAME}'
namespace: "${NAMESPACE}"
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: '${CLUSTER_NAME}-control-plane'
namespace: "${NAMESPACE}"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
controlPlaneServiceTemplate:
metadata:
annotations:
kube-vip.io/loadbalancerIPs: 0.0.0.0
spec:
type: LoadBalancer
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
metadata:
name: "${CLUSTER_NAME}-control-plane"
namespace: "${NAMESPACE}"
spec:
template:
spec:
virtualMachineBootstrapCheck:
checkStrategy: none
virtualMachineTemplate:
metadata:
namespace: "${NAMESPACE}"
spec:
runStrategy: Always
template:
spec:
domain:
cpu:
cores: ${CONTROL_PLANE_MACHINE_CPU}
sockets: ${SOCKETS}
threads: ${THREADS}
devices:
disks:
- disk:
bus: virtio
name: containervolume
interfaces:
- bridge: {}
model: virtio
name: default
- bridge: {}
model: virtio
name: secondary
networkInterfaceMultiqueue: true
resources:
limits:
cpu: ${CONTROL_PLANE_MACHINE_CPU}
memory: "${CONTROL_PLANE_MACHINE_MEMORY}Gi"
requests:
cpu: ${CONTROL_PLANE_MACHINE_CPU}
memory: "${CONTROL_PLANE_MACHINE_MEMORY}Gi"
evictionStrategy: External
networks:
- name: default
multus:
networkName: default/vmnet
- name: secondary
pod: {}
volumes:
- containerDisk:
image: "${NODE_VM_IMAGE_TEMPLATE}"
name: containervolume
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
metadata:
name: "${CLUSTER_NAME}-control-plane"
namespace: "${NAMESPACE}"
spec:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
machineTemplate:
infrastructureRef:
kind: KubevirtMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
name: "${CLUSTER_NAME}-control-plane"
namespace: "${NAMESPACE}"
kubeadmConfigSpec:
clusterConfiguration:
networking:
dnsDomain: "${CLUSTER_NAME}.${NAMESPACE}.local"
podSubnet: 10.243.0.0/16
serviceSubnet: 10.95.0.0/16
initConfiguration:
nodeRegistration:
criSocket: "${CRI_PATH}"
joinConfiguration:
nodeRegistration:
criSocket: "${CRI_PATH}"
version: "${KUBERNETES_VERSION}"

103 changes: 103 additions & 0 deletions files/cluster-api-provider-kubevirt/worker_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
metadata:
name: "${CLUSTER_NAME}-md"
namespace: "${NAMESPACE}"
spec:
template:
spec:
virtualMachineBootstrapCheck:
checkStrategy: none
virtualMachineTemplate:
spec:
dataVolumeTemplates:
- metadata:
name: "${CLUSTER_NAME}-md-boot-volume"
spec:
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: "${INFRA_CLUSTER_STORAGE_CLASS_NAME}"
source:
registry:
url: "docker://${NODE_VM_IMAGE_TEMPLATE}"
runStrategy: Always
template:
spec:
domain:
cpu:
cores: ${WORKER_POOL_CPU}
sockets: ${SOCKETS}
threads: ${THREADS}
devices:
interfaces:
- bridge: {}
model: virtio
name: default
- bridge: {}
model: virtio
name: secondary
disks:
- disk:
bus: virtio
name: dv-volume
resources:
limits:
cpu: ${WORKER_POOL_CPU}
memory: "${WORKER_POOL_MEMORY}Gi"
requests:
cpu: ${WORKER_POOL_CPU}
memory: "${WORKER_POOL_MEMORY}Gi"
evictionStrategy: External
networks:
- name: default
pod: {}
- multus:
networkName: default/vmnet
name: secondary
volumes:
- dataVolume:
name: "${CLUSTER_NAME}-md-boot-volume"
name: dv-volume
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md"
namespace: "${NAMESPACE}"
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs: {}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: "${CLUSTER_NAME}-md"
namespace: "${NAMESPACE}"
spec:
clusterName: "${CLUSTER_NAME}"
replicas: ${WORKER_POOL_NODES}
selector:
matchLabels: null
template:
spec:
clusterName: "${CLUSTER_NAME}"
version: "${KUBERNETES_VERSION}"
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: "${CLUSTER_NAME}-md"
namespace: "${NAMESPACE}"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
name: "${CLUSTER_NAME}-md"
namespace: "${NAMESPACE}"
Loading