-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adopt embeds in favor of downloading content
- Loading branch information
1 parent
35d8661
commit 71a016c
Showing
7 changed files
with
142 additions
and
140 deletions.
There are no files selected for viewing
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
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
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,19 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: download-talos | ||
namespace: tink-system | ||
data: | ||
entrypoint.sh: |- | ||
#!/usr/bin/env bash | ||
# This script is designed to download specific Talos files required for an IPXE script to work. | ||
set -euxo pipefail | ||
if ! which wget &>/dev/null; then | ||
apk add --update wget | ||
fi | ||
base_url=$1 | ||
output_dir=$2 | ||
files=("initramfs-amd64.xz" "vmlinuz-amd64") | ||
for file in "${files[@]}"; do | ||
wget "${base_url}/${file}" -O "${output_dir}/${file}" | ||
done |
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,24 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: download-ubuntu-jammy | ||
namespace: tink-system | ||
data: | ||
entrypoint.sh: |- | ||
#!/usr/bin/env bash | ||
# This script is designed to download a cloud image file (.img) and then convert it to a .raw.gz file. | ||
# This is purpose built so non-raw cloud image files can be used with the "image2disk" action. | ||
# See https://artifacthub.io/packages/tbaction/tinkerbell-community/image2disk. | ||
set -euxo pipefail | ||
if ! which pigz qemu-img &>/dev/null; then | ||
apk add --update pigz qemu-img | ||
fi | ||
image_url=$1 | ||
file=$2/${image_url##*/} | ||
file=${file%.*}.raw.gz | ||
if [[ ! -f "$file" ]]; then | ||
wget "$image_url" -O image.img | ||
qemu-img convert -O raw image.img image.raw | ||
pigz <image.raw >"$file" | ||
rm -f image.img image.raw | ||
fi |
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,32 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: download-talos | ||
namespace: tink-system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: download-talos | ||
image: bash:5.2.2 | ||
command: ["/script/entrypoint.sh"] | ||
args: | ||
[ | ||
"https://github.com/siderolabs/talos/releases/download/v1.8.0", | ||
"/output", | ||
] | ||
volumeMounts: | ||
- mountPath: /output | ||
name: hook-artifacts | ||
- mountPath: /script | ||
name: configmap-volume | ||
restartPolicy: OnFailure | ||
volumes: | ||
- name: hook-artifacts | ||
hostPath: | ||
path: /opt/hook | ||
type: DirectoryOrCreate | ||
- name: configmap-volume | ||
configMap: | ||
defaultMode: 0700 | ||
name: download-talos |
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,32 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: download-ubuntu-jammy | ||
namespace: tink-system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: download-ubuntu-jammy | ||
image: bash:5.2.2 | ||
command: ["/script/entrypoint.sh"] | ||
args: | ||
[ | ||
"https://cloud-images.ubuntu.com/daily/server/jammy/current/jammy-server-cloudimg-amd64.img", | ||
"/output", | ||
] | ||
volumeMounts: | ||
- mountPath: /output | ||
name: hook-artifacts | ||
- mountPath: /script | ||
name: configmap-volume | ||
restartPolicy: OnFailure | ||
volumes: | ||
- name: hook-artifacts | ||
hostPath: | ||
path: /opt/hook | ||
type: DirectoryOrCreate | ||
- name: configmap-volume | ||
configMap: | ||
defaultMode: 0700 | ||
name: download-ubuntu-jammy |
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