Skip to content

Commit 1148379

Browse files
committed
lose 512 MB to a bogus unused swap disk by default so we can save 90 seconds per machine for cloud-init (ugh)
1 parent a5f3a89 commit 1148379

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

docs/src/topics/disks/data-disks.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ There are a couple caveats with specifying disks for a linode instance:
88
2. Instance disk configuration is currently immutable via CAPL after the instance is booted.
99
~~~
1010

11+
```admonish warning
12+
By default, /dev/sdb is expected to be a swap disk that is waited for by a start job in cloud-init.
13+
Replacing this disk with a data disk will slow down linode creation by 90 seconds.
14+
```
15+
1116
## Specify a data disk
1217
A LinodeMachine can be configured with additional data disks with the key being the device to be mounted as and including an optional label and size.
1318

@@ -28,10 +33,10 @@ spec:
2833
region: us-ord
2934
type: g6-standard-4
3035
dataDisks:
31-
sdb:
36+
sdc:
3237
label: etcd_disk
3338
size: 16Gi
34-
sdc:
39+
sdd:
3540
label: data_disk
3641
size: 10Gi
3742
```
@@ -50,7 +55,7 @@ spec:
5055
region: us-ord
5156
type: g6-standard-4
5257
dataDisks:
53-
sdb:
58+
sdc:
5459
label: etcd_disk
5560
size: 16Gi
5661

@@ -64,7 +69,7 @@ spec:
6469
filesystems:
6570
- label: etcd_data
6671
filesystem: ext4
67-
device: /dev/sdb
72+
device: /dev/sdc
6873
mounts:
6974
- - LABEL=etcd_data
7075
- /var/lib/etcd_data

internal/controller/linodemachine_controller_helpers.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ func newCreateConfig(ctx context.Context, machineScope *scope.MachineScope, gzip
144144
}
145145

146146
createConfig.Booted = util.Pointer(false)
147-
// The user can configure a swap disk in LinodeMachine.Spec.DataDisks, but all our flavors set swapoff for all k8s distros
148-
createConfig.SwapSize = util.Pointer(0)
149147
if err := setUserData(ctx, machineScope, createConfig, gzipCompressionEnabled, logger); err != nil {
150148
return nil, err
151149
}

0 commit comments

Comments
 (0)