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 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
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
25 changes: 19 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,23 @@ metadata:
name: kubevirt
namespace: {{ .Release.Namespace }}
spec:
certificateRotateStrategy: {}
{{- 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.infra }}
infra:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.uninstallStrategy }}
uninstallStrategy: {{ .Values.kubevirt.uninstallStrategy }}
{{- end }}
{{- with .Values.kubevirt.workloadUpdateStrategy }}
workloadUpdateStrategy:
{{- 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
23 changes: 18 additions & 5 deletions charts/kubevirt/0.2.0/values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
kubevirt:
operator:
image: registry.suse.com/suse/sles/15.5/virt-operator
version: 1.1.0-150500.8.6.1
pullPolicy: IfNotPresent

securityContext:
kubevirt:
# Holds kubevirt configurations. Same as the virt-configMap.
configuration: {}
customizeComponents: {}
# The ImagePullPolicy to use.
imagePullPolicy: IfNotPresent
# Selectors and tolerations that should apply to KubeVirt infrastructure components.
infra: {}
# 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: {}

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-18T18:34:40.330122+02:00"
description: A Helm chart for KubeVirt
digest: 399acd41b065350ca1d1c849e1f1bde3b97bd0421b37ac75550ecb07ee237840
digest: 13214c1d50df26178ca8dcf6b169891f06b497029e9282c4cab52b86502894bb
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
25 changes: 19 additions & 6 deletions packages/kubevirt/charts/templates/kubevirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ metadata:
name: kubevirt
namespace: {{ .Release.Namespace }}
spec:
certificateRotateStrategy: {}
{{- 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.infra }}
infra:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.kubevirt.uninstallStrategy }}
uninstallStrategy: {{ .Values.kubevirt.uninstallStrategy }}
{{- end }}
{{- with .Values.kubevirt.workloadUpdateStrategy }}
workloadUpdateStrategy:
{{- 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
23 changes: 18 additions & 5 deletions packages/kubevirt/charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
kubevirt:
operator:
image: registry.suse.com/suse/sles/15.5/virt-operator
version: 1.1.0-150500.8.6.1
pullPolicy: IfNotPresent

securityContext:
kubevirt:
# Holds kubevirt configurations. Same as the virt-configMap.
configuration: {}
customizeComponents: {}
# The ImagePullPolicy to use.
imagePullPolicy: IfNotPresent
# Selectors and tolerations that should apply to KubeVirt infrastructure components.
infra: {}
# 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: {}

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