Skip to content

Commit 27e811f

Browse files
committed
Add support to upgrade node pools in place
Node pool recreation should be done by creating a new pool and then deleting the old one. WIth static names this cannot be done. [static] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
1 parent 90970f6 commit 27e811f

File tree

2 files changed

+48
-40
lines changed

2 files changed

+48
-40
lines changed

cluster/expected/cluster/expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"cluster": "cn-mocknet",
1111
"initialNodeCount": 0,
12-
"name": "cn-apps-pool",
12+
"namePrefix": "cn-apps-pool",
1313
"nodeConfig": {
1414
"labels": {
1515
"cn_apps": "true"
@@ -38,7 +38,7 @@
3838
},
3939
"cluster": "cn-mocknet",
4040
"initialNodeCount": 1,
41-
"name": "cn-infra-pool",
41+
"namePrefix": "cn-infra-pool",
4242
"nodeConfig": {
4343
"labels": {
4444
"cn_infra": "true"

cluster/pulumi/cluster/src/nodePools.ts

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,59 @@ export function installNodePools(): void {
1111
? `projects/${GCP_PROJECT}/locations/${config.requireEnv('CLOUDSDK_COMPUTE_ZONE')}/clusters/${clusterName}`
1212
: clusterName;
1313

14-
new gcp.container.NodePool('cn-apps-node-pool', {
15-
name: 'cn-apps-pool',
16-
cluster,
17-
nodeConfig: {
18-
machineType: gkeClusterConfig.nodePools.apps.nodeType,
19-
taints: [
20-
{
21-
effect: 'NO_SCHEDULE',
22-
key: 'cn_apps',
23-
value: 'true',
14+
new gcp.container.NodePool(
15+
'cn-apps-node-pool',
16+
{
17+
namePrefix: 'cn-apps-pool',
18+
cluster,
19+
nodeConfig: {
20+
machineType: gkeClusterConfig.nodePools.apps.nodeType,
21+
taints: [
22+
{
23+
effect: 'NO_SCHEDULE',
24+
key: 'cn_apps',
25+
value: 'true',
26+
},
27+
],
28+
labels: {
29+
cn_apps: 'true',
2430
},
25-
],
26-
labels: {
27-
cn_apps: 'true',
31+
},
32+
initialNodeCount: 0,
33+
autoscaling: {
34+
minNodeCount: gkeClusterConfig.nodePools.apps.minNodes,
35+
maxNodeCount: gkeClusterConfig.nodePools.apps.maxNodes,
2836
},
2937
},
30-
initialNodeCount: 0,
31-
autoscaling: {
32-
minNodeCount: gkeClusterConfig.nodePools.apps.minNodes,
33-
maxNodeCount: gkeClusterConfig.nodePools.apps.maxNodes,
34-
},
35-
});
38+
{ aliases: [{ name: 'cn-apps-pool' }] }
39+
);
3640

37-
new gcp.container.NodePool('cn-infra-node-pool', {
38-
name: 'cn-infra-pool',
39-
cluster,
40-
nodeConfig: {
41-
machineType: gkeClusterConfig.nodePools.infra.nodeType,
42-
taints: [
43-
{
44-
effect: 'NO_SCHEDULE',
45-
key: 'cn_infra',
46-
value: 'true',
41+
new gcp.container.NodePool(
42+
'cn-infra-node-pool',
43+
{
44+
namePrefix: 'cn-infra-pool',
45+
cluster,
46+
nodeConfig: {
47+
machineType: gkeClusterConfig.nodePools.infra.nodeType,
48+
taints: [
49+
{
50+
effect: 'NO_SCHEDULE',
51+
key: 'cn_infra',
52+
value: 'true',
53+
},
54+
],
55+
labels: {
56+
cn_infra: 'true',
4757
},
48-
],
49-
labels: {
50-
cn_infra: 'true',
58+
},
59+
initialNodeCount: 1,
60+
autoscaling: {
61+
minNodeCount: gkeClusterConfig.nodePools.infra.minNodes,
62+
maxNodeCount: gkeClusterConfig.nodePools.infra.maxNodes,
5163
},
5264
},
53-
initialNodeCount: 1,
54-
autoscaling: {
55-
minNodeCount: gkeClusterConfig.nodePools.infra.minNodes,
56-
maxNodeCount: gkeClusterConfig.nodePools.infra.maxNodes,
57-
},
58-
});
65+
{ aliases: [{ name: 'cn-infra-pool' }] }
66+
);
5967

6068
new gcp.container.NodePool('gke-node-pool', {
6169
name: 'gke-pool',

0 commit comments

Comments
 (0)