-
Notifications
You must be signed in to change notification settings - Fork 221
/
schema_cluster_k3s_config.go
66 lines (59 loc) · 1.34 KB
/
schema_cluster_k3s_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package rancher2
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
const (
clusterK3SKind = "k3s"
clusterDriverK3S = "k3s"
)
//Schemas
func clusterK3SUpgradeStrategyConfigFields() map[string]*schema.Schema {
s := map[string]*schema.Schema{
"drain_server_nodes": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Drain server nodes",
},
"drain_worker_nodes": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Drain worker nodes",
},
"server_concurrency": {
Type: schema.TypeInt,
Optional: true,
Default: 1,
Description: "Server concurrency",
},
"worker_concurrency": {
Type: schema.TypeInt,
Optional: true,
Default: 1,
Description: "Worker concurrency",
},
}
return s
}
func clusterK3SConfigFields() map[string]*schema.Schema {
s := map[string]*schema.Schema{
"upgrade_strategy": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
Description: "The K3S upgrade strategy",
Elem: &schema.Resource{
Schema: clusterK3SUpgradeStrategyConfigFields(),
},
},
"version": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "The K3S kubernetes version",
},
}
return s
}