Skip to content

Commit 703f290

Browse files
committed
Add newly added fields to OCI config.
1 parent 9584f25 commit 703f290

4 files changed

Lines changed: 257 additions & 173 deletions

File tree

docs/resources/cluster.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,14 +1779,20 @@ The following arguments are supported:
17791779

17801780
The following arguments are supported:
17811781

1782+
* `cluster_type` - (Optional) Choose basic or enhanced cluster. Default `basic` (string)
17821783
* `compartment_id` - (Required) The OCID of the compartment in which to create resources OKE cluster and related resources (string)
17831784
* `custom_boot_volume_size` - (Optional) Optional custom boot volume size (GB) for all nodes. If you specify 0, it will apply the default according to the `node_image` specified. Default `0` (int)
17841785
* `description` - (Optional) An optional description of this cluster (string)
17851786
* `enable_private_control_plane` - (Optional) Specifies whether Kubernetes API endpoint is a private IP only accessible from within the VCN. Default `false` for Rancher v2.5.10 and above (bool)
17861787
* `enable_kubernetes_dashboard` - (Optional) Specifies whether to enable the Kubernetes dashboard. Default `false` (bool)
17871788
* `enable_private_nodes` - (Optional) Specifies whether worker nodes will be deployed into a new, private, subnet. Default `false` (bool)
1789+
* `eviction_grace_duration` - (Optional) Specifies the grace period in minutes to allow cordon and drain to complete. Default `\"5\"` (string)
17881790
* `fingerprint` - (Required) The fingerprint corresponding to the specified user's private API Key (string)
17891791
* `flex_ocpus` - (Optional) Specifies number of OCPUs for nodes (requires flexible shape specified with `node_shape`) (int)
1792+
* `flex_memory_in_gbs` - (Optional) Specifies number amount of memory in GB for nodes (requires flexible shape specified with `node_shape`) (int)
1793+
* `fingerprint` - (Required) The fingerprint corresponding to the specified user's private API Key (string)
1794+
* `force_delete_after_grace_duration` - (Optional) Specifies whether to send a SIGKILL signal if a pod does not terminate within the specified grace period. See also `eviction_grace_duration`. Default `false` (bool)
1795+
* `image_verification_kms_key_id` - (Optional) Comma separated list of OCID(s) of the KMS key to verify the image signatures (string)
17901796
* `kms_key_id` - (Optional) The OCID of a KMS vault master key used to encrypt secrets at rest. See [here](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengencryptingdata.htm) for help creating a vault and master encryption key. For Rancher v2.5.9 and above (string)
17911797
* `kubernetes_version` - (Required) The Kubernetes version that will be used for your master *and* OKE worker nodes (string)
17921798
* `limit_node_count` - (Optional) The maximum number of worker nodes. Can limit `quantity_per_subnet`. Default `0` (no limit) (int)

rancher2/schema_cluster_oke_config.go

Lines changed: 131 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,59 @@ const (
1414
//Types
1515

1616
type OracleKubernetesEngineConfig struct {
17-
CompartmentID string `json:"compartmentId,omitempty" yaml:"compartmentId,omitempty"`
18-
CustomBootVolumeSize int64 `json:"customBootVolumeSize,omitempty" yaml:"customBootVolumeSize,omitempty"`
19-
Description string `json:"description,omitempty" yaml:"description,omitempty"`
20-
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
21-
EnableKubernetesDashboard bool `json:"enableKubernetesDashboard,omitempty" yaml:"enableKubernetesDashboard,omitempty"`
22-
Fingerprint string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
23-
FlexOCPUs int64 `json:"flexOcpus,omitempty" yaml:"flexOcpus,omitempty"`
24-
KubernetesVersion string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
25-
DriverName string `json:"driverName,omitempty" yaml:"driverName,omitempty"`
26-
KMSKeyID string `json:"kmsKeyId" yaml:"kmsKeyId"`
27-
LimitNodeCount int64 `json:"limitNodeCount,omitempty" yaml:"limitNodeCount,omitempty"`
28-
Name string `json:"name,omitempty" yaml:"name,omitempty"`
29-
NodeImage string `json:"nodeImage,omitempty" yaml:"nodeImage,omitempty"`
30-
NodePoolSubnetDNSDomainName string `json:"nodePoolDnsDomainName,omitempty" yaml:"nodePoolDnsDomainName,omitempty"`
31-
NodePoolSubnetName string `json:"nodePoolSubnetName,omitempty" yaml:"nodePoolSubnetName,omitempty"`
32-
NodePublicSSHKeyContents string `json:"nodePublicKeyContents,omitempty" yaml:"nodePublicKeyContents,omitempty"`
33-
NodeShape string `json:"nodeShape,omitempty" yaml:"nodeShape,omitempty"`
34-
NodeUserDataContents string `json:"nodeUserDataContents,omitempty" yaml:"nodeUserDataContents,omitempty"`
35-
PrivateControlPlane bool `json:"enablePrivateControlPlane,omitempty" yaml:"enablePrivateControlPlane,omitempty"`
36-
PrivateKeyContents string `json:"privateKeyContents,omitempty" yaml:"privateKeyContents,omitempty"`
37-
PrivateKeyPassphrase string `json:"privateKeyPassphrase,omitempty" yaml:"privateKeyPassphrase,omitempty"`
38-
PrivateNodes bool `json:"enablePrivateNodes,omitempty" yaml:"enablePrivateNodes,omitempty"`
39-
PodCidr string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"`
40-
QuantityOfSubnets int64 `json:"quantityOfNodeSubnets,omitempty" yaml:"quantityOfNodeSubnets,omitempty"`
41-
QuantityPerSubnet int64 `json:"quantityPerSubnet,omitempty" yaml:"quantityPerSubnet,omitempty"`
42-
Region string `json:"region,omitempty" yaml:"region,omitempty"`
43-
ServiceCidr string `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"`
44-
ServiceLBSubnet1Name string `json:"loadBalancerSubnetName1,omitempty" yaml:"loadBalancerSubnetName1,omitempty"`
45-
ServiceLBSubnet2Name string `json:"loadBalancerSubnetName2,omitempty" yaml:"loadBalancerSubnetName2,omitempty"`
46-
ServiceSubnetDNSDomainName string `json:"serviceDnsDomainName,omitempty" yaml:"serviceDnsDomainName,omitempty"`
47-
SkipVCNDelete bool `json:"skipVcnDelete,omitempty" yaml:"skipVcnDelete,omitempty"`
48-
TenancyID string `json:"tenancyId,omitempty" yaml:"tenancyId,omitempty"`
49-
UserOCID string `json:"userOcid,omitempty" yaml:"userOcid,omitempty"`
50-
VCNName string `json:"vcnName,omitempty" yaml:"vcnName,omitempty"`
51-
VcnCompartmentID string `json:"vcnCompartmentId,omitempty" yaml:"vcnCompartmentId,omitempty"`
52-
WorkerNodeIngressCidr string `json:"workerNodeIngressCidr,omitempty" yaml:"workerNodeIngressCidr,omitempty"`
17+
ClusterType string `json:"clusterType,omitempty" yaml:"clusterType,omitempty"`
18+
CompartmentID string `json:"compartmentId,omitempty" yaml:"compartmentId,omitempty"`
19+
CustomBootVolumeSize int64 `json:"customBootVolumeSize,omitempty" yaml:"customBootVolumeSize,omitempty"`
20+
Description string `json:"description,omitempty" yaml:"description,omitempty"`
21+
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
22+
DriverName string `json:"driverName,omitempty" yaml:"driverName,omitempty"`
23+
EnableKubernetesDashboard bool `json:"enableKubernetesDashboard,omitempty" yaml:"enableKubernetesDashboard,omitempty"`
24+
EvictionGraceDuration string `json:"evictionGraceDuration,omitempty" yaml:"evictionGraceDuration,omitempty"`
25+
Fingerprint string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
26+
FlexMemoryInGBs int64 `json:"flexMemoryInGBs,omitempty" yaml:"flexMemoryInGBs,omitempty"`
27+
FlexOCPUs int64 `json:"flexOcpus,omitempty" yaml:"flexOcpus,omitempty"`
28+
ForceDeleteAfterGraceDuration bool `json:"forceDeleteAfterGraceDuration,omitempty" yaml:"forceDeleteAfterGraceDuration,omitempty"`
29+
ImageVerificationKmsKeyID string `json:"imageVerificationKmsKeyID,omitempty" yaml:"imageVerificationKmsKeyID,omitempty"`
30+
KMSKeyID string `json:"kmsKeyId" yaml:"kmsKeyId"`
31+
KubernetesVersion string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
32+
LimitNodeCount int64 `json:"limitNodeCount,omitempty" yaml:"limitNodeCount,omitempty"`
33+
Name string `json:"name,omitempty" yaml:"name,omitempty"`
34+
NodeImage string `json:"nodeImage,omitempty" yaml:"nodeImage,omitempty"`
35+
NodePoolSubnetDNSDomainName string `json:"nodePoolDnsDomainName,omitempty" yaml:"nodePoolDnsDomainName,omitempty"`
36+
NodePoolSubnetName string `json:"nodePoolSubnetName,omitempty" yaml:"nodePoolSubnetName,omitempty"`
37+
NodePublicSSHKeyContents string `json:"nodePublicKeyContents,omitempty" yaml:"nodePublicKeyContents,omitempty"`
38+
NodeShape string `json:"nodeShape,omitempty" yaml:"nodeShape,omitempty"`
39+
NodeUserDataContents string `json:"nodeUserDataContents,omitempty" yaml:"nodeUserDataContents,omitempty"`
40+
PodCidr string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"`
41+
PrivateControlPlane bool `json:"enablePrivateControlPlane,omitempty" yaml:"enablePrivateControlPlane,omitempty"`
42+
PrivateKeyContents string `json:"privateKeyContents,omitempty" yaml:"privateKeyContents,omitempty"`
43+
PrivateKeyPassphrase string `json:"privateKeyPassphrase,omitempty" yaml:"privateKeyPassphrase,omitempty"`
44+
PrivateNodes bool `json:"enablePrivateNodes,omitempty" yaml:"enablePrivateNodes,omitempty"`
45+
QuantityOfSubnets int64 `json:"quantityOfNodeSubnets,omitempty" yaml:"quantityOfNodeSubnets,omitempty"`
46+
QuantityPerSubnet int64 `json:"quantityPerSubnet,omitempty" yaml:"quantityPerSubnet,omitempty"`
47+
Region string `json:"region,omitempty" yaml:"region,omitempty"`
48+
ServiceCidr string `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"`
49+
ServiceLBSubnet1Name string `json:"loadBalancerSubnetName1,omitempty" yaml:"loadBalancerSubnetName1,omitempty"`
50+
ServiceLBSubnet2Name string `json:"loadBalancerSubnetName2,omitempty" yaml:"loadBalancerSubnetName2,omitempty"`
51+
ServiceSubnetDNSDomainName string `json:"serviceDnsDomainName,omitempty" yaml:"serviceDnsDomainName,omitempty"`
52+
SkipVCNDelete bool `json:"skipVcnDelete,omitempty" yaml:"skipVcnDelete,omitempty"`
53+
TenancyID string `json:"tenancyId,omitempty" yaml:"tenancyId,omitempty"`
54+
UserOCID string `json:"userOcid,omitempty" yaml:"userOcid,omitempty"`
55+
VcnCompartmentID string `json:"vcnCompartmentId,omitempty" yaml:"vcnCompartmentId,omitempty"`
56+
VCNName string `json:"vcnName,omitempty" yaml:"vcnName,omitempty"`
57+
WorkerNodeIngressCidr string `json:"workerNodeIngressCidr,omitempty" yaml:"workerNodeIngressCidr,omitempty"`
5358
}
5459

5560
//Schemas
5661

5762
func clusterOKEConfigFields() map[string]*schema.Schema {
5863
s := map[string]*schema.Schema{
5964

65+
"cluster_type": {
66+
Type: schema.TypeString,
67+
Optional: true,
68+
Description: "Optionally specify a cluster type of basic or enhanced",
69+
},
6070
"compartment_id": {
6171
Type: schema.TypeString,
6272
Required: true,
@@ -67,84 +77,73 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
6777
Optional: true,
6878
Description: "An optional custom boot volume size (in GB) for the nodes",
6979
},
70-
"fingerprint": {
80+
"description": {
7181
Type: schema.TypeString,
72-
Required: true,
73-
Description: "The fingerprint corresponding to the specified user's private API Key",
74-
},
75-
"flex_ocpus": {
76-
Type: schema.TypeInt,
7782
Optional: true,
78-
Description: "Optional number of OCPUs for nodes (requires flexible node_shape)",
83+
Description: "An optional description of this cluster",
7984
},
80-
"kms_key_id": {
81-
Type: schema.TypeString,
85+
"enable_kubernetes_dashboard": {
86+
Type: schema.TypeBool,
8287
Optional: true,
83-
Sensitive: true,
84-
Description: "Optional specify the OCID of the KMS Vault master key",
85-
},
86-
"kubernetes_version": {
87-
Type: schema.TypeString,
88-
Required: true,
89-
Description: "The Kubernetes version that will be used for your master *and* worker nodes e.g. v1.22.5",
88+
Default: false,
89+
Description: "Enable the kubernetes dashboard",
9090
},
91-
"limit_node_count": {
92-
Type: schema.TypeInt,
91+
"enable_private_control_plane": {
92+
Type: schema.TypeBool,
9393
Optional: true,
94-
Description: "Optional limit on the total number of nodes in the pool",
94+
Description: "Whether Kubernetes API endpoint is a private IP only accessible from within the VCN",
9595
},
96-
"node_image": {
97-
Type: schema.TypeString,
98-
Required: true,
99-
Description: "The OS for the node image",
96+
"enable_private_nodes": {
97+
Type: schema.TypeBool,
98+
Optional: true,
99+
Default: false,
100+
Description: "Whether worker nodes are deployed into a new private subnet",
100101
},
101-
"node_shape": {
102+
"eviction_grace_duration": {
102103
Type: schema.TypeString,
103-
Required: true,
104-
Description: "The shape of the node (determines number of CPUs and amount of memory on each node)",
104+
Optional: true,
105+
Description: "The optional grace period in minutes to allow cordon and drain to complete successfuly",
105106
},
106-
"private_key_contents": {
107+
"fingerprint": {
107108
Type: schema.TypeString,
108109
Required: true,
109-
Sensitive: true,
110-
Description: "The private API key file contents for the specified user, in PEM format",
110+
Description: "The fingerprint corresponding to the specified user's private API Key",
111111
},
112-
"region": {
113-
Type: schema.TypeString,
114-
Required: true,
115-
Description: "The availability domain within the region to host the OKE cluster",
112+
"flex_memory_in_gbs": {
113+
Type: schema.TypeInt,
114+
Optional: true,
115+
Description: "Optional amount of memory in GB for nodes (requires flexible node_shape)",
116116
},
117-
"tenancy_id": {
118-
Type: schema.TypeString,
119-
Required: true,
120-
Description: "The OCID of the tenancy in which to create resources",
117+
"flex_ocpus": {
118+
Type: schema.TypeInt,
119+
Optional: true,
120+
Description: "Optional number of OCPUs for nodes (requires flexible node_shape)",
121121
},
122-
"user_ocid": {
123-
Type: schema.TypeString,
124-
Required: true,
125-
Description: "The OCID of a user who has access to the tenancy/compartment",
122+
"force_delete_after_grace_duration": {
123+
Type: schema.TypeBool,
124+
Optional: true,
125+
Default: false,
126+
Description: "Whether to send a SIGKILL signal if a pod does not terminate within the specified grace period",
126127
},
127-
"description": {
128+
"image_verification_kms_key_id": {
128129
Type: schema.TypeString,
129130
Optional: true,
130-
Description: "An optional description of this cluster",
131+
Description: "Optional specify a comma separated list of master encryption key OCID(s) to verify images",
131132
},
132-
"enable_private_control_plane": {
133-
Type: schema.TypeBool,
133+
"kms_key_id": {
134+
Type: schema.TypeString,
134135
Optional: true,
135-
Description: "Whether Kubernetes API endpoint is a private IP only accessible from within the VCN",
136+
Description: "Optional specify the OCID of the KMS Vault master key",
136137
},
137-
"enable_kubernetes_dashboard": {
138-
Type: schema.TypeBool,
139-
Optional: true,
140-
Default: false,
141-
Description: "Enable the kubernetes dashboard",
138+
"kubernetes_version": {
139+
Type: schema.TypeString,
140+
Required: true,
141+
Description: "The Kubernetes version that will be used for your master *and* worker nodes e.g. v1.33.1",
142142
},
143-
"enable_private_nodes": {
144-
Type: schema.TypeBool,
143+
"limit_node_count": {
144+
Type: schema.TypeInt,
145145
Optional: true,
146-
Default: false,
147-
Description: "Whether worker nodes are deployed into a new private subnet",
146+
Description: "Optional limit on the total number of nodes in the pool",
148147
},
149148
"load_balancer_subnet_name_1": {
150149
Type: schema.TypeString,
@@ -156,6 +155,11 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
156155
Optional: true,
157156
Description: "The (optional) name of a second existing subnet to use for Kubernetes services / LB",
158157
},
158+
"node_image": {
159+
Type: schema.TypeString,
160+
Required: true,
161+
Description: "The OS for the node image",
162+
},
159163
"node_pool_dns_domain_name": {
160164
Type: schema.TypeString,
161165
Optional: true,
@@ -173,11 +177,27 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
173177
Optional: true,
174178
Description: "The contents of the SSH public key file to use for the nodes",
175179
},
180+
"node_shape": {
181+
Type: schema.TypeString,
182+
Required: true,
183+
Description: "The shape of the node (determines number of CPUs and amount of memory on each node)",
184+
},
176185
"node_user_data_contents": {
177186
Type: schema.TypeString,
178187
Optional: true,
179188
Description: "The contents of custom cloud-init / user_data for the nodes - will be base64 encoded internally if it is not already",
180189
},
190+
"pod_cidr": {
191+
Type: schema.TypeString,
192+
Optional: true,
193+
Description: "Optional specify the pod CIDR, defaults to 10.244.0.0/16",
194+
},
195+
"private_key_contents": {
196+
Type: schema.TypeString,
197+
Required: true,
198+
Sensitive: true,
199+
Description: "The private API key file contents for the specified user, in PEM format",
200+
},
181201
"private_key_passphrase": {
182202
Type: schema.TypeString,
183203
Optional: true,
@@ -195,6 +215,16 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
195215
Default: 1,
196216
Description: "Number of worker nodes in each subnet / availability domain",
197217
},
218+
"region": {
219+
Type: schema.TypeString,
220+
Required: true,
221+
Description: "The availability domain within the region to host the OKE cluster",
222+
},
223+
"service_cidr": {
224+
Type: schema.TypeString,
225+
Optional: true,
226+
Description: "Optional specify the service CIDR, defaults to 10.96.0.0/16",
227+
},
198228
"service_dns_domain_name": {
199229
Type: schema.TypeString,
200230
Optional: true,
@@ -207,6 +237,16 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
207237
Default: false,
208238
Description: "Whether to skip deleting VCN",
209239
},
240+
"tenancy_id": {
241+
Type: schema.TypeString,
242+
Required: true,
243+
Description: "The OCID of the tenancy in which to create resources",
244+
},
245+
"user_ocid": {
246+
Type: schema.TypeString,
247+
Required: true,
248+
Description: "The OCID of a user who has access to the tenancy/compartment",
249+
},
210250
"vcn_compartment_id": {
211251
Type: schema.TypeString,
212252
Optional: true,
@@ -222,16 +262,6 @@ func clusterOKEConfigFields() map[string]*schema.Schema {
222262
Optional: true,
223263
Description: "Additional CIDR from which to allow ingress to worker nodes",
224264
},
225-
"pod_cidr": {
226-
Type: schema.TypeString,
227-
Optional: true,
228-
Description: "Optional specify the pod CIDR, defaults to 10.244.0.0/16",
229-
},
230-
"service_cidr": {
231-
Type: schema.TypeString,
232-
Optional: true,
233-
Description: "Optional specify the service CIDR, defaults to 10.96.0.0/16",
234-
},
235265
}
236266

237267
return s

0 commit comments

Comments
 (0)