@@ -5,14 +5,24 @@ set -euo pipefail
55# These are variables we likely will change
66# LC only supplies podman
77USERNETES_CONTAINER_TECH=${1:- " podman" }
8- USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-06-26-2025
8+ USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-dra
99
1010# We will copy join command here
1111shared_join_command_dir=" /usr/workspace/usernetes"
1212
1313# The user needs to run the setup script
1414USERNAME=$( whoami)
1515
16+ # Logging functions for consistency (like Akihiro!)
17+ log () {
18+ echo " $( date ' +%Y-%m-%d %H:%M:%S' ) - INFO - $1 "
19+ }
20+
21+ error_exit () {
22+ echo " $( date ' +%Y-%m-%d %H:%M:%S' ) - ERROR - $1 " >&2
23+ exit 1
24+ }
25+
1626# This is way a lot for just deriving home, but I'm not convinced it will always
1727# be defined in the environment
1828if [[ -z " ${HOME:- } " || ! -d " ${HOME} " ]]; then
@@ -37,16 +47,6 @@ which podman-compose
3747# We don't want to use /var because that is a memory based fs
3848export TMPDIR=" /tmp/${USERNAME} "
3949
40- # Logging functions for consistency (like Akihiro!)
41- log () {
42- echo " $( date ' +%Y-%m-%d %H:%M:%S' ) - INFO - $1 "
43- }
44-
45- error_exit () {
46- echo " $( date ' +%Y-%m-%d %H:%M:%S' ) - ERROR - $1 " >&2
47- exit 1
48- }
49-
5050install_kubectl () {
5151 if ! command -v kubectl > /dev/null; then
5252 log " Installing kubectl..."
@@ -131,6 +131,7 @@ sleep 3 # Allow filesystem operations to settle if needed
131131
132132log " 👷 Building Usernetes container image 'usernetes_node'"
133133${container_runtime_path} build --userns-uid-map=0:0:1 --userns-uid-map=1:1:1999 --userns-uid-map=65534:2000:2 -f $( pwd) /Dockerfile -t usernetes_node $( pwd)
134+ ${container_runtime_path} build --userns-uid-map=0:0:1 --userns-uid-map=1:1:1999 --userns-uid-map=65534:2000:2 -f $( pwd) /Dockerfile.dra -t usernetes_dra $( pwd)
134135
135136cleanup () {
136137 log " 🧹 Cleaning up old networks or volumes (best effort)"
@@ -150,12 +151,19 @@ if ! make up; then
150151fi
151152sleep 3
152153
154+
153155log " 🔐 Running kubeadm-init with 'make kubeadm-init'"
154156if ! make kubeadm-init; then
155157 error_exit " Failed 'make kubeadm-init'."
156158fi
157159sleep 3
158160
161+ log " 👾 Setting up dynamic resource allocation"
162+ if ! make dra; then
163+ error_exit " Failed 'make kubeadm-init'."
164+ fi
165+ sleep 3
166+
159167log " 🥷 Creating kubeconfig with 'make kubeconfig'"
160168if ! make kubeconfig; then
161169 error_exit " Failed 'make kubeconfig'."
@@ -171,6 +179,10 @@ chmod 600 "${KUBECONFIG}"
171179# source <(kubectl completion bash)
172180sleep 3
173181
182+ log " 🥷 Install rbac for dranet-driver"
183+ kubectl apply -f Makefile.d/dra/rbac.yaml
184+ ${container_runtime_path} restart dranet-driver
185+
174186# Get control plane node name robustly
175187log " 🍑 Untainting control plane and labeling node"
176188control_plane_node=" "
0 commit comments