From e35a0fe1bfef5fb8674b9881b44b731017453f1c Mon Sep 17 00:00:00 2001 From: Samuel Walladge Date: Mon, 15 Aug 2022 15:22:11 +0930 Subject: [PATCH] Add some docs and tips Change-Id: I40daa85f7e26b498049ea4befc3e9b3bd779d607 --- ops-sunbeam/doc/deploy-sunbeam-charms.rst | 26 +++----------- .../doc/troubleshooting-sunbeam-deployment.md | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 ops-sunbeam/doc/troubleshooting-sunbeam-deployment.md diff --git a/ops-sunbeam/doc/deploy-sunbeam-charms.rst b/ops-sunbeam/doc/deploy-sunbeam-charms.rst index c6db0202..36029329 100644 --- a/ops-sunbeam/doc/deploy-sunbeam-charms.rst +++ b/ops-sunbeam/doc/deploy-sunbeam-charms.rst @@ -57,7 +57,7 @@ Run below commands to install juju controller on microk8s Deploy Sunbeam charms ~~~~~~~~~~~~~~~~~~~~~ -Sample `sunbeam bundle`_ to deploy. +See ./reference-bundles.rst for information about example bundles available here. To use locally built charms, update the following in the bundle @@ -69,7 +69,7 @@ Run below commands to deploy the bundle .. code-block:: bash juju add-model sunbeam - juju deploy ./sunbeam.yaml --trust + juju deploy ./doc/bundles/full.yaml --trust Check ``juju status`` and wait for all units to be active. @@ -82,27 +82,12 @@ Testing OpenStack Control plane sudo snap install openstackclients --channel xena/stable -2. Setup novarc file - -a. Get keystone service ip +2. Generate and source the openrc file. (This example requires ``jq`` to be installed.) .. code-block:: bash - juju status keystone | grep keystone-k8s | awk '{print $6}' - - -b. Update sample novarc file with proper OS_AUTH_URL - -.. code-block:: bash - - export OS_AUTH_VERSION=3 - export OS_AUTH_URL=http://10.152.183.109:5000/v3 - export OS_PROJECT_DOMAIN_NAME=admin_domain - export OS_USERNAME=admin - export OS_USER_DOMAIN_NAME=admin_domain - export OS_PROJECT_NAME=admin - export OS_PASSWORD=abc123 - export OS_IDENTITY_API_VERSION=3 + juju run-action --wait keystone/leader get-admin-account --format json | jq -r '.[].results.openrc' > openrc + source ./openrc 3. Run some openstack commands @@ -115,4 +100,3 @@ support bringing up ovn-controller. .. _`juju with microk8s cloud`: https://juju.is/docs/olm/microk8s -.. _`sunbeam bundle`: https://opendev.org/openstack/charm-ops-sunbeam/src/branch/main/doc/sunbeam.yaml diff --git a/ops-sunbeam/doc/troubleshooting-sunbeam-deployment.md b/ops-sunbeam/doc/troubleshooting-sunbeam-deployment.md new file mode 100644 index 00000000..20548892 --- /dev/null +++ b/ops-sunbeam/doc/troubleshooting-sunbeam-deployment.md @@ -0,0 +1,36 @@ +Some miscellaneous debugging notes. + +## stuck on ``waiting ... installing agent``. + +If many units are stuck in waiting status at the installing agent step, +and traefik charms have the status message "gateway address unavailable", +then check that the k8s undercloud has a form of ingress enabled. + +An easy way to enable ingress with microk8s +is to enable metallb, and give it a block of ip addresses. +Currently these ip addresses aren't used for anything with sunbeam, +so it doesn't matter what you use. +A simple option is to pick a small range on your current LAN for example. + + +## Accessing remote microk8s + +If you have microk8s running on a remote server, +and you want to access it from juju and the openstack client locally, +here are some guidelines. + +1. Run `microk8s.config` on the remote server. +2. Copy the output to `~/.kube/config` on your local machine (so we now have credentials). +3. Edit `~/.kube/config` and update the server url/ip to point to the remote server. +4. Check firewall rules on the remote server to ensure you'll have access to the k8s and openstack ports. +5. Add a standard k8s cluster to your local juju client: `juju add-k8s my-microk8s` +6. At this point the k8s cloud is registered and you can deploy bundles with juju. +7. To access the sunbeam openstack you will need some kind of routing though. + `sshuttle` is a useful and simple tool to achieve this. Try `sshuttle -r `. + Eg. `sshuttle -r ubuntu@192.168.1.103 10.152.0.0/16`, assuming that 10.152.0.0/16 is the local subnet on the remote server allocated to microk8s pods. + + +## Cannot launch openstack instances. + +It's a known issue that currently it's impossible to launch instances with the sunbeam openstack. +Most other things should work though.