From ab9fe94d5333edc6d269f7fe2b1cd32fe4a98d3a Mon Sep 17 00:00:00 2001 From: Jake Yip Date: Fri, 11 Nov 2022 23:42:33 +1100 Subject: [PATCH] Remove user docs for Cluster Type Definition ClusterType Template has been moved to Drivers since Change I17ba94b0e2000486b5fcbf792991ad98183bd26c. There is no longer any need to manage drivers since they are now loaded automatically now. Also removed deprecated config option. Change-Id: Ie72180b903c0c13b2291482516829bf7d340dd79 --- contrib/templates/example/README.rst | 10 -- doc/source/contributor/quickstart.rst | 3 - doc/source/user/cluster-type-definition.rst | 105 -------------------- doc/source/user/index.rst | 6 -- magnum/conf/cluster.py | 10 -- 5 files changed, 134 deletions(-) delete mode 100644 contrib/templates/example/README.rst delete mode 100644 doc/source/user/cluster-type-definition.rst diff --git a/contrib/templates/example/README.rst b/contrib/templates/example/README.rst deleted file mode 100644 index b20dd67f3f..0000000000 --- a/contrib/templates/example/README.rst +++ /dev/null @@ -1,10 +0,0 @@ -======================== -Example Cluster Template -======================== - -The purpose of this example template is to demonstrate working with cluster -templates using magnum service. -The Heat template used in this example (example.yaml) provisions a single -server instance and does not produce a usable cluster. - -See ``_ for instructions. diff --git a/doc/source/contributor/quickstart.rst b/doc/source/contributor/quickstart.rst index d28f28e15e..3604dc8b7d 100644 --- a/doc/source/contributor/quickstart.rst +++ b/doc/source/contributor/quickstart.rst @@ -83,9 +83,6 @@ To run unit test coverage and check percentage of code covered:: tox -e cover -To discover and interact with templates, please refer to -:doc:`/user/cluster-type-definition`. - Exercising the Services Using DevStack ====================================== diff --git a/doc/source/user/cluster-type-definition.rst b/doc/source/user/cluster-type-definition.rst deleted file mode 100644 index f25e2e826f..0000000000 --- a/doc/source/user/cluster-type-definition.rst +++ /dev/null @@ -1,105 +0,0 @@ -There are three key pieces to a Cluster Type Definition: - -1. Heat Stack template - The HOT file that Magnum will use to generate a - cluster using a Heat Stack. -2. Template definition - Magnum's interface for interacting with the Heat - template. -3. Definition Entry Point - Used to advertise the available Cluster Types. - -The Heat Stack Template ------------------------ - -The Heat Stack Template is where most of the real work happens. The result of -the Heat Stack Template should be a full Container Orchestration Environment. - -The Template Definition ------------------------ - -Template definitions are a mapping of Magnum object attributes and Heat -template parameters, along with Magnum consumable template outputs. A -Cluster Type Definition indicates which Cluster Types it can provide. -Cluster Types are how Magnum determines which of the enabled Cluster -Type Definitions it will use for a given cluster. - -The Definition Entry Point --------------------------- - -Entry points are a standard discovery and import mechanism for Python objects. -Each Template Definition should have an Entry Point in the -`magnum.template_definitions` group. This example exposes it's Template -Definition as `example_template = example_template:ExampleTemplate` in the -`magnum.template_definitions` group. - -Installing Cluster Templates ----------------------------- - -Because Cluster Type Definitions are basically Python projects, they can be -worked with like any other Python project. They can be cloned from version -control and installed or uploaded to a package index and installed via -utilities such as pip. - -Enabling a Cluster Type is as simple as adding it's Entry Point to the -`enabled_definitions` config option in magnum.conf.:: - - # Setup python environment and install Magnum - - $ virtualenv .venv - $ . .venv/bin/active - (.venv)$ git clone https://opendev.org/openstack/magnum - (.venv)$ cd magnum - (.venv)$ python setup.py install - - # List installed templates, notice default templates are enabled - - (.venv)$ magnum-template-manage list-templates - Enabled Templates - magnum_vm_atomic_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster.yaml - magnum_vm_coreos_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster-coreos.yaml - Disabled Templates - - # Install example template - - (.venv)$ cd contrib/templates/example - (.venv)$ python setup.py install - - # List installed templates, notice example template is disabled - - (.venv)$ magnum-template-manage list-templates - Enabled Templates - magnum_vm_atomic_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster.yaml - magnum_vm_coreos_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster-coreos.yaml - Disabled Templates - example_template: /home/example/.venv/local/lib/python2.7/site-packages/ExampleTemplate-0.1-py2.7.egg/example_template/example.yaml - - # Enable example template by setting enabled_definitions in magnum.conf - - (.venv)$ sudo mkdir /etc/magnum - (.venv)$ sudo bash -c "cat > /etc/magnum/magnum.conf << END_CONF - [bay] - enabled_definitions=magnum_vm_atomic_k8s,magnum_vm_coreos_k8s,example_template - END_CONF" - - # List installed templates, notice example template is now enabled - - (.venv)$ magnum-template-manage list-templates - Enabled Templates - example_template: /home/example/.venv/local/lib/python2.7/site-packages/ExampleTemplate-0.1-py2.7.egg/example_template/example.yaml - magnum_vm_atomic_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster.yaml - magnum_vm_coreos_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster-coreos.yaml - Disabled Templates - - # Use --details argument to get more details about each template - - (.venv)$ magnum-template-manage list-templates --details - Enabled Templates - example_template: /home/example/.venv/local/lib/python2.7/site-packages/ExampleTemplate-0.1-py2.7.egg/example_template/example.yaml - Server_Type OS CoE - vm example example_coe - magnum_vm_atomic_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster.yaml - Server_Type OS CoE - vm fedora-atomic kubernetes - magnum_vm_coreos_k8s: /home/example/.venv/local/lib/python2.7/site-packages/magnum/templates/kubernetes/kubecluster-coreos.yaml - Server_Type OS CoE - vm coreos kubernetes - Disabled Templates - diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst index 235454f806..a54439af6f 100644 --- a/doc/source/user/index.rst +++ b/doc/source/user/index.rst @@ -17,7 +17,6 @@ created and managed by Magnum to support the COE's. #. `Python Client`_ #. `Horizon Interface`_ #. `Cluster Drivers`_ -#. `Cluster Type Definition`_ #. `Heat Stack Templates`_ #. `Choosing a COE`_ #. `Native Clients`_ @@ -948,11 +947,6 @@ Installing a cluster driver *To be filled in* -Cluster Type Definition -======================= - -.. include:: cluster-type-definition.rst - Heat Stack Templates ==================== diff --git a/magnum/conf/cluster.py b/magnum/conf/cluster.py index f16fe407ca..d5d00af1ea 100644 --- a/magnum/conf/cluster.py +++ b/magnum/conf/cluster.py @@ -22,16 +22,6 @@ cluster_def_opts = [ default='https://discovery.etcd.io/new?size=%(size)d', help=_('Url for etcd public discovery endpoint.'), deprecated_group='bay'), - cfg.ListOpt('enabled_definitions', - deprecated_for_removal=True, - deprecated_reason=_('This configuration option is no longer ' - 'used. Installing a new driver enables ' - 'it for use automatically.'), - default=['magnum_vm_atomic_k8s', 'magnum_bm_fedora_k8s', - 'magnum_vm_coreos_k8s', 'magnum_vm_atomic_swarm', - 'magnum_vm_ubuntu_mesos'], - help=_('Enabled cluster definition entry points.'), - deprecated_group='bay'), cfg.StrOpt('nodes_affinity_policy', default='soft-anti-affinity', help=_('Affinity policy for server group of cluster nodes. '