11# plugins
22
3+ ## What is plugin
4+
5+ Sealer provide plugin mechanism that allows users to run sealer image according to different plugin configurations.
6+
7+ This will bring the possibility of flexible configuration of any image default setting, any cluster node, any cluster
8+ startup stage, such as host disk initialization, cluster preflight ,status checker before or after cluster installation
9+ and so on.
10+
11+ At present, sealer only support the ` shell ` type plugins. it provides a shell operation entry that means user could
12+ execute any shell scripts on any node at any cluster launch stage. user only need to do is writing a yaml file which
13+ defined shell data and its scope to experience sealer plugin feature.
14+
315## Plugin Spec
416
517PluginSpec defines the desired state of Plugin
@@ -13,27 +25,33 @@ type PluginSpec struct {
1325}
1426```
1527
16- 1 . for ` PluginSpec.Type ` : plugin type,currently only supported "SHELL".
17- 2 . for ` PluginSpec.Data ` : plugin`s real data, sealer will use it to do actual action.
18- 3 . for ` PluginSpec.Scope ` : plugin`s scope, it is usually the role name, support use '|' to specify multiple scopes.
19- 4 . for ` PluginSpec.Action ` : phase of this plugin will run. below is the phase list we currently supported.
28+ * for ` PluginSpec.Type ` : plugin type,currently only supported "SHELL".
29+ * for ` PluginSpec.Data ` : plugin`s real data, sealer will use it to do actual action.
30+ * for ` PluginSpec.Scope ` : plugin`s scope, it is usually the role name, support use '|' to specify multiple scopes. if
31+ not set, default is all hosts excluding cluster type plugins.
32+ * for ` PluginSpec.Action ` : phase of this plugin will run. if action is ` host type ` ,will execute on ` PluginSpec.Scope `
33+ specified, if it is ` cluster type ` , only execute plugin at master0. below is the phase list we currently supported.
2034
2135plugin will be executed by ` PluginSpec.Name ` in alphabetical order at the same stage.
2236
23- The following is a detailed introduction for plugin action.
24-
25- | action name | action scope | explanation |
26- | :-----| ----: | :----: |
27- | pre-init-host | cluster host | will run before init cluster host |
28- | post-init-host | cluster host | will run after init cluster host |
29- | pre-clean-host | cluster host | will run before clean cluster host |
30- | post-clean-host | cluster host | will run after clean cluster host |
31- | pre-install | master0 | will run before install cluster |
32- | post-install | master0 | will run after install cluster |
33- | pre-uninstall | master0 | will run before uninstall cluster |
34- | post-uninstall | master0 | will run after uninstall cluster |
35- | pre-scaleup | master0 | will run before scaleup cluster |
36- | post-scaleup | master0 | will run after scaleup cluster |
37- | upgrade-host | cluster host | will run before upgrade cluster |
38- | upgrade | master0 | will run for upgrading cluster |
39-
37+ The following is a detailed introduction for plugin action.it is divided into 2 categories, one is the ` host type `
38+ plugin and the other is the ` cluster type ` plugin.
39+
40+ | action name | action scope | category| explanation |
41+ | :-----| ----: | ----: | ----: |
42+ | pre-init-host | all host | host type | will run before init cluster host |
43+ | post-init-host | all host | host type| will run after init cluster host |
44+ | pre-clean-host | all host | host type| will run before clean cluster host |
45+ | post-clean-host | all host | host type| will run after clean cluster host |
46+ | pre-install | master0 | cluster type| will run before install cluster |
47+ | post-install | master0 | cluster type | will run after install cluster |
48+ | pre-uninstall | master0 | cluster type | will run before uninstall cluster |
49+ | post-uninstall | master0 | cluster type| will run after uninstall cluster |
50+ | pre-scaleup | master0 | cluster type| will run before scaleup cluster |
51+ | post-scaleup | master0 | cluster type| will run after scaleup cluster |
52+ | upgrade-host | all host | host type| will run before upgrade cluster |
53+ | upgrade | master0 | cluster type| will run for upgrading cluster |
54+
55+ ## How to use
56+
57+ see more details see [ example here] ( ./plugins/example/readme.md )
0 commit comments