Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tumbleweed/setup dev env #2

Merged
merged 6 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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


##
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion _default-dev-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want a default user. That could still encourage collisions. The intent is that with -u, this will fail if the USER env var is unset.

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.
Expand Down
3 changes: 2 additions & 1 deletion developer-settings
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
5 changes: 5 additions & 0 deletions scripts/libvirt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/libvirt/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions scripts/rook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.%
Expand Down Expand Up @@ -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

Expand Down