You need to define a pod for each virtual machine that you want to place under Kubernetes orchestration.
Pods are defined as .yaml
files.
The following text is an example of a pod configuration
for a VM with Virtlet:
apiVersion: v1
kind: Pod
metadata:
name: cirros-vm
annotations:
kubernetes.io/target-runtime: virtlet
VirtletVCPUCount: "1"
VirtletSSHKeys: |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2Zb
X0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFt
Cyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1E
Ro+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF
7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVy
iv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHc
kmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o
7P4fxoqiHEX+ZLfRxDtHB53 me@localhost
VirtletCloudInitUserDataScript: |
#!/bin/sh
echo "Hi there"
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: extraRuntime
operator: In
values:
- virtlet
containers:
- name: cirros-vm
image: virtlet/download.cirros-cloud.net/0.3.5/
cirros-0.3.5-x86_64-disk.img
resources:
limits:
memory: 128Mi
The following table describes the pod configuration parameters:
Parameter | Description |
---|---|
apiVersion |
Version of the Kubernetes API. |
kind |
Type of the file. For all pod configurations, the
kind parameter value is Pod . |
metadata |
Specifies a number of parameters required for the pod configuration, including:
|
spec |
Pod specification, including:
|