diff --git a/Makefile b/Makefile index a044e72..31fb38d 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,9 @@ kubernetes.install: $(OCTOPUS_TOOL) export ROOK_SYSTEM_NAMESPACE ?= rook-ceph export ROOK_NAMESPACE ?= rook-ceph include scripts/rook/Makefile +.PHONY: rook +rook: + @ $(MAKE) rook.help ## diff --git a/README.md b/README.md index 2814b6e..21bdfaf 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,14 @@ Prerequisites ### Known dependencies - bash - curl + - docker - libvirt-client - libvirt-daemon - libvirt-daemon-qemu - libvirt-python - https://pypi.org/project/libvirt-python/ + - kubectl - python3 + - python3-PyYAML - qemu - qemu-kvm - jq diff --git a/_default-dev-settings b/_default-dev-settings index 6c9f2b6..477dedf 100644 --- a/_default-dev-settings +++ b/_default-dev-settings @@ -6,7 +6,8 @@ # Prevent cluster collisions in shared environments with a resource name prefix # Can safely be commented-out for local libvirt use -export CLUSTER_PREFIX="$USER-" +export USER=$(whoami || echo "default-user") +export CLUSTER_PREFIX="${USER}-" # Number of Kubernetes master and worker nodes to create for the dev cluster # One-node clusters should be a single master with no workers. diff --git a/developer-settings b/developer-settings index 23fe486..88faef0 100644 --- a/developer-settings +++ b/developer-settings @@ -1,6 +1,7 @@ #!/usr/bin/env bash -source _default-dev-settings +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SCRIPT_DIR}/_default-dev-settings" # Add your own overrides to the default-dev-settings here # examples: diff --git a/scripts/libvirt/setup.py b/scripts/libvirt/setup.py index d156f30..39d29a1 100644 --- a/scripts/libvirt/setup.py +++ b/scripts/libvirt/setup.py @@ -25,6 +25,11 @@ # networks # +if CLUSTER_PREFIX.startswith('-'): + # libvirt dnsmasq does not allow the domain to start with a '-' char + print("CLUSTER_PREFIX cannot start with a '-' char", file=sys.stderr) + exit(1) + FULL_NET_DOMAIN_NAME = CLUSTER_PREFIX + NET_DOMAIN_NAME k8sNet = network.LvmNetwork( # k8s network / main network diff --git a/scripts/libvirt/variables.py b/scripts/libvirt/variables.py index cb17647..6a254a2 100644 --- a/scripts/libvirt/variables.py +++ b/scripts/libvirt/variables.py @@ -6,7 +6,7 @@ # # this can be set to allow multiple clusters on one URI without collisions -CLUSTER_PREFIX = os.getenv("CLUSTER_PREFIX", "") +CLUSTER_PREFIX = os.getenv("CLUSTER_PREFIX", os.getlogin() + '-') LIBVIRT_URI = os.getenv("LIBVIRT_URI", "qemu:///system") LIBVIRT_IMAGE_DOWNLOAD_POOL = os.getenv("LIBVIRT_IMAGE_DOWNLOAD_POOL", "default") diff --git a/scripts/rook/Makefile b/scripts/rook/Makefile index 618c741..200e3f4 100644 --- a/scripts/rook/Makefile +++ b/scripts/rook/Makefile @@ -134,7 +134,7 @@ rook.uninstall: rook.config-branch-file.% @ $(MAKE) rook.showinfo @ $(BASH) scripts/resources/success-message.sh "ROOK UN-INSTALLED" -## rook.show-info Print info about the current Rook install/config. +## rook.showinfo Print info about the current Rook install/config. rook.showinfo: @ echo '' @ $(MAKE) rook.print-config-branch.% @@ -186,7 +186,7 @@ rook.dashboard-fwd: rook.restart-operator: @ $(BASH) scripts/rook/restart-operator.sh -## rook.watch-pods Watch Rook pods with `watch` +## rook.watch-pods Watch Rook pods with ${CMD}watch${NON} rook.watch-pods: @ watch --no-title kubectl --namespace $(ROOK_NAMESPACE) get pods