Skip to content

Commit 8773429

Browse files
committed
Update Blog “scale-kubernetes-clusters-using-hpe-greenlake-terraform-provider”
1 parent 0c9a22d commit 8773429

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ date: 2023-05-12T04:07:48.888Z
44
author: Tanushi Agarwal
55
authorimage: /img/photoforblog.jpg
66
disable: false
7+
tags: []
78
---
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.
9+
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.
910

10-
> In this post, I will explore options to declare and upgrade Kubernetes clusters on HPE GreenLake using the HPE GreenLake Terraform Provider.
11+
In this post, I will explore options to declare and upgrade Kubernetes clusters on HPE GreenLake using the HPE GreenLake Terraform Provider.
1112

1213
As the part of upgrade, the following 3 scenarios are supported --
1314

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.
15+
1. Scaling of a cluster's worker nodes. Please refer to the blog post [Scale Kubernetes Clusters using HPE GreenLake Terraform Provider](<1. https://developer.hpe.com/blog/scale-kubernetes-cluster-using-hpe-greenlake-terraform-provider/>)to check out scaling options available for worker nodes.
16+
2. Upgrade the Kubernetes version of the cluster. This step is covered in this blog.
17+
3. Upgrade the OS version of the worker nodes inside a cluster. This step is covered in this blog.
1718

1819
# Prerequisite
1920

20-
Before starting this tutorial, it is recommended that you 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 woker nodes.
21+
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.
2122

2223
# Verify existing Kubernetes cluster
2324

@@ -66,17 +67,15 @@ resource hpegl_caas_cluster test {
6667
}
6768
```
6869

69-
# Kubernetes version upgrade
70+
# Upgrade the Kubernetes version
7071

71-
For Kubernetes version upgrade, we need to specify the new version of kubernetes that is available for upgrade in the resources block.
72+
For the Kubernetes version upgrade, you need to specify the new version of Kubernetes that is available for upgrade in the resources block.
7273

7374
1. **kubernetes_version**: *Use the Kubernetes version that pops up on the cluster details page in the UI.*
7475

7576
![](/img/blog1.jpg)
7677

77-
78-
79-
Below is the reference Terraform configuration for updating the cluster's kubernetes version.
78+
Below is the reference Terraform configuration for updating the cluster's Kubernetes version.
8079

8180
```hcl
8281
terraform {
@@ -116,7 +115,7 @@ resource hpegl_caas_cluster test {
116115
}
117116
```
118117

119-
# Ready to Terraform plan
118+
## Run Terraform plan
120119

121120
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**
122121

@@ -145,7 +144,7 @@ Plan: 0 to add, 1 to change, 0 to destroy.
145144
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
146145
```
147146

148-
# Ready to Terraform apply
147+
## Run Terraform apply
149148

150149
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**.
151150

@@ -200,28 +199,27 @@ hpegl_caas_cluster.test: Modifications complete after 35m18s [id=a32fabb9-7c19-4
200199
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
201200
```
202201

203-
# OS Version upgrade
204-
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.
202+
# Upgrade the OS Version
206203

204+
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.
207205

208206
**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.
209207

210208
The worker node block consist of following fields -
211209

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.*
210+
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.*
213211
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.*
214212
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.*
215213
4. **os_image**: *The name of the OS image. Use the machine blueprint data source to retrieve the name of OS image.*
216214
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.*
217215

218-
We can find the new version by clicking on the **Actions->Update OS** button on the right side of cluster's details page.
216+
We can find the new version by clicking on the **Actions->Update OS** button on the right side of cluster details page.
219217

220218
![](/img/blog2.jpg)
221219

222220
![](/img/blog4.jpg)
223221

224-
Below is the reference Terraform configuration for updating the worker nodepool's OS version.
222+
Below is the reference Terraform configuration for updating the OS version of the worker node pool.
225223

226224
```hcl
227225
terraform {
@@ -273,7 +271,7 @@ worker_nodes {
273271
}
274272
```
275273

276-
# Ready to Terraform plan
274+
## Run Terraform plan
277275

278276
Again, to preview the changes, do a dry run by running **terraform plan**
279277

@@ -309,7 +307,7 @@ Plan: 0 to add, 1 to change, 0 to destroy.
309307
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
310308
```
311309

312-
# Ready to Terraform apply
310+
## Run Terraform apply
313311

314312
Run the command **terraform apply** and type **yes** when asked to **Enter a value**.
315313

@@ -387,8 +385,4 @@ I hope you found this information interesting and useful while considering the u
387385
* [Learn more about HPE GreenLake](https://www.hpe.com/us/en/greenlake.html)
388386
* [Learn more about the HPE GreenLake Terraform provider](https://registry.terraform.io/providers/HPE/hpegl)
389387

390-
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).
391-
392-
## Tags
393-
394-
[hpe-greenlake,](https://developer.hpe.com/blog/tag/hpe-greenlake)[devops,](https://developer.hpe.com/blog/tag/devops)[terraform,](https://developer.hpe.com/blog/tag/terraform)[opensource,](https://developer.hpe.com/blog/tag/opensource)[hpe-greenlake-for-private-cloud-enterprise,](https://developer.hpe.com/blog/tag/hpe-greenlake-for-private-cloud-enterprise)[hpe-greenlake-for-private-cloud-enterprise-containers,](https://developer.hpe.com/blog/tag/hpe-greenlake-for-private-cloud-enterprise-containers)[containers-service,](https://developer.hpe.com/blog/tag/containers-service)[developer,](https://developer.hpe.com/blog/tag/developer)[devops,](https://developer.hpe.com/blog/tag/devops)[sre,](https://developer.hpe.com/blog/tag/sre)[site-reliability-engineer](https://developer.hpe.com/blog/tag/site-reliability-engineer)
388+
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)