diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4dcb3ede78920be4fb2232bd88171aac543073cf --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# OpenAppStack bootstrap script + +This collection of scripts allows you to easily set up a new OpenAppStack cluster. + +As part of the bootstrap process a special control shell is installed (in the form of +a Docker image) which contains utilities to manage your cluster. + +## Prerequisites + +We assume a single-node setup for now. + +You need to have ssh access to the root account of the machine that will run +your cluster. + +## Bootstrapping a new cluster + +To run the bootstrap process: + +``` +./bootstrap $SERVER_IP +``` + +where `$SERVER_IP` is the ip address of the machine. (This address will also be +stored in the cluster configuration and is used by the Traefik ingress +controller, so even though using a domain name instead of an ip address may +work at first, that is not recommended.) + +The bootstrap script will fire up your text editor to let you specify some +basic configuration parameters that are needed to set up your cluster. When +you're done editing, save and exit your editor, and the bootstrap process will +continue. + +## Managing an existing cluster + +The OpenAppStack project has created a special "control shell", a Docker +container that you can run to perform administrative tasks on your cluster. +Some programs that you can run from this shell: +* `kubectl` is the Kubernetes control program. For example, run + `kubectl get pod` to see a list of pods that currently exist in your cluster. + Run `kubectl --help` for help. +* `helm` is the "Kubernetes package manager". Use `helm ls` to see what apps are + installed in your cluster. You can also use it to perform manual upgrades; + see `helm --help`. +* `helmfile` is a high-level tool to manage your app installations. For example, + run `helmfile -e oas diff` to view the differences between what's currently + installed and what should be installed according to the OpenAppStack + installation plan. + +To start the control shell, run + +``` +./manage $SERVER_IP +``` + +where `$SERVER_IP` is the address of the machine running your cluster. diff --git a/bootstrap.sh b/bootstrap similarity index 76% rename from bootstrap.sh rename to bootstrap index 1ad6a54acb04a2558af2d1ddcb9a3dce3048fb90..9fdc7cc3bbc19983e8e65802dccbc96f6201dcb0 100755 --- a/bootstrap.sh +++ b/bootstrap @@ -10,20 +10,20 @@ fi prepareNode() { - ssh "root@${host}" "bash -s" -- "$host" <prepare-node.sh + ssh "root@${host}" "bash -s" -- "$host" <"scripts/prepare-node.sh" } getControl() { ssh "root@${host}" "bash -s" -- <get-control.sh - scp "./control-shell.sh" "root@${host}:/oas/bin/control-shell.sh" + scp "./scripts/control-shell.sh" "root@${host}:/oas/bin/control-shell.sh" } configure() { echo "You now need to edit some basic settings that apply to many" echo "applications." - cp "./local.yaml.template" "./local.yaml" + cp "./templates/local.yaml.template" "./local.yaml" sed -i "s/\$IP/${host}/" "./local.yaml" reconfigure } @@ -36,7 +36,7 @@ reconfigure() setup() { - ssh -t "root@${host}" "CONTROL=bootstrap /bin/bash --init-file /oas/bin/control-shell.sh" + ssh -t "root@${host}" "CONTROL=bootstrap /bin/bash --init-file /oas/bin/control-shell.sh -c exit" } # No specific phase given, so just do everything that's necessary. diff --git a/control.sh b/manage similarity index 100% rename from control.sh rename to manage diff --git a/control-shell.sh b/scripts/control-shell.sh similarity index 100% rename from control-shell.sh rename to scripts/control-shell.sh diff --git a/prepare-node.sh b/scripts/prepare-node.sh similarity index 100% rename from prepare-node.sh rename to scripts/prepare-node.sh diff --git a/local.yaml.template b/templates/local.yaml.template similarity index 100% rename from local.yaml.template rename to templates/local.yaml.template