Skip to content

Commit

Permalink
add liveness and readiness probes
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudymax committed Oct 28, 2024
1 parent 873a311 commit 4da1a2c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kubevirt-vm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: kubevirt-vm
description: Configure a virtual machine for use with Kubevirt

type: application
version: 0.3.0
version: 0.3.1
appVersion: "0.1.0"

maintainers:
Expand Down
6 changes: 4 additions & 2 deletions charts/kubevirt-vm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kubevirt-vm

![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

Configure a virtual machine for use with Kubevirt

Expand All @@ -17,7 +17,9 @@ Configure a virtual machine for use with Kubevirt
| cloudinit | object | `{"enabled":true,"secretName":"friend-scrapmetal-user-data"}` | enable or disable usage of cloud-init |
| diskErrorPolicy | string | `"report"` | controls hypervisor behavior when IO errors occur on disk read or write. Possible values are: 'report', 'ignore', 'enospace' |
| disks | list | `[{"bootorder":2,"bus":"virtio","name":"harddrive","nodePlacement":"scremlin","pvaccessMode":"ReadWriteOnce","pvcname":"debian12","pvcnamespace":"kubevirt","pvsize":"64G","pvstorageClassName":"raid","readonly":false,"source":"pvc","type":"disk"}]` | List of disks to create for the VM, Will be used to create Datavolumes or PVCs. |
| service | list | `[{"externalTrafficPolicy":"Cluster","name":"service","ports":[{"name":"ssh","nodePort":30001,"port":22,"protocol":"TCP","targetPort":22},{"name":"vnc","nodePort":30005,"port":5900,"protocol":"TCP","targetPort":5900}],"type":"LoadBalancer"}]` | Service objects are used to expose the VM to the outside world. Just like int he cloud each VM starts off isolated and will need to be exposed via a LoadBalancer, NodePort, or ClusterIp service. |
| livenessProbe | object | `{"initialDelaySeconds":120,"periodSeconds":20,"tcpSocket":{"port":1500},"timeoutSeconds":10}` | set tieming and port number for liveness probe |
| readinessProbe | object | `{"failureThreshold":3,"httpGet":{"port":1500},"initialDelaySeconds":120,"periodSeconds":20,"successThreshold":3,"timeoutSeconds":10}` | set tieming and port number for readiness probe |
| service | list | `[{"externalTrafficPolicy":"Cluster","name":"service","ports":[{"name":"ssh","nodePort":30001,"port":22,"protocol":"TCP","targetPort":22},{"name":"status","nodePort":30001,"port":1500,"protocol":"TCP","targetPort":1500},{"name":"vnc","nodePort":30005,"port":5900,"protocol":"TCP","targetPort":5900}],"type":"NodePort"}]` | Service objects are used to expose the VM to the outside world. Just like int he cloud each VM starts off isolated and will need to be exposed via a LoadBalancer, NodePort, or ClusterIp service. |
| virtualMachine.features.acpiEnabled | bool | `true` | |
| virtualMachine.features.autoattachGraphicsDevice | bool | `true` | Attach a basic graphics device for VNC access |
| virtualMachine.features.autoattachPodInterface | bool | `true` | Make pod network interface the default for the VM |
Expand Down
8 changes: 8 additions & 0 deletions charts/kubevirt-vm/templates/virtualmachine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ spec:
networks:
- name: default
pod: {}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- range $reg, $props := .Values.disks }}
{{- if ne "cloudinitvolume" $props.name }}
Expand Down
23 changes: 23 additions & 0 deletions charts/kubevirt-vm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ service:
targetPort: 22
protocol: TCP
nodePort: 30001
- name: status
port: 1500
targetPort: 1500
protocol: TCP
nodePort: 30001
- name: vnc
port: 5900
targetPort: 5900
Expand All @@ -242,3 +247,21 @@ service:
cloudinit:
enabled: true
secretName: friend-scrapmetal-user-data

# -- set tieming and port number for liveness probe
livenessProbe:
initialDelaySeconds: 120
periodSeconds: 20
tcpSocket:
port: 1500
timeoutSeconds: 10

# -- set tieming and port number for readiness probe
readinessProbe:
initialDelaySeconds: 120
periodSeconds: 20
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 3
httpGet:
port: 1500

0 comments on commit 4da1a2c

Please sign in to comment.