From db41dbac72eb690ff81232073e79b7551ec43d79 Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Tue, 26 Dec 2017 15:13:42 +0200 Subject: [PATCH 1/5] Simplify minishift addon instruction - Use fixed dir also used by `minishift addons install --defaults` - Use gist URL that works both for git clone and browser. --- providers/openshift.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/providers/openshift.md b/providers/openshift.md index 4f917eab..07bf1c4f 100644 --- a/providers/openshift.md +++ b/providers/openshift.md @@ -83,23 +83,12 @@ will assume that is being used, and updates to some commands might be necessary (most commands should be virtualization software agnostic and work regardless of the hypervisor). -1. Download the manageiq.addon for minishift to a directory of your choosing: +1. Download and enable the manageiq addon for minishift: ```console - - $ git clone https://gist.github.com/e2fac8be87ea0e9f429b6f5d75e02176.git path/to/minishift-addons/manageiq - ``` - - You can inspect the addon here: - - https://gist.github.com/NickLaMuro/e2fac8be87ea0e9f429b6f5d75e02176 - - It is recommended to keep a directory of your addons in one place. - -2. Add and enable the manageiq addon to minishift: - - ```console - $ minishift addons install --force path/to/minishift-addons/manageiq + $ mkdir -p ~/minishift/addons + $ git clone https://gist.github.com/e2fac8be87ea0e9f429b6f5d75e02176 ~/minishift/addons/manageiq + $ minishift addons install --force ~/minishift/addons/manageiq $ minishift addons enable manageiq ``` From 81e3a134ff56b5b6578949dd3a13f574d7e0b74d Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Tue, 26 Dec 2017 15:15:47 +0200 Subject: [PATCH 2/5] minishift: Simpler instructions to run `oc` --- providers/openshift.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/providers/openshift.md b/providers/openshift.md index 07bf1c4f..a7b77bc1 100644 --- a/providers/openshift.md +++ b/providers/openshift.md @@ -92,29 +92,30 @@ regardless of the hypervisor). $ minishift addons enable manageiq ``` -3. Start minishift: +2. Start minishift: ```console $ minishift start --vm-driver virtualbox --openshift-version "v1.5.0-rc.0" ``` -4. Grab the minishift IP: +3. Grab the minishift IP: ```console $ minishift ip ``` -5. Grab the token to access openshift through `manageiq`: +4. Add `oc` and/or `docker` to your PATH, configured to the cluster (auto-detects correct shell): ```console - $ ~/.minishift/cache/oc/v1.5.0-rc.0/oc login -u system:admin - $ ~/.minishift/cache/oc/v1.5.0-rc.0/oc sa get-token -n management-infra management-admin + $ eval $(minishift oc-env) + $ eval $(minishift docker-env) ``` - Or in a single command form: +5. Grab the token to access openshift through `manageiq`: ```console - $ (export PATH="~/.minishift/cache/oc/v1.5.0-rc.0/:$PATH"; oc login -u system:admin > /dev/null; oc sa get-token -n management-infra management-admin) + $ oc login -u system:admin + $ oc sa get-token -n management-infra management-admin ``` 6. Configure a provider in ManageIQ, filling in your token and IP where From 1f06a6d9170d4e152bdffc37ed1dc45cf4ce4b1b Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Tue, 26 Dec 2017 15:16:28 +0200 Subject: [PATCH 3/5] Document VCR-recording script https://github.com/ManageIQ/manageiq-providers-openshift/pull/75 --- providers/openshift.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/providers/openshift.md b/providers/openshift.md index a7b77bc1..8b6f8b6c 100644 --- a/providers/openshift.md +++ b/providers/openshift.md @@ -98,6 +98,10 @@ regardless of the hypervisor). $ minishift start --vm-driver virtualbox --openshift-version "v1.5.0-rc.0" ``` + You might want to add `--metrics --memory 5G`. As of this writing that only supports hawkular and doesn't work on 3.7.0. + + See https://hub.docker.com/r/openshift/origin/tags/ for possible versions. + 3. Grab the minishift IP: ```console @@ -131,3 +135,29 @@ regardless of the hypervisor). ``` Or through the UI if you prefer. + +### Automated script to record new VCR + +https://github.com/ManageIQ/manageiq-providers-openshift/pull/75 added a script that creates things from template, records 1st vcr, deletes some things, records 2nd. + +Currently if you want to copy VCR to manageiq-providers-kubernetes, the spec there assumes Hawkular metrics were running. + +- Easiest to use script with minishift. + Have `minishift` in your PATH. + As described above, including manageiq addon, and `--metrics --memory 5G`. + Wait for metrics to start, as confirmed by: + ```console + oc get pods -n openshift-infra + ``` +- Alternatively bring your own openshift, with metrics. + Set `OPENSHIFT_MASTER_HOST` env var. + Perform `oc login` as a user having `cluster-admin` role. + +Then run in manageiq-providers-openshift repo: +``` +./spec/vcr_cassettes/manageiq/providers/openshift/container_manager/test_objects_record.sh +``` + +You may need to adjust specs if object counts and/or names changed (ideally, figure out why and how to make it more reproducible). + +There are text files near the .yml files that help tracking what changed vs previous VCRs, commit them together. From 9f23aeec2efbabd6764d591fb6a0b1bf9414f308 Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Thu, 11 Jan 2018 13:23:44 +0200 Subject: [PATCH 4/5] more realistic openshift version in example --- providers/openshift.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/openshift.md b/providers/openshift.md index 8b6f8b6c..9dc33bc2 100644 --- a/providers/openshift.md +++ b/providers/openshift.md @@ -95,7 +95,7 @@ regardless of the hypervisor). 2. Start minishift: ```console - $ minishift start --vm-driver virtualbox --openshift-version "v1.5.0-rc.0" + $ minishift start --vm-driver virtualbox --openshift-version "v3.6.1" ``` You might want to add `--metrics --memory 5G`. As of this writing that only supports hawkular and doesn't work on 3.7.0. From fa09b06f2f670faf349153484bc97050c7d9a87c Mon Sep 17 00:00:00 2001 From: Beni Cherniavsky-Paskin Date: Mon, 29 Jan 2018 15:39:15 +0200 Subject: [PATCH 5/5] VCR recording: metrics no longer needed Since https://github.com/ManageIQ/manageiq-providers-openshift/pull/83. --- providers/openshift.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/providers/openshift.md b/providers/openshift.md index 9dc33bc2..679ed2ab 100644 --- a/providers/openshift.md +++ b/providers/openshift.md @@ -144,12 +144,9 @@ Currently if you want to copy VCR to manageiq-providers-kubernetes, the spec the - Easiest to use script with minishift. Have `minishift` in your PATH. - As described above, including manageiq addon, and `--metrics --memory 5G`. - Wait for metrics to start, as confirmed by: - ```console - oc get pods -n openshift-infra - ``` -- Alternatively bring your own openshift, with metrics. + As described above, including manageiq addon. Don't need `--metrics`. + +- Alternatively bring your own openshift. Set `OPENSHIFT_MASTER_HOST` env var. Perform `oc login` as a user having `cluster-admin` role.