Initial setup

This commit is contained in:
Knut Ahlers 2022-12-17 01:05:27 +01:00
commit 3650886da2
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
5 changed files with 133 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
config.json

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "alpine-on-hetzner"]
path = alpine-on-hetzner
url = https://github.com/MathiasPius/alpine-on-hetzner.git

29
Makefile Normal file
View file

@ -0,0 +1,29 @@
ALPINE_VERSION:=3.17.0
PACKER_VERSION:=1.8.4-r2
ANSIBLE_CORE_VERSION:=2.13.6-r0
JQ_VERSION:=1.6-r2
export DOCKER_BUILDKIT:=1
default:
config.json:
yq -S . config.yaml >config.json
create-snapshot: docker-build config.json
envrun -- docker run --rm -i \
-e "HCLOUD_TOKEN" \
-v "$(CURDIR):/config:ro" \
registry.local/alpine-on-hetzner:latest \
/config/config.json
docker-build:
docker build \
--build-arg ALPINE_VERSION=$(ALPINE_VERSION) \
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
--build-arg ANSIBLE_CORE_VERSION=$(ANSIBLE_CORE_VERSION) \
--build-arg JQ_VERSION=$(JQ_VERSION) \
-t registry.local/alpine-on-hetzner \
./alpine-on-hetzner
.PHONY: config.json

1
alpine-on-hetzner Submodule

@ -0,0 +1 @@
Subproject commit 1d21f3e35c65bcef267c0f98144d3e5d4ab3c4a3

99
config.yaml Normal file
View file

@ -0,0 +1,99 @@
---
apk_tools_version: v2.12.10
apk_tools_arch: x86_64
apk_tools_url: https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic//{{ apk_tools_version }}/{{ apk_tools_arch }}/apk.static
apk_tools_checksum: sha256:d7506bb11327b337960910daffed75aa289d8bb350feab624c52965be82ceae8
alpine_version: edge
alpine_mirror: http://dl-cdn.alpinelinux.org/alpine
alpine_repositories: [ main, community, testing ]
boot_size: +100m
root_size: '0'
hostname: alpine-k8s
packages:
# Alpine base system
openssh: ''
syslinux: ''
linux-virt: ''
cloud-init: '@community'
# K8s requirements
open-iscsi: ''
open-iscsi-openrc: ''
cni-plugin-flannel: '@community'
cni-plugins: '@community'
flannel: '@testing'
flannel-contrib-cni: '@testing'
docker: '@community'
uuidgen: ''
nfs-utils: ''
kubelet: '@testing=1.25.0-r4'
kubeadm: '@testing=1.25.0-r4'
kubectl: '@testing=1.25.0-r4'
services:
devfs: sysinit
dmesg: sysinit
mdev: sysinit
hwdrivers: sysinit
hwclock: boot
modules: boot
sysctl: boot
hostname: boot
bootmisc: boot
syslog: boot
networking: boot
mount-ro: shutdown
killprocs: shutdown
savecache: shutdown
sshd: default
# K8s requirements
docker: default
iscsid: default
kubelet: default
ntpd: default
nameservers:
- 185.12.64.1
- 185.12.64.2
- 2a01:4ff:ff00::add:1
- 2a01:4ff:ff00::add:2
sysctl: {}
extlinux_modules:
- ext4
kernel_features:
- base
- ext4
- keymap
- virtio
kernel_modules:
- ipv6
- af_packet
default_kernel_opts:
- quiet
chroot_commands:
# kernel stuff
- 'echo "br_netfilter" >/etc/modules-load.d/k8s.conf'
- 'echo "net.bridge.bridge-nf-call-iptables=1" >>/etc/sysctl.conf'
# Fix prometheus errors
- 'echo -e "#!/bin/sh\nmount --make-rshared /" >/etc/local.d/sharemetrics.start'
- 'chmod +x /etc/local.d/sharemetrics.start'
- 'rc-update add local'
...