|
1 | 1 | ---
|
2 |
| -title: Update Kubernetes Clusters using HPE GreenLake Terraform Provider |
3 |
| -date: 2023-05-11T15:47:11.101Z |
| 2 | +title: Upgrade Kubernetes Clusters using HPE GreenLake Terraform Provider |
| 3 | +date: 2023-05-12T03:06:12.264Z |
4 | 4 | author: Tanushi Agarwal
|
5 |
| -authorimage: /img/Avatar1.svg |
| 5 | +authorimage: /img/photoforblog.jpg |
6 | 6 | disable: false
|
7 | 7 | ---
|
8 | 8 | IaC or Infrastructure as code is an practice of automating the process of managing and provisioning infrastructure through code instead of manual processes. It gives organizations tools to create, manage, and destroy compute resources by statically defining and declaring these resources in codeblocks. It helps to increase operational agility, simplify management, reduce errors, and save cost.
|
@@ -70,9 +70,11 @@ 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 | + |
| 75 | +  |
| 76 | + |
74 | 77 |
|
75 |
| -  |
76 | 78 |
|
77 | 79 | Below is the reference Terraform configuration for updating the cluster's kubernetes version.
|
78 | 80 |
|
@@ -203,18 +205,22 @@ Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
|
203 | 205 | 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.
|
204 | 206 |
|
205 | 207 |
|
206 |
| -**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. |
| 208 | +**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 pools supporting different OS versions. |
207 | 209 |
|
208 | 210 | The worker node block consist of following fields -
|
209 | 211 |
|
210 | 212 | 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.*
|
211 | 213 | 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.*
|
212 | 214 | 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.*
|
213 |
| -4. **os_image**: *The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image* |
214 |
| -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.* |
| 215 | +4. **os_image**: *The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image.* |
| 216 | +5. **os_version**: *The version to be upgraded to. We can get this version in the UI. Whenever there is a new version available, UI will pop up a banner mentioning the new version.* |
215 | 217 |
|
216 | 218 | We can find the new version by clicking on the **Actions->Update OS** button on the right side of cluster's details page.
|
217 | 219 |
|
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
218 | 224 | Below is the reference Terraform configuration for updating the worker nodepool's OS version.
|
219 | 225 |
|
220 | 226 | ```hcl
|
@@ -269,7 +275,7 @@ worker_nodes {
|
269 | 275 |
|
270 | 276 | # Ready to Terraform plan
|
271 | 277 |
|
272 |
| -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** |
| 278 | +Again, to preview the changes, do a dry run by running **terraform plan** |
273 | 279 |
|
274 | 280 | ```shellsession
|
275 | 281 | $ terraform plan
|
@@ -305,7 +311,7 @@ Note: You didn't use the -out option to save this plan, so Terraform can't guara
|
305 | 311 |
|
306 | 312 | # Ready to Terraform apply
|
307 | 313 |
|
308 |
| -Terraform apply executes the actions proposed in the Terraform plan and updates the resources. Run the command **terraform apply** and type **yes** when asked to **Enter a value**. |
| 314 | +Run the command **terraform apply** and type **yes** when asked to **Enter a value**. |
309 | 315 |
|
310 | 316 | ```shellsession
|
311 | 317 | $ terraform apply
|
|
0 commit comments