This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kubevirt-disk-uploader.yaml
85 lines (85 loc) · 2.1 KB
/
kubevirt-disk-uploader.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubevirt-disk-uploader
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kubevirt-disk-uploader
rules:
- apiGroups: ["export.kubevirt.io"]
resources: ["virtualmachineexports"]
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubevirt-disk-uploader
subjects:
- kind: ServiceAccount
name: kubevirt-disk-uploader
roleRef:
kind: Role
name: kubevirt-disk-uploader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Pod
metadata:
name: kubevirt-disk-uploader
spec:
serviceAccountName: kubevirt-disk-uploader
containers:
- name: kubevirt-disk-uploader
image: quay.io/boukhano/kubevirt-disk-uploader:latest
imagePullPolicy: Always
env:
- name: ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: kubevirt-disk-uploader-credentials
key: accessKeyId
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: kubevirt-disk-uploader-credentials
key: secretKey
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
command: ["/usr/local/bin/kubevirt-disk-uploader"]
# args: ["--export-source-kind", "vm", "--export-source-name", "example-vm", "--volumename", "example-dv", "--imagedestination", "quay.io/boukhano/example-vm-exported:latest", "--pushtimeout", "120"]
resources:
requests:
memory: 3Gi
limits:
memory: 5Gi
volumeMounts:
- name: disk
mountPath: /tmp
volumes:
- name: disk
emptyDir: {}
restartPolicy: Never
---
apiVersion: v1
kind: Secret
metadata:
name: kubevirt-disk-uploader-credentials
type: Opaque
data:
accessKeyId: "<ACCESS_KEY_ID>"
secretKey: "<SECRET_KEY>"