From 6f1523fa41721d335837a5b0a7ae7d77c0d89010 Mon Sep 17 00:00:00 2001 From: Guillaume Philippon <guillaume.philippon@ijclab.in2p3.fr> Date: Wed, 1 May 2024 11:18:32 +0200 Subject: [PATCH] docs: add magnum documentation --- docs/openstack-magnum.md | 72 ++++++++++++++++++++++++++++++++++++++++ mkdocs.yaml | 1 + 2 files changed, 73 insertions(+) create mode 100644 docs/openstack-magnum.md diff --git a/docs/openstack-magnum.md b/docs/openstack-magnum.md new file mode 100644 index 0000000..4c11680 --- /dev/null +++ b/docs/openstack-magnum.md @@ -0,0 +1,72 @@ +# k8s provisioning with OpenStack + +Cloud@VirtualData host a specific OpenStack service dedicated to deploy container +infrastructure as kubernetes. VirtualData also provide some generic cluster template. + +## Basic requirement + +You have to configuration your OpenStack CLI has described on dedicated section. +The example are based on this configuration, if you have some specific configuration +you have to adapt. + +## Official documentation + +[OpenStack magnum](https://wiki.openstack.org/wiki/Magnum) official +documentation is available on [here](https://docs.openstack.org/magnum/latest/user/index.html) + +## Installation + +### On Mac OS + +```shell +$ source ~/.venv/openstack-cli/bin/activate +(openstack-cli) $ pip install python-magnumclient +``` + +## Quick start + +### Available template + +Cloud@VirtualData provide a list of generic k8s template, you can list them +with the command. For this documentation, we will use `k8s-1.23-coreos35-lb`. + +```shell +$ openstack coe cluster template list \ + --os-cloud virtualdata ++--------------------------------------+-----------------------+------+ +| uuid | name | tags | ++--------------------------------------+-----------------------+------+ +| 347771b8-51b6-4a11-bbe3-b2175c9b8340 | k8s-1.21.14-coreos32 | None | +| d0a94f3a-bd06-41ca-b387-eb84d6d83b44 | k8s-1.23-coreos35 | None | +| 6b5f28c2-3b9c-4792-bb49-82b33b183ade | k8s-1.23-coreos35-lb | None | ++--------------------------------------+-----------------------+------+ +``` + +### Start a cluster + +```shell +$ openstack coe cluster create \ + --os-cloud virtualdata \ + --cluster-template k8s-1.23-coreos35-lb \ + --master-count 2 \ + --node-count 2 \ + k8s +$ openstack coe cluster list --os-cloud virtualdata ++----------+------+---------+-------+-------+-----------------+---------------+ +| uuid | name | keypair | [...] | [...] | status | health_status | ++----------+------+---------+-------+-------+-----------------+---------------+ +| 06b[...] | k8s | vd-key | 1 | 2 | UPDATE_COMPLETE | HEALTHY | ++----------+------+---------+-------+-------+-----------------+---------------+ +``` + +### Retrieve k8s configuration + +```shell +$ mkdir -p ~/k8s +$ openstack coe cluster config k8s \ + --os-cloud virtualdata \ + --dir ~/k8s +export KUBECONFIG=/<home-dir>/k8s/config +$ ls ~/k8S +config +``` diff --git a/mkdocs.yaml b/mkdocs.yaml index bbed778..5908b56 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -16,6 +16,7 @@ remote_branch: main nav: - Home: index.md + - k8s provisioning: openstack-magnum.md theme: name: readthedocs -- GitLab