Skip to content

Commit 9302c96

Browse files
committed
Refine the format.
1 parent 4b55436 commit 9302c96

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

design/metal3host-controller.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
# Baremetal host single instance and multi-instance operator
2+
23
## Introduction
4+
35
Currently, the metal3 system is to set up a Kubernetes cluster on bare-metal hosts which is tightly bound with cluster-api and Kubernetes. We target to allocate bare-metal hosts that just pre-installing the OS, or pre-installing the applications as required.
6+
47
## Motivation
8+
59
To meet the scenery that only requires a pure bare-metal host or with a simple application installed.
10+
611
## Goals
12+
713
- Allocate one pure bare-metal host
814
- Allocate multiple bare-metal hosts
915
- Allocate bare-metal host with pre-installed applications
1016
- Specify the different configurations for different bare-metal host
17+
1118
## Non-goals
19+
1220
- Allocate different types of bare-metal hosts at one time
21+
1322
## Proposal
23+
1424
### Architecture
25+
1526
The operators include the metal3Host operator, metal3HostDeployment operator, and data operator.
1627
![modules](images/metal3hostModules.png)
1728

@@ -22,19 +33,26 @@ Metal3Host is a virtual instance. Users could define it to require a bare-metal
2233
Metal3HostDeployment will define a group of metal3Hosts with the same configuration. It could define the number of replicas. It could scale up/down. We even could auto-scale by some rules after the monitor function is leveraged.
2334

2435
The data operator will set up the boot time configuration & routine. It includes three parts: the userData, the metaData, and the networkData. The userData includes some user-specified data such as installing a package, or running a command like "mkdir /test". The metaData defines some host-specific data such as hostname. The networkData includes the network configuration. The data is bound with the baremetal host. For example, the networkData defines a NIC with an IP, the NIC name is host related. So a dataTemplate should be pre-defined, it will be bound to the bare-metal host when a metal3host is defined and associated with a bare-metal host.
36+
2537
### Routine
38+
2639
#### Pre-define a dataTemplate
40+
2741
![createDataTemplate](images/createDataTemplate.png)
2842

2943
#### Require a metal3host
44+
3045
![createMetal3Host](images/createMetal3Host.png)
3146

3247
#### Require a metal3HostDeployment
48+
3349
![createMetal3HostDeployment](images/createMetal3HostDeployment.png)
3450

3551
### Configuration
52+
3653
#### metal3host
3754

55+
'''golang
3856
// Metal3HostSpec defines the desired state of Metal3Host
3957
type Metal3HostSpec struct {
4058
// ProviderID will be the Metal3Host in ProviderID format
@@ -66,9 +84,12 @@ The data operator will set up the boot time configuration & routine. It includes
6684
// +optional
6785
AutomatedCleaningMode *string `json:"automatedCleaningMode,omitempty"`
6886
}
87+
'''
6988

7089
#### metal3hostDeployment
71-
// Metal3HostDeploymentSpec defines the desired state of Metal3HostDeployment.
90+
91+
'''golang
92+
// Metal3HostDeploymentSpec defines the desired state of Metal3HostDeployment.
7293
type Metal3HostDeploymentSpec struct {
7394
// Number of desired machines. Defaults to 1.
7495
// This is a pointer to distinguish between explicit zero and not specified.
@@ -155,8 +176,11 @@ The data operator will set up the boot time configuration & routine. It includes
155176

156177
Conditions capi.Conditions `json:"conditions,omitempty"`
157178
}
179+
'''
158180

159181
#### datatemplate
182+
183+
'''golang
160184
// DataTemplateSpec defines the desired state of DataTemplate
161185
type DataTemplateSpec struct {
162186
//MetaData contains the information needed to generate the metadata secret
@@ -254,8 +278,11 @@ The data operator will set up the boot time configuration & routine. It includes
254278
// +optional
255279
FromAnnotations []MetaDataFromAnnotation `json:"fromAnnotations,omitempty"`
256280
}
281+
'''
257282

258283
#### data
284+
285+
'''golang
259286
// DataSpec defines the desired state of Data
260287
type DataSpec struct {
261288
// DataTemplate is the CUMetalDataTemplate this was generated from.
@@ -284,3 +311,4 @@ The data operator will set up the boot time configuration & routine. It includes
284311
// +optional
285312
ErrorMessage *string `json:"errorMessage,omitempty"`
286313
}
314+
'''

0 commit comments

Comments
 (0)