- Create EKS cluster with 3 nodes and install Longhorn.
- Create deployment and write some data to it.
- In Longhorn, set
replica-replenishment-wait-interval
to0
. - Go to the launch template of the EKS cluster node-group. You can find in the EKS cluster tab
Configuration/Compute/<node-group-name>
and click the launch template. - Click
Modify template (Create new version)
in theActions
drop-down menu. - Choose the
Source template version
in theLaunch template name and version description
. - Click
Advanced
thenAdd new volume
inConfigure storage
and fill in the fields. - Adjust the auto-mount script and add to
User data
inAdvanced details
. Make sure theDEV_PATH
matches theDevice name
of the additional volume.MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==MYBOUNDARY==" --==MYBOUNDARY== Content-Type: text/x-shellscript; charset="us-ascii" #!/bin/bash # https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html#launch-template-user-data echo "Running custom user data script" DEV_PATH="/dev/sdb" mkfs -t ext4 ${DEV_PATH} MOUNT_PATH="/mnt/longhorn" mkdir ${MOUNT_PATH} mount ${DEV_PATH} ${MOUNT_PATH}
- Click
Create template version
to save changes. - Go to the EKS cluster node-group and change
Launch template version
inNode Group configuration
. Track the status in theUpdate history
tab. - After update succeeded, check the deployment in step 2 still running and data exist, and check the extra volume can be added through Longhorn UI.