Skip to content

Commit d258527

Browse files
authored
Merge pull request #2 from truefoundry/updating-node-count
Updating node count
2 parents 02a01c5 + 18ac91b commit d258527

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

.github/workflows/tflint.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
7+
jobs:
8+
tflint:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
name: Checkout source code
18+
19+
- uses: actions/cache@v3
20+
name: Cache plugin dir
21+
with:
22+
path: ~/.tflint.d/plugins
23+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
24+
25+
- uses: terraform-linters/setup-tflint@v3
26+
name: Setup TFLint
27+
with:
28+
tflint_version: v0.47.0
29+
30+
- name: Show version
31+
run: tflint --version
32+
33+
- name: Init TFLint
34+
run: tflint --init
35+
env:
36+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
37+
GITHUB_TOKEN: ${{ github.token }}
38+
39+
- name: Run TFLint
40+
run: tflint --minimum-failure-severity=error -f compact

aks.tf

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,23 @@ module "aks" {
2525
agents_labels = {
2626
"truefoundry" : "essential"
2727
}
28-
agents_count = local.intial_node_pool_instance_count
29-
agents_max_count = local.intial_node_pool_instance_count
30-
agents_min_count = local.intial_node_pool_instance_count
28+
agents_count = local.intial_node_pool_min_count
29+
agents_max_count = local.intial_node_pool_max_count
30+
agents_min_count = local.intial_node_pool_min_count
3131
agents_pool_name = "initial"
3232
agents_size = var.intial_node_pool_instance_type
3333
agents_tags = local.tags
3434

3535
# autoscaler configuration
3636
auto_scaler_profile_enabled = true
3737
auto_scaler_profile_expander = "random"
38+
auto_scaler_profile_max_graceful_termination_sec = "180"
3839
auto_scaler_profile_max_node_provisioning_time = "5m"
3940
auto_scaler_profile_max_unready_nodes = 0
40-
auto_scaler_profile_scale_down_delay_after_add = "5m"
41+
auto_scaler_profile_scale_down_delay_after_add = "2m"
4142
auto_scaler_profile_scale_down_delay_after_delete = "30s"
4243
auto_scaler_profile_scale_down_unneeded = "1m"
43-
auto_scaler_profile_scale_down_unready = "5m"
44+
auto_scaler_profile_scale_down_unready = "2m"
4445
auto_scaler_profile_scale_down_utilization_threshold = "0.3"
4546

4647
# cluster level configurations

locals.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ locals {
77
},
88
var.tags
99
)
10-
intial_node_pool_instance_count = var.control_plane ? 2 : 1
10+
intial_node_pool_min_count = var.control_plane ? 2 : 1
11+
intial_node_pool_max_count = var.control_plane ? 3 : 2
1112
node_pools = {
1213
spot = {
1314
name = "spotpool"

0 commit comments

Comments
 (0)