Skip to content

Commit 34f4cd6

Browse files
committed
Update Blog “scale-kubernetes-clusters-using-hpe-greenlake-terraform-provider”
1 parent c7ada4d commit 34f4cd6

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

content/blog/scale-kubernetes-clusters-using-hpe-greenlake-terraform-provider.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Upgrade Kubernetes Clusters using HPE GreenLake Terraform Provider
3-
date: 2023-05-15T19:21:37.419Z
2+
title: Upgrade Kubernetes clusters using HPE GreenLake Terraform Provider
3+
date: 2023-05-16T15:13:41.342Z
44
author: Tanushi Agarwal
55
authorimage: /img/photoforblog.jpg
66
disable: false
@@ -17,29 +17,29 @@ tags:
1717
- sre
1818
- site-reliability-engineer
1919
---
20-
IaC or Infrastructure as code is a practice of automating the process of managing and provisioning infrastructure through code instead of through manual processes. It gives organizations the 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.
20+
IaC, or Infrastructure as code, is a practice of automating the process of managing and provisioning infrastructure through the use of code instead of using manual processes. It gives organizations the tools required to create, manage, and destroy compute resources by statically defining and declaring these resources in codeblocks. It helps increase operational agility, simplify management, reduce errors, and save cost.
2121

22-
In this post, I will explore options to declare and upgrade Kubernetes clusters on HPE GreenLake using the HPE GreenLake Terraform Provider.
22+
In this post, I will explore options used to declare and upgrade Kubernetes clusters on HPE GreenLake using the HPE GreenLake Terraform Provider.
2323

24-
As the part of upgrade, the following 3 scenarios are supported --
24+
In terms of upgrades, the following 3 scenarios are supported:
2525

2626
1. Scaling of a cluster's worker nodes. Please refer to the 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 worker nodes.
2727
2. Upgrade the Kubernetes version of the cluster. This step is covered in this blog.
2828
3. Upgrade the OS version of the worker nodes inside a cluster. This step is covered in this blog.
2929

3030
# Prerequisite
3131

32-
Before starting this tutorial, read the blog post [Kubernetes Cluster as Code - Part 1](https://developer.hpe.com/blog/kubernetes-clusters-as-code-part1/), which includes steps for creating a Kubernetes cluster. This post expands upon that scenario by examining how to upgrade a cluster's Kubernetes version & OS version of its worker nodes.
32+
Before implementing the steps shown in this tutorial, please read the blog post [Kubernetes Cluster as Code - Part 1](https://developer.hpe.com/blog/kubernetes-clusters-as-code-part1/), which includes the steps required to create a Kubernetes cluster. This post expands upon that scenario by examining how to upgrade a cluster's Kubernetes version and the OS version of its worker nodes.
3333

3434
# Verify existing Kubernetes cluster
3535

36-
After the cluster is created following the instructions found in the [Kubernetes Cluster as Code - Part 1 blog post](https://developer.hpe.com/blog/kubernetes-clusters-as-code-part1/), launch HPE GreenLake Central console and verify that the cluster is present under the appropriate tenant.
36+
After the cluster is created following the instructions found in the [Kubernetes Cluster as Code - Part 1 blog post](https://developer.hpe.com/blog/kubernetes-clusters-as-code-part1/), launch the HPE GreenLake Central console and verify that the cluster is present under the appropriate tenant.
3737

3838
You should see the **tf-test** cluster present under **Dashboard -> Manage your Private Cloud -> Containers**.
3939

4040
![](https://developer.hpe.com/img/cluster_list.jpg)
4141

42-
Below is the reference Terraform configuration file for the existing cluster.
42+
Shown below is the reference Terraform configuration file for the existing cluster.
4343

4444
```hcl
4545
terraform {
@@ -82,11 +82,11 @@ resource hpegl_caas_cluster test {
8282

8383
For the Kubernetes version upgrade, you need to specify the new version of Kubernetes that is available for upgrade in the resources block.
8484

85-
1. **kubernetes_version**: *Use the Kubernetes version that pops up on the cluster details page in the UI.*
85+
1. **kubernetes_version**: Use the Kubernetes version that pops up on the cluster details page in the UI.
8686

8787
![](/img/blog1.jpg)
8888

89-
Below is the reference Terraform configuration for updating the cluster's Kubernetes version.
89+
Below you can see the reference Terraform configuration for updating the cluster's Kubernetes version.
9090

9191
```hcl
9292
terraform {
@@ -128,7 +128,7 @@ resource hpegl_caas_cluster test {
128128

129129
## Run Terraform plan
130130

131-
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+
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.**
132132

133133
```shellsession
134134
$ terraform plan
@@ -212,25 +212,27 @@ Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
212212

213213
# Upgrade the OS Version
214214

215-
For an OS version upgrade, you need to specify the new version of the OS image that is available for upgrade & the name of the OS image in the worker node block.
215+
For an OS version upgrade, you need to specify the new version of the OS image that is available to be upgraded and the name of the OS image in the worker node block.
216216

217217
**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, you can have different node pools supporting different OS versions.
218218

219-
The worker node block consists of the following fields -
219+
The worker node block consists of the following fields:
220220

221-
1. **name**: *The name of the worker node pool. If you wish to update the default or existing worker node pool, enter the name of that node pool. To create a node pool, specify a new name.*
222-
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.*
223-
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.*
224-
4. **os_image**: *The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image.*
225-
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.*
221+
1. **name**: The name of the worker node pool. If you wish to update the default or existing worker node pool, enter the name of that node pool. To create a node pool, specify a new name.
222+
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.
223+
3. **count**: Add the number of nodes to be present as part of this node pool. We can scale up and down by updating the count value here.
224+
4. **os_image**: The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image.
225+
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.
226226

227-
We can find the new version by clicking on the **Actions->Update OS** button on the right side of cluster details page.
227+
You can find the new version by clicking on the **Actions->Update OS** button on the right side of cluster details page.
228228

229229
![](/img/blog3.jpg)
230230

231+
Get the name and version of the new image from the card that pops up in the UI and then cancel this action.
232+
231233
![](/img/blog4.jpg)
232234

233-
Below is the reference Terraform configuration for updating the OS version of the worker node pool.
235+
Shown below is the reference Terraform configuration for updating the OS version of the worker node pool.
234236

235237
```hcl
236238
terraform {
@@ -284,7 +286,7 @@ worker_nodes {
284286

285287
## Run Terraform plan
286288

287-
Again, to preview the changes, do a dry run by running **terraform plan**
289+
Again, to preview the changes, do a dry run by running **terraform plan.**
288290

289291
```shellsession
290292
$ terraform plan
@@ -384,16 +386,16 @@ hpegl_caas_cluster.test: Modifications complete after 43m18s [id=a32fabb9-7c19-4
384386
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
385387
```
386388

387-
**Note**: If you wish to only scale up or down the worker node pool & not update the OS version, add only the 3 fields i.e. **name**, **machine\_blueprint\_id** & **count** in the worker node block.
389+
**Note**: If you wish to only scale up or down the worker node pool and not update the OS version, add only the 3 fields i.e. **name**, **machine_blueprint_id** and **count** in the worker node block.
388390

389391
# Summary
390392

391-
In this blog, I covered how to update Kubernetes clusters with Terraform provider for HPE GreenLake. I showed you how to update the Kubernetes version of the cluster & how to upgrade the OS version of worker node pool. Also I discussed how update & upgrade can be performed while scaling a cluster.
393+
In this blog, I covered how to update Kubernetes clusters with Terraform provider for HPE GreenLake. I showed you how to update the Kubernetes version of the cluster and how to upgrade the OS version of worker node pool. Also I discussed how update and upgrade can be performed while scaling a cluster.
392394

393395
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.
394396

395397
* [Learn more about Terraform](https://www.terraform.io/)
396398
* [Learn more about HPE GreenLake](https://www.hpe.com/us/en/greenlake.html)
397-
* [Learn more about the HPE GreenLake Terraform provider](https://registry.terraform.io/providers/HPE/hpegl)
399+
* [Learn more about the HPE GreenLake Terraform provider](https://registry.terraform.io/providers/HPE/hpegl/latest/docs)
398400

399401
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

Comments
 (0)