-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Koen de Laat <[email protected]>
- Loading branch information
1 parent
295986d
commit b310afc
Showing
16 changed files
with
8,447 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v2 | ||
appVersion: 1.3.1 | ||
description: A Helm chart for KubeVirt | ||
icon: https://raw.githubusercontent.com/cncf/artwork/main/projects/kubevirt/icon/color/kubevirt-icon-color.svg | ||
name: kubevirt | ||
type: application | ||
version: 0.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KubeVirt is a virtual machine management add-on for Kubernetes. The aim is to provide a common ground for virtualization solutions on top of Kubernetes. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Verify that all KubeVirt components are installed correctly: | ||
kubectl get all -n {{ .Release.Namespace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kubevirt.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kubevirt.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "kubevirt.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "kubevirt.labels" -}} | ||
helm.sh/chart: {{ include "kubevirt.chart" . }} | ||
{{ include "kubevirt.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "kubevirt.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "kubevirt.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "kubevirt.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "kubevirt.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{/* Hook annotations */}} | ||
{{- define "kubevirt.hook.annotations" -}} | ||
annotations: | ||
"helm.sh/hook": {{ .hookType }} | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
"helm.sh/hook-weight": {{ .hookWeight | quote }} | ||
{{- end -}} | ||
|
||
{{/* Namespace modifying hook annotations */}} | ||
{{- define "kubevirt.namespaceHook.annotations" -}} | ||
{{ template "kubevirt.hook.annotations" merge (dict "hookType" "pre-install") . }} | ||
{{- end -}} | ||
|
||
{{/* CRD upgrading hook annotations */}} | ||
{{- define "kubevirt.crdUpgradeHook.annotations" -}} | ||
{{ template "kubevirt.hook.annotations" merge (dict "hookType" "pre-upgrade") . }} | ||
{{- end -}} | ||
|
||
{{/* Custom resource uninstalling hook annotations */}} | ||
{{- define "kubevirt.crUninstallHook.annotations" -}} | ||
{{ template "kubevirt.hook.annotations" merge (dict "hookType" "pre-delete") . }} | ||
{{- end -}} | ||
|
||
{{/* CRD uninstalling hook annotations */}} | ||
{{- define "kubevirt.crdUninstallHook.annotations" -}} | ||
{{ template "kubevirt.hook.annotations" merge (dict "hookType" "post-delete") . }} | ||
{{- end -}} | ||
|
||
{{/* Namespace modifying hook name */}} | ||
{{- define "kubevirt.namespaceHook.name" -}} | ||
{{ include "kubevirt.fullname" . }}-namespace-modify | ||
{{- end }} | ||
|
||
{{/* CRD upgrading hook name */}} | ||
{{- define "kubevirt.crdUpgradeHook.name" -}} | ||
{{ include "kubevirt.fullname" . }}-crd-upgrade | ||
{{- end }} | ||
|
||
{{/* Custom resource uninstalling hook name */}} | ||
{{- define "kubevirt.crUninstallHook.name" -}} | ||
{{ include "kubevirt.fullname" . }}-uninstall | ||
{{- end }} | ||
|
||
{{/* CRD uninstalling hook name */}} | ||
{{- define "kubevirt.crdUninstallHook.name" -}} | ||
{{ include "kubevirt.fullname" . }}-crd-uninstall | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{- if .Values.hooksEnabled.crd.uninstall }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
{{ template "kubevirt.crdUninstallHook.annotations" (dict "hookWeight" 1) }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
{{ template "kubevirt.crdUninstallHook.annotations" (dict "hookWeight" 1) }} | ||
rules: | ||
- apiGroups: [ "apiextensions.k8s.io" ] | ||
resources: [ "customresourcedefinitions" ] | ||
resourceNames: | ||
- "kubevirts.kubevirt.io" | ||
verbs: [ "delete" ] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
{{ template "kubevirt.crdUninstallHook.annotations" (dict "hookWeight" 2) }} | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
{{ template "kubevirt.crdUninstallHook.annotations" (dict "hookWeight" 3) }} | ||
spec: | ||
template: | ||
metadata: | ||
name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
spec: | ||
serviceAccountName: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
restartPolicy: {{ .Values.hookRestartPolicy }} | ||
containers: | ||
- name: {{ template "kubevirt.crdUninstallHook.name" . }} | ||
image: {{ .Values.hookImage }} | ||
args: | ||
- delete | ||
- customresourcedefinitions | ||
- kubevirts.kubevirt.io | ||
securityContext: | ||
{{- toYaml .Values.hookSecurityContext | nindent 12 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{{- if .Values.hooksEnabled.crd.upgrade }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: kubevirt-crd-manifest | ||
{{ template "kubevirt.crdUpgradeHook.annotations" (dict "hookWeight" 1) }} | ||
data: | ||
crd: |- | ||
{{ $.Files.Get "crds/kubevirt.yaml" | nindent 4 }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
{{ template "kubevirt.crdUpgradeHook.annotations" (dict "hookWeight" 2) }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
{{ template "kubevirt.crdUpgradeHook.annotations" (dict "hookWeight" 2) }} | ||
rules: | ||
- apiGroups: [ "" ] | ||
resources: [ "configmaps" ] | ||
resourceNames: | ||
- "kubevirt-crd-manifest" | ||
verbs: [ "get" ] | ||
- apiGroups: [ "apiextensions.k8s.io" ] | ||
resources: [ "customresourcedefinitions" ] | ||
resourceNames: | ||
- "kubevirts.kubevirt.io" | ||
verbs: [ "get", "patch" ] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
{{ template "kubevirt.crdUpgradeHook.annotations" (dict "hookWeight" 3) }} | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
{{ template "kubevirt.crdUpgradeHook.annotations" (dict "hookWeight" 4) }} | ||
spec: | ||
template: | ||
metadata: | ||
name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
spec: | ||
serviceAccountName: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
restartPolicy: {{ .Values.hookRestartPolicy }} | ||
containers: | ||
- name: {{ template "kubevirt.crdUpgradeHook.name" . }} | ||
securityContext: | ||
{{- toYaml .Values.hookSecurityContext | nindent 12 }} | ||
image: {{ .Values.hookImage }} | ||
args: | ||
- apply | ||
- -f | ||
- /etc/manifests/crd.yaml | ||
volumeMounts: | ||
- name: crd-volume | ||
mountPath: /etc/manifests | ||
volumes: | ||
- name: crd-volume | ||
configMap: | ||
name: kubevirt-crd-manifest | ||
items: | ||
- key: crd | ||
path: crd.yaml | ||
{{- end }} |
Oops, something went wrong.