-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathschema_node_spec.go
More file actions
182 lines (177 loc) · 4.5 KB
/
schema_node_spec.go
File metadata and controls
182 lines (177 loc) · 4.5 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Copyright IBM Corp. 2017, 2025
// SPDX-License-Identifier: MPL-2.0
package kubernetes
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
func nodeSpecFields() map[string]*schema.Schema {
return map[string]*schema.Schema{
"pod_cidr": {
Type: schema.TypeString,
Optional: true,
ForceNew: false,
Description: "The pod IP range assigned to the node.",
},
"pod_cidrs": {
Type: schema.TypeList,
Optional: true,
ForceNew: false,
Description: "The IP ranges assigned to the node for usage by pods on that node.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"provider_id": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "ID of the node assigned by the cloud provider.",
},
"unschedulable": {
Type: schema.TypeBool,
Optional: true,
Description: "Controls the schedulability of new pods on the node. By default, node is schedulable.",
},
"taints": {
Type: schema.TypeList,
Optional: true,
Description: "Taints applied to the node",
Elem: &schema.Resource{
Schema: nodeTaintFields(),
},
},
}
}
func nodeStatusFields() map[string]*schema.Schema {
return map[string]*schema.Schema{
"addresses": {
Type: schema.TypeList,
Computed: true,
Description: "Set of IP addresses and/or Hostname assigned to the node. More info: https://kubernetes.io/docs/concepts/architecture/nodes/#addresses/node/#info",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Computed: true,
},
"address": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"allocatable": {
Type: schema.TypeMap,
Description: "Represents the total resources of a node.",
Computed: true,
Elem: schema.TypeString,
},
"capacity": {
Type: schema.TypeMap,
Description: "Represents the resources of a node that are available for scheduling.",
Computed: true,
Elem: schema.TypeString,
},
"node_info": {
Type: schema.TypeList,
Computed: true,
Description: "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"machine_id": {
Type: schema.TypeString,
Computed: true,
},
"system_uuid": {
Type: schema.TypeString,
Computed: true,
},
"boot_id": {
Type: schema.TypeString,
Computed: true,
},
"kernel_version": {
Type: schema.TypeString,
Computed: true,
},
"os_image": {
Type: schema.TypeString,
Computed: true,
},
"container_runtime_version": {
Type: schema.TypeString,
Computed: true,
},
"kubelet_version": {
Type: schema.TypeString,
Computed: true,
},
"kube_proxy_version": {
Type: schema.TypeString,
Computed: true,
Deprecated: "This field has been deprecated in Kubernetes v1.31 and will be removed.",
},
"operating_system": {
Type: schema.TypeString,
Computed: true,
},
"architecture": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"conditions": {
Type: schema.TypeList,
Computed: true,
Description: "List of conditions describing each node's health and operational status.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Computed: true,
},
"status": {
Type: schema.TypeString,
Computed: true,
},
"last_heartbeat_time": {
Type: schema.TypeString,
Computed: true,
},
"last_transition_time": {
Type: schema.TypeString,
Computed: true,
},
"reason": {
Type: schema.TypeString,
Computed: true,
},
"message": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
}
}
func nodeTaintFields() map[string]*schema.Schema {
return map[string]*schema.Schema{
"key": {
Type: schema.TypeString,
Description: "The taint key",
Required: true,
},
"value": {
Type: schema.TypeString,
Description: "The taint value",
Required: true,
},
"effect": {
Type: schema.TypeString,
Description: "The taint effect",
Required: true,
},
}
}