forked from suse-edge/Factory
Add kubevirt-chart
Imported from https://github.com/suse-edge/charts/tree/main/charts/kubevirt/0.4.0
This commit is contained in:
71
kubevirt-chart/templates/kubevirt-uninstall-hooks.yaml
Normal file
71
kubevirt-chart/templates/kubevirt-uninstall-hooks.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
{{ template "kubevirt.crUninstallHook.annotations" (dict "hookWeight" 1) }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
{{ template "kubevirt.crUninstallHook.annotations" (dict "hookWeight" 1) }}
|
||||
rules:
|
||||
- apiGroups: [ "kubevirt.io" ]
|
||||
resources: [ "kubevirts" ]
|
||||
resourceNames:
|
||||
- "kubevirt"
|
||||
verbs: [ "get", "list", "delete" ]
|
||||
- apiGroups: [ "apps" ]
|
||||
resources: [ "deployments", "daemonsets" ]
|
||||
verbs: [ "get", "list" ]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
{{ template "kubevirt.crUninstallHook.annotations" (dict "hookWeight" 2) }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
{{ template "kubevirt.crUninstallHook.annotations" (dict "hookWeight" 3) }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
restartPolicy: {{ .Values.hookRestartPolicy }}
|
||||
containers:
|
||||
- name: {{ template "kubevirt.crUninstallHook.name" . }}
|
||||
image: {{ .Values.hookImage }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
|
||||
args:
|
||||
- delete
|
||||
- kubevirt
|
||||
- kubevirt
|
||||
- name: {{ template "kubevirt.crUninstallHook.name" . }}-cleanup
|
||||
image: {{ .Values.hookImage }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
|
||||
args:
|
||||
- wait
|
||||
- --for=delete
|
||||
- deployments/virt-api
|
||||
- deployments/virt-controller
|
||||
- daemonsets/virt-handler
|
||||
- --timeout=60s
|
Reference in New Issue
Block a user