Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize KubeVirt installation #65

Merged
merged 5 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
Binary file modified assets/kubevirt/kubevirt-0.2.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/kubevirt/0.2.0/templates/crd-uninstall-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
containers:
- name: {{ template "kubevirt.crdUninstallHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
2 changes: 1 addition & 1 deletion charts/kubevirt/0.2.0/templates/crd-upgrade-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
containers:
- name: {{ template "kubevirt.crdUpgradeHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
8 changes: 4 additions & 4 deletions charts/kubevirt/0.2.0/templates/kubevirt-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,15 +1284,15 @@ spec:
- virt-operator
env:
- name: VIRT_OPERATOR_IMAGE
value: {{ .Values.kubevirt.image }}:{{ .Values.kubevirt.version }}
value: {{ .Values.operator.image }}:{{ .Values.operator.version }}
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: KUBEVIRT_VERSION
value: {{ .Values.kubevirt.version }}
image: {{ .Values.kubevirt.image }}:{{ .Values.kubevirt.version }}
imagePullPolicy: {{ .Values.kubevirt.pullPolicy }}
value: {{ .Values.operator.version }}
image: {{ .Values.operator.image }}:{{ .Values.operator.version }}
imagePullPolicy: {{ .Values.operator.pullPolicy }}
name: virt-operator
ports:
- containerPort: 8443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
- name: {{ template "kubevirt.crUninstallHook.name" . }}
image: {{ .Values.hookImage }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
command:
- /bin/sh
- -c
Expand Down
61 changes: 55 additions & 6 deletions charts/kubevirt/0.2.0/templates/kubevirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,59 @@ metadata:
name: kubevirt
namespace: {{ .Release.Namespace }}
spec:
certificateRotateStrategy: {}
{{- with .Values.kubevirt.certificateRotateStrategy }}
certificateRotateStrategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.configuration }}
configuration:
developerConfiguration:
featureGates: []
customizeComponents: {}
imagePullPolicy: {{ .Values.kubevirt.pullPolicy }}
workloadUpdateStrategy: {}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.customizeComponents }}
customizeComponents:
{{- toYaml . | nindent 4 }}
{{- end }}
imagePullPolicy: {{ .Values.kubevirt.imagePullPolicy }}
{{- with .Values.kubevirt.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.imageRegistry }}
imageRegistry: {{ .Values.kubevirt.imageRegistry }}
{{- end }}
{{- if .Values.kubevirt.imageTag }}
imageTag: {{ .Values.kubevirt.imageTag }}
{{- end }}
{{- with .Values.kubevirt.infra }}
infra:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.monitorAccount }}
monitorAccount: {{ .Values.kubevirt.monitorAccount }}
{{- end }}
{{- if .Values.kubevirt.monitorNamespace }}
monitorNamespace: {{ .Values.kubevirt.monitorNamespace }}
{{- end }}
{{- if .Values.kubevirt.productComponent }}
productComponent: {{ .Values.kubevirt.productComponent }}
{{- end }}
{{- if .Values.kubevirt.productName }}
productName: {{ .Values.kubevirt.productName }}
{{- end }}
{{- if .Values.kubevirt.productVersion }}
productVersion: {{ .Values.kubevirt.productVersion }}
{{- end }}
{{- if .Values.kubevirt.serviceMonitorNamespace }}
serviceMonitorNamespace: {{ .Values.kubevirt.serviceMonitorNamespace }}
{{- end }}
{{- if .Values.kubevirt.uninstallStrategy }}
uninstallStrategy: {{ .Values.kubevirt.uninstallStrategy }}
{{- end }}
{{- with .Values.kubevirt.workloadUpdateStrategy }}
workloadUpdateStrategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.workloads }}
workloads:
{{- toYaml . | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/kubevirt/0.2.0/templates/namespace-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
containers:
- name: {{ template "kubevirt.namespaceHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
55 changes: 50 additions & 5 deletions charts/kubevirt/0.2.0/values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,61 @@
kubevirt:
operator:
image: registry.suse.com/suse/sles/15.5/virt-operator
version: 1.1.0-150500.8.6.1
pullPolicy: IfNotPresent

securityContext:
kubevirt:
certificateRotateStrategy: {}
# Holds kubevirt configurations. Same as the virt-configMap.
configuration: {}
customizeComponents: {}
# The ImagePullPolicy to use.
imagePullPolicy: IfNotPresent
# The imagePullSecrets to pull the container images from. Defaults to none.
imagePullSecrets: []
# The image registry to pull the container images from.
# Defaults to the same registry the operator's container image is pulled from.
imageRegistry: ""
# The image registry to pull the container images from.
# Defaults to the operator's container image tag.
imageTag: ""
# Selectors and tolerations that should apply to KubeVirt infrastructure components.
infra: {}
# The name of the Prometheus service account that needs read-access to KubeVirt endpoints.
# Defaults to prometheus-k8s.
monitorAccount: ""
# The namespace Prometheus is deployed in.
# Defaults to openshift-monitor.
monitorNamespace: ""
# Designate the apps.kubevirt.io/component label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductComponent is not specified, the component label default value is kubevirt.
productComponent: ""
# Designate the apps.kubevirt.io/part-of label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductName is not specified, the part-of label will be omitted.
productName: ""
# Designate the apps.kubevirt.io/version label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductVersion is not specified, KubeVirt's version will be used.
productVersion: ""
# The namespace where the service monitor will be deployed.
# Defaults to the monitoring namespace if not specified.
serviceMonitorNamespace: ""
# Specifies if KubeVirt can be deleted if workloads are still present.
# This is mainly a precaution to avoid accidental data loss.
uninstallStrategy: ""
# WorkloadUpdateStrategy defines at the cluster level how to handle automated workload updates.
workloadUpdateStrategy: {}
# Selectors and tolerations that should apply to KubeVirt workloads.
workloads: {}

hookImage: bitnami/kubectl:1.27.3
hookRestartPolicy: OnFailure
hookSecurityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL

hookImage: bitnami/kubectl:1.27.3
hookRestartPolicy: OnFailure
4 changes: 2 additions & 2 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ entries:
kubevirt:
- apiVersion: v2
appVersion: 1.1.0
created: "2023-12-14T12:48:14.39677+02:00"
created: "2023-12-14T16:20:44.884281+02:00"
description: A Helm chart for KubeVirt
digest: 399acd41b065350ca1d1c849e1f1bde3b97bd0421b37ac75550ecb07ee237840
digest: 5e60f865683eb8f908d04207af2b54189ac356209354d9cd4f83cdff691d62b3
icon: https://raw.githubusercontent.com/cncf/artwork/main/projects/kubevirt/icon/color/kubevirt-icon-color.svg
name: kubevirt
type: application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
containers:
- name: {{ template "kubevirt.crdUninstallHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
2 changes: 1 addition & 1 deletion packages/kubevirt/charts/templates/crd-upgrade-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
containers:
- name: {{ template "kubevirt.crdUpgradeHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
8 changes: 4 additions & 4 deletions packages/kubevirt/charts/templates/kubevirt-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,15 +1284,15 @@ spec:
- virt-operator
env:
- name: VIRT_OPERATOR_IMAGE
value: {{ .Values.kubevirt.image }}:{{ .Values.kubevirt.version }}
value: {{ .Values.operator.image }}:{{ .Values.operator.version }}
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: KUBEVIRT_VERSION
value: {{ .Values.kubevirt.version }}
image: {{ .Values.kubevirt.image }}:{{ .Values.kubevirt.version }}
imagePullPolicy: {{ .Values.kubevirt.pullPolicy }}
value: {{ .Values.operator.version }}
image: {{ .Values.operator.image }}:{{ .Values.operator.version }}
imagePullPolicy: {{ .Values.operator.pullPolicy }}
name: virt-operator
ports:
- containerPort: 8443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
- name: {{ template "kubevirt.crUninstallHook.name" . }}
image: {{ .Values.hookImage }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
command:
- /bin/sh
- -c
Expand Down
61 changes: 55 additions & 6 deletions packages/kubevirt/charts/templates/kubevirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,59 @@ metadata:
name: kubevirt
namespace: {{ .Release.Namespace }}
spec:
certificateRotateStrategy: {}
{{- with .Values.kubevirt.certificateRotateStrategy }}
certificateRotateStrategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.configuration }}
configuration:
developerConfiguration:
featureGates: []
customizeComponents: {}
imagePullPolicy: {{ .Values.kubevirt.pullPolicy }}
workloadUpdateStrategy: {}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.customizeComponents }}
customizeComponents:
{{- toYaml . | nindent 4 }}
{{- end }}
imagePullPolicy: {{ .Values.kubevirt.imagePullPolicy }}
{{- with .Values.kubevirt.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.imageRegistry }}
imageRegistry: {{ .Values.kubevirt.imageRegistry }}
{{- end }}
{{- if .Values.kubevirt.imageTag }}
imageTag: {{ .Values.kubevirt.imageTag }}
{{- end }}
{{- with .Values.kubevirt.infra }}
infra:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.monitorAccount }}
monitorAccount: {{ .Values.kubevirt.monitorAccount }}
{{- end }}
{{- if .Values.kubevirt.monitorNamespace }}
monitorNamespace: {{ .Values.kubevirt.monitorNamespace }}
{{- end }}
{{- if .Values.kubevirt.productComponent }}
productComponent: {{ .Values.kubevirt.productComponent }}
{{- end }}
{{- if .Values.kubevirt.productName }}
productName: {{ .Values.kubevirt.productName }}
{{- end }}
{{- if .Values.kubevirt.productVersion }}
productVersion: {{ .Values.kubevirt.productVersion }}
{{- end }}
{{- if .Values.kubevirt.serviceMonitorNamespace }}
serviceMonitorNamespace: {{ .Values.kubevirt.serviceMonitorNamespace }}
{{- end }}
{{- if .Values.kubevirt.uninstallStrategy }}
uninstallStrategy: {{ .Values.kubevirt.uninstallStrategy }}
{{- end }}
{{- with .Values.kubevirt.workloadUpdateStrategy }}
workloadUpdateStrategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubevirt.workloads }}
workloads:
{{- toYaml . | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion packages/kubevirt/charts/templates/namespace-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
containers:
- name: {{ template "kubevirt.namespaceHook.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
image: {{ .Values.hookImage }}
command:
- /bin/sh
Expand Down
55 changes: 50 additions & 5 deletions packages/kubevirt/charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,61 @@
kubevirt:
operator:
image: registry.suse.com/suse/sles/15.5/virt-operator
version: 1.1.0-150500.8.6.1
pullPolicy: IfNotPresent

securityContext:
kubevirt:
certificateRotateStrategy: {}
# Holds kubevirt configurations. Same as the virt-configMap.
configuration: {}
customizeComponents: {}
# The ImagePullPolicy to use.
imagePullPolicy: IfNotPresent
# The imagePullSecrets to pull the container images from. Defaults to none.
imagePullSecrets: []
# The image registry to pull the container images from.
# Defaults to the same registry the operator's container image is pulled from.
imageRegistry: ""
# The image registry to pull the container images from.
# Defaults to the operator's container image tag.
imageTag: ""
# Selectors and tolerations that should apply to KubeVirt infrastructure components.
infra: {}
# The name of the Prometheus service account that needs read-access to KubeVirt endpoints.
# Defaults to prometheus-k8s.
monitorAccount: ""
# The namespace Prometheus is deployed in.
# Defaults to openshift-monitor.
monitorNamespace: ""
# Designate the apps.kubevirt.io/component label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductComponent is not specified, the component label default value is kubevirt.
productComponent: ""
# Designate the apps.kubevirt.io/part-of label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductName is not specified, the part-of label will be omitted.
productName: ""
# Designate the apps.kubevirt.io/version label for KubeVirt components.
# Useful if KubeVirt is included as part of a product.
# If ProductVersion is not specified, KubeVirt's version will be used.
productVersion: ""
# The namespace where the service monitor will be deployed.
# Defaults to the monitoring namespace if not specified.
serviceMonitorNamespace: ""
# Specifies if KubeVirt can be deleted if workloads are still present.
# This is mainly a precaution to avoid accidental data loss.
uninstallStrategy: ""
# WorkloadUpdateStrategy defines at the cluster level how to handle automated workload updates.
workloadUpdateStrategy: {}
# Selectors and tolerations that should apply to KubeVirt workloads.
workloads: {}

hookImage: bitnami/kubectl:1.27.3
hookRestartPolicy: OnFailure
hookSecurityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL

hookImage: bitnami/kubectl:1.27.3
hookRestartPolicy: OnFailure