-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzarf.yaml
113 lines (108 loc) · 3.79 KB
/
zarf.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json
kind: ZarfPackageConfig
metadata:
name: k3d-airgap
description: "Defense Unicorns K3D environment"
version: "###ZARF_PKG_TMPL_K3D_VERSION###"
# Big Bang / Iron Bank are only amd64
architecture: amd64
authors: "@kirankt"
source: https://github.com/defenseunicorns/zarf-package-k3d
vendor: Defense Unicorns
constants:
- name: K3D_VERSION
value: "###ZARF_PKG_TMPL_K3D_VERSION###"
- name: K3S_VERSION
value: "###ZARF_PKG_TMPL_K3S_VERSION###"
- name: K3S_GPU_IMAGE
value: "###ZARF_PKG_TMPL_K3S_GPU_IMAGE###"
variables:
- name: ENABLE_GPUS
default: "false"
- name: GPU_COUNT
default: "all"
- name: ENABLE_SERVICE_LB
default: "true"
- name: ENABLE_TRAEFIK
default: "true"
- name: ENABLE_METRICS_SERVER
default: "true"
- name: K3D_REGISTRY_PORT
default: "5000"
components:
- name: download-assets
required: true
files:
- source: https://github.com/k3d-io/k3d/releases/download/v###ZARF_PKG_TMPL_K3D_VERSION###/k3d-linux-amd64
target: k3d
executable: true
- source: https://github.com/k3s-io/k3s/releases/download/###ZARF_PKG_TMPL_K3S_VERSION###+k3s1/k3s-airgap-images-amd64.tar
target: k3s-airgap-images-amd64.tar
actions:
onCreate:
after:
- cmd: docker pull --platform linux/amd64 registry:2
- cmd: docker save registry:2 -o registry.tar
- cmd: docker pull --platform linux/amd64 rancher/k3s:###ZARF_PKG_TMPL_K3S_VERSION###-k3s1
- cmd: docker save rancher/k3s:###ZARF_PKG_TMPL_K3S_VERSION###-k3s1 -o k3s-###ZARF_PKG_TMPL_K3S_VERSION###.tar
- cmd: docker pull --platform linux/amd64 ghcr.io/k3d-io/k3d-proxy:###ZARF_PKG_TMPL_K3D_VERSION###
- cmd: docker save ghcr.io/k3d-io/k3d-proxy:###ZARF_PKG_TMPL_K3D_VERSION### -o k3d-proxy-###ZARF_PKG_TMPL_K3D_VERSION###.tar
- cmd: docker pull --platform linux/amd64 ghcr.io/k3d-io/k3d-tools:###ZARF_PKG_TMPL_K3D_VERSION###
- cmd: docker save ghcr.io/k3d-io/k3d-tools:###ZARF_PKG_TMPL_K3D_VERSION### -o k3d-tools-###ZARF_PKG_TMPL_K3D_VERSION###.tar
- cmd: docker pull --platform linux/amd64 "###ZARF_PKG_TMPL_K3S_GPU_IMAGE###"
- cmd: docker save "###ZARF_PKG_TMPL_K3S_GPU_IMAGE###" -o k3s-gpu.tar
- name: save-images
required: true
files:
- source: registry.tar
target: registry.tar
- source: k3s-###ZARF_PKG_TMPL_K3S_VERSION###.tar
target: k3s-image.tar
- source: k3d-proxy-###ZARF_PKG_TMPL_K3D_VERSION###.tar
target: k3d-proxy.tar
- source: k3d-tools-###ZARF_PKG_TMPL_K3D_VERSION###.tar
target: k3d-tools.tar
- source: k3s-gpu.tar
target: k3s-gpu.tar
actions:
onDeploy:
after:
- cmd: docker load -i registry.tar
- cmd: docker load -i k3s-image.tar
- cmd: docker load -i k3d-proxy.tar
- cmd: docker load -i k3d-tools.tar
- cmd: docker load -i k3s-gpu.tar
- cmd: docker load -i k3s-airgap-images-amd64.tar
- name: registry-sync
required: true
files:
- source: scripts/registry.sh
target: registry.sh
executable: true
actions:
onDeploy:
after:
- cmd: ./registry.sh
onRemove:
after:
- cmd: ./registry-uninstall.sh
- name: k3d
required: true
files:
- source: scripts/install.sh
target: install.sh
executable: true
- source: scripts/uninstall.sh
target: uninstall.sh
executable: true
- source: scripts/registry.yaml
target: registry.yaml
actions:
onDeploy:
after:
- cmd: ./install.sh
# This configmap creates issues when trying to execute `zarf init`
- cmd: ./zarf tools kubectl delete configmap local-registry-hosting -n kube-public
onRemove:
after:
- cmd: ./uninstall.sh