Is combination of kamaji and capi, compatible with kubevirt? #929
Answered
by
prometherion
cybercoder
asked this question in
Questions
-
When i use kubeadm controlplane with capi and kubevirt, everything works fine, but not with kamaji controlplane replacement. apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: testcluster
namespace: "1731930192436"
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.243.0.0/16
services:
cidrBlocks:
- 10.95.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KamajiControlPlane
name: testcluster
namespace: "1731930192436"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
name: testcluster
namespace: "1731930192436"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
metadata:
name: testcluster
namespace: "1731930192436"
# spec:
# controlPlaneServiceTemplate:
# spec:
# type: LoadBalancer
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
metadata:
name: testcluster-control-plane
namespace: "1731930192436"
spec:
template:
spec:
virtualMachineBootstrapCheck:
checkStrategy: ssh
virtualMachineTemplate:
metadata:
namespace: "1731930192436"
spec:
runStrategy: Always
template:
spec:
domain:
cpu:
cores: 2
devices:
disks:
- disk:
bus: virtio
name: containervolume
networkInterfaceMultiqueue: true
memory:
guest: 4Gi
evictionStrategy: External
volumes:
- containerDisk:
image: quay.io/capk/ubuntu-2204-container-disk:v1.30.1
name: containervolume
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: KamajiControlPlane
metadata:
name: testcluster
namespace: "1731930192436"
spec:
network:
serviceType: LoadBalancer
registry: registry.ik8s.ir
version: v1.30.1
dataStoreName: default
# controlPlaneEndpoint:
# host: 172.16.16.225
# port: 6443
apiServer:
extraArgs:
- --cloud-provider=external
controllerManager:
extraArgs:
- --cloud-provider=external
addons:
coreDNS:
dnsServiceIPs:
- 10.95.0.10
kubeProxy: {}
konnectivity: {}
kubelet:
cgroupfs: systemd
preferredAddressTypes:
- InternalIP
- ExternalIP
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
metadata:
name: testcluster-md-0
namespace: "1731930192436"
spec:
template:
spec:
virtualMachineTemplate:
metadata:
annotations:
username: "root"
password: "toor"
namespace: "1731930192436"
spec:
runStrategy: Always
template:
spec:
domain:
cpu:
cores: 2
devices:
disks:
- disk:
bus: virtio
name: disk0
memory:
guest: 4Gi
volumes:
- dataVolume:
name: disk0
name: disk0
evictionStrategy: External
dataVolumeTemplates:
- apiVersion: "cdi.kubevirt.io/v1beta1"
kind: DataVolume
metadata:
name: disk0
spec:
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
source:
http:
url: http://images.ik8s-system.svc.cluster.local/kube-noble-1.33.qcow2
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: testcluster-md-0
namespace: "1731930192436"
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs: {}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: testcluster-md-0
namespace: "1731930192436"
spec:
clusterName: testcluster
replicas: 1
selector:
matchLabels: null
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: testcluster-md-0
namespace: "1731930192436"
clusterName: testcluster
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtMachineTemplate
name: testcluster-md-0
namespace: "1731930192436"
version: v1.30.1
And k get svc -n 1731930192436
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
testcluster LoadBalancer 10.43.212.56 172.16.16.225 6443:30517/TCP,8132:30143/TCP 6m42s
testcluster-lb ClusterIP 10.43.111.99 <none> 6443/TCP 6m42s But there's no endpoint for k get endpoints -n 1731930192436 -w
Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice
NAME ENDPOINTS AGE
testcluster 10.16.1.145:6443,10.16.1.146:6443,10.16.1.145:8132 + 1 more... 6m58s
testcluster-lb <none> 6m58s The worker vm shows this error after a awhile:
And kubelet service log: journalctl -u kubelet -f
Also it shows it uses that service (without endpoint) inside the kubevirt vm:
|
Beta Was this translation helpful? Give feedback.
Answered by
prometherion
Sep 3, 2025
Replies: 1 comment
-
Your issue is with the
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
prometherion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your issue is with the
KubevirtCluster
resource:https://github.com/clastix/cluster-api-control-plane-provider-kamaji/blob/master/docs/providers-kubevirt.md