You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Scale Kubernetes Clusters using HPE GreenLake Terraform Provider
2
+
title: Update Kubernetes Clusters using HPE GreenLake Terraform Provider
3
3
date: 2023-05-11T09:24:47.589Z
4
4
author: Tanushi Agarwal
5
5
authorimage: /img/Avatar1.svg
@@ -11,9 +11,9 @@ IaC or Infrastructure as code is an practice of automating the process of managi
11
11
12
12
As the part of upgrade, the following 3 scenarios are supported --
13
13
14
-
1. Scaling of a cluster's worker nodes. Please refer blog post [Scale Kubernetes Clusters using HPE GreenLake Terraform Provider](https://developer.hpe.com/blog/scale-kubernetes-cluster-using-hpe-greenlake-terraform-provider/) to check out scaling options available for woker nodes.
15
-
2. Upgrade the kubernetes version of the cluster. Covered in this blog.
16
-
3. Upgrade the OS version of the worker nodes inside a cluster. Covered in this blog.
14
+
1. Scaling of a cluster's worker nodes. Please refer blog post [Scale Kubernetes Clusters using HPE GreenLake Terraform Provider](https://developer.hpe.com/blog/scale-kubernetes-cluster-using-hpe-greenlake-terraform-provider/) to check out scaling options available for woker nodes.
15
+
2. Upgrade the kubernetes version of the cluster. Covered in this blog.
16
+
3. Upgrade the OS version of the worker nodes inside a cluster. Covered in this blog.
17
17
18
18
# Prerequisite
19
19
@@ -70,50 +70,50 @@ resource hpegl_caas_cluster test {
70
70
71
71
For Kubernetes version upgrade, we need to specify the new version of kubernetes that is available for upgrade in the resources block.
72
72
73
-
1. kubernetes_version: *Use the Kubernetes version that pops up on the cluster details page in the UI*
73
+
1. kubernetes_version: *Use the Kubernetes version that pops up on the cluster details page in the UI*
74
74
75
+

75
76
76
77
Below is the reference Terraform configuration for updating the cluster's kubernetes version.
Terraform plan is a dry run that lets you preview the changes that Terraform plans to make to your infrastructure based on the data you provide in your Terraform file. To see this, run **terraform plan**
@@ -131,6 +131,7 @@ Terraform will perform the following actions:
131
131
# hpegl_caas_cluster.test will be updated in-place
For OS version upgrade, we need to specify the new version of OS Image that is available for upgrade & the name of the OS Image in the worker node block.
201
204
**Note**: The OS version is specific to a worker node pool. All the nodes in the worker node pool will be updated to the same OS version. However, we can have different node pool supporting different OS versions.
202
205
203
206
The worker node block consist of following fields -
204
-
1.**name**: *The name of the worker nodepool. If you wish to update default or existing worker node pool, enter the name of that node pool or you can create a new node pool by specifying a new name.*
205
-
2.**machine_blueprint_id**: *Fill in the ID for the machine blueprint that is already present in HPE GreenLake Central for your tenant. Use the machine blueprint data source to retrieve the machine blueprint ID.*
206
-
3.**count**: *Add the number of nodes to be present as part of this node pool. We can scale up & down by updating the count value here.*
207
+
208
+
1.**name**: *The name of the worker nodepool. If you wish to update default or existing worker node pool, enter the name of that node pool or you can create a new node pool by specifying a new name.*
209
+
2.**machine_blueprint_id**: *Fill in the ID for the machine blueprint that is already present in HPE GreenLake Central for your tenant. Use the machine blueprint data source to retrieve the machine blueprint ID.*
210
+
3.**count**: *Add the number of nodes to be present as part of this node pool. We can scale up & down by updating the count value here.*
207
211
4.**os_image**: *The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image*
208
212
5.**os_version**: *The version to be upgraded to. We can get this version in the UI. Whenever there is a new version present, UI will pop up a banner mentioning the new version.*
209
213
210
214
Below is the reference Terraform configuration for updating the worker nodepool's OS version.
211
215
212
-
```hcl
216
+
```hcl
213
217
terraform {
214
-
required_providers {
215
-
hpegl = {
216
-
source = "hpe/hpegl"
217
-
version = ">= 0.2.2"
218
-
}
219
-
}
218
+
required_providers {
219
+
hpegl = {
220
+
source = "hpe/hpegl"
221
+
version = ">= 0.2.2"
222
+
}
223
+
}
220
224
}
221
-
225
+
222
226
provider hpegl {
223
-
caas {
224
-
}
227
+
caas {
228
+
}
225
229
}
226
-
230
+
227
231
variable "HPEGL_SPACE" {
228
-
type = string
232
+
type = string
229
233
}
230
-
234
+
231
235
data "hpegl_caas_site" "blr" {
232
-
name = "BLR"
233
-
space_id = var.HPEGL_SPACE
234
-
}
235
-
236
+
name = "BLR"
237
+
space_id = var.HPEGL_SPACE
238
+
}
239
+
236
240
data "hpegl_caas_cluster_blueprint" "bp" {
237
-
name = "demo"
238
-
site_id = data.hpegl_caas_site.blr.id
241
+
name = "demo"
242
+
site_id = data.hpegl_caas_site.blr.id
239
243
}
240
-
244
+
241
245
data "hpegl_caas_machine_blueprint" "standard_worker" {
@@ -356,11 +373,12 @@ In this blog, I covered how to update Kubernetes clusters with Terraform provide
356
373
357
374
I hope you found this information interesting and useful while considering the upgrade of Kubernetes cluster with HPE GreenLake Terraform provider. Use the following links to understand more about Terraform and HPE GreenLake Terraform Provider.
358
375
359
-
-[Learn more about Terraform](https://www.terraform.io/)
376
+
*[Learn more about Terraform](https://www.terraform.io/)
377
+
*[Learn more about HPE GreenLake](https://www.hpe.com/us/en/greenlake.html)
378
+
*[Learn more about the HPE GreenLake Terraform provider](https://registry.terraform.io/providers/HPE/hpegl)
360
379
361
-
-[Learn more about HPE GreenLake](https://www.hpe.com/us/en/greenlake.html)
380
+
Don’t forget, you can always find other tutorials and articles on HPE GreenLake on the [HPE Developer blog](https://developer.hpe.com/blog/tag/hpe-greenlake).
362
381
363
-
-[Learn more about the HPE GreenLake Terraform provider](https://registry.terraform.io/providers/HPE/hpegl)
382
+
## Tags
364
383
365
-
Don’t forget, you can always find other tutorials and articles on HPE GreenLake on the [HPE Developer blog](https://developer.hpe.com/blog/tag/hpe-greenlake).
0 commit comments