From 135f0e7dc74a984652d768b62914ff7ae1f55d58 Mon Sep 17 00:00:00 2001 From: Mark Burnett Date: Mon, 20 Nov 2017 09:05:29 -0600 Subject: [PATCH] Doc: Add brief getting started with API section Change-Id: I5bd0984bbdd65b7ca073d75de611499dab0ad906 --- docs/source/getting-started.rst | 60 ++++++++++++++++++- tools/dev-build.sh | 2 +- ...sic-deployment.sh => simple-deployment.sh} | 0 3 files changed, 60 insertions(+), 2 deletions(-) rename tools/{basic-deployment.sh => simple-deployment.sh} (100%) diff --git a/docs/source/getting-started.rst b/docs/source/getting-started.rst index 7753f7d2..30934e07 100644 --- a/docs/source/getting-started.rst +++ b/docs/source/getting-started.rst @@ -4,6 +4,9 @@ Getting Started Basic Deployment ---------------- +This approach is quick to get started, but generates the scripts used for +joining up-front rather than generating them in the API as needed. + Setup ^^^^^ @@ -12,7 +15,7 @@ you can use the following helper script: .. code-block:: bash - ./tools/basic-deployment.sh examples/basic build + ./tools/simple-deployment.sh examples/basic build This will copy the configuration provided in the ``examples/basic`` directory into the ``build`` directory. Then, it will generate self-signed certificates @@ -43,6 +46,61 @@ Perform the following steps to execute the deployment: ``validate-.sh`` scripts described above. +API-Driven Deployment +--------------------- + +This approach leverages the Promenade API to fetch join scripts as needed. +This is the approach used in the functional testing discussed below. + +Setup +^^^^^ + +Follow the setup instructions above for `Basic Deployment`_. Then, start a webserver to serve +configuration to Promenade. + +.. code-block:: bash + + cat build/*.yaml > promenade.yaml + mv promenade.yaml build/promenade.yaml + docker rm -fv promenade-nginx + docker run -d \ + -p 7777:80 \ + --restart=always \ + --name promenade-nginx \ + -v build:/usr/share/nginx/html:ro \ + nginx:stable + export DESIGN_REF=http://192.168.77.1:7777/promenade.yaml + +Execution +^^^^^^^^^ + +Perform the following steps to execute the deployment: + +1. Copy the ``genesis.sh`` script to the genesis node and run it. +2. Validate the genesis node by running ``validate-genesis.sh`` on it. +3. Generate join script for a node using: + + +.. code-block:: bash + + URL=http://promenade-api.ucp.svc.cluster.local/api/v1.0/join-scripts? + URL="${URL}design_ref=${DESIGN_REF}" + URL="${URL}&hostname=&ip=" + URL="${URL}&labels.dynamic=calico-etcd=enabled" + URL="${URL}&labels.dynamic=kubernetes-apiserver=enabled" + URL="${URL}&labels.dynamic=kubernetes-controller-manager=enabled" + URL="${URL}&labels.dynamic=kubernetes-etcd=enabled" + URL="${URL}&labels.dynamic=kubernetes-scheduler=enabled" + URL="${URL}&labels.dynamic=ucp-control-plane=enabled" + curl -Lo join-.sh "${URL}" + +4. Copy the join script to the node, and run it via ``bash join-.sh``. +5. Repeat 3 and 4 until all nodes are joined. +6. Reprovision the Genesis node by tearing it down as above in + `Basic Deployment`_, then generating and using a join script for it as done + in 3 and 4. + + Running Tests ------------- diff --git a/tools/dev-build.sh b/tools/dev-build.sh index 7565689b..1f253a73 100755 --- a/tools/dev-build.sh +++ b/tools/dev-build.sh @@ -10,4 +10,4 @@ docker build -t quay.io/attcomdev/promenade:latest ${SOURCE_DIR} export PROMENADE_DEBUG=${PROMENADE_DEBUG:-1} -exec $SCRIPT_DIR/basic-deployment.sh ${@} +exec $SCRIPT_DIR/simple-deployment.sh ${@} diff --git a/tools/basic-deployment.sh b/tools/simple-deployment.sh similarity index 100% rename from tools/basic-deployment.sh rename to tools/simple-deployment.sh