Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a4932454
Commit
a4932454
authored
Sep 11, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13803 from justinsb/aws_aufs_one_volume
Auto commit by PR queue bot
parents
b67aa39c
9f4ec648
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
+30
-24
format-disks.sh
cluster/aws/templates/format-disks.sh
+30
-24
No files found.
cluster/aws/templates/format-disks.sh
View file @
a4932454
...
@@ -118,45 +118,51 @@ else
...
@@ -118,45 +118,51 @@ else
# This is the best option, but it is sadly broken on most distros
# This is the best option, but it is sadly broken on most distros
# Bug: https://github.com/docker/docker/issues/4036
# Bug: https://github.com/docker/docker/issues/4036
#
95% goes to the docker thin-pool
#
80% goes to the docker thin-pool; we want to leave some space for host-volumes
lvcreate
-l
95
%VG
--thinpool
docker-thinpool vg-ephemeral
lvcreate
-l
80
%VG
--thinpool
docker-thinpool vg-ephemeral
DOCKER_OPTS
=
"
${
DOCKER_OPTS
}
--storage-opt dm.thinpooldev=/dev/mapper/vg--ephemeral-docker--thinpool"
DOCKER_OPTS
=
"
${
DOCKER_OPTS
}
--storage-opt dm.thinpooldev=/dev/mapper/vg--ephemeral-docker--thinpool"
# Note that we don't move docker; docker goes direct to the thinpool
# Note that we don't move docker; docker goes direct to the thinpool
else
# Remaining space (20%) is for kubernetes data
# TODO: Should this be a thin pool? e.g. would we ever want to snapshot this data?
lvcreate
-l
100%FREE
-n
kubernetes vg-ephemeral
mkfs
-t
ext4 /dev/vg-ephemeral/kubernetes
mkdir
-p
/mnt/ephemeral/kubernetes
echo
"/dev/vg-ephemeral/kubernetes /mnt/ephemeral/kubernetes ext4 noatime 0 0"
>>
/etc/fstab
mount /mnt/ephemeral/kubernetes
move_kubelet
=
"/mnt/ephemeral/kubernetes"
else
# aufs
# aufs
# Create a docker lv, use docker on it
# We used to split docker & kubernetes, but we no longer do that, because
# 95% goes to the docker thin-pool
# host volumes go into the kubernetes area, and it is otherwise very easy
# to fill up small volumes.
release
=
`
lsb_release
-c
-s
`
release
=
`
lsb_release
-c
-s
`
if
[[
"
${
release
}
"
!=
"wheezy"
]]
;
then
if
[[
"
${
release
}
"
!=
"wheezy"
]]
;
then
lvcreate
-l
95%VG
--thinpool
docker-thinpoo
l vg-ephemeral
lvcreate
-l
100%FREE
--thinpool
pool-ephemera
l vg-ephemeral
THINPOOL_SIZE
=
$(
lvs vg-ephemeral/
docker-thinpoo
l
-o
LV_SIZE
--noheadings
--units
M
--nosuffix
)
THINPOOL_SIZE
=
$(
lvs vg-ephemeral/
pool-ephemera
l
-o
LV_SIZE
--noheadings
--units
M
--nosuffix
)
lvcreate
-V
${
THINPOOL_SIZE
}
M
-T
vg-ephemeral/
docker-thinpool
-n
docker
lvcreate
-V
${
THINPOOL_SIZE
}
M
-T
vg-ephemeral/
pool-ephemeral
-n
ephemeral
else
else
# Thin provisioning not supported by Wheezy
# Thin provisioning not supported by Wheezy
echo
"Detected wheezy; won't use LVM thin provisioning"
echo
"Detected wheezy; won't use LVM thin provisioning"
lvcreate
-l
95%VG
-n
docker
vg-ephemeral
lvcreate
-l
100%VG
-n
ephemeral
vg-ephemeral
fi
fi
mkfs
-t
ext4 /dev/vg-ephemeral/docker
mkfs
-t
ext4 /dev/vg-ephemeral/ephemeral
mkdir
-p
/mnt/ephemeral/docker
mkdir
-p
/mnt/ephemeral
echo
"/dev/vg-ephemeral/docker /mnt/ephemeral/docker ext4 noatime 0 0"
>>
/etc/fstab
echo
"/dev/vg-ephemeral/ephemeral /mnt/ephemeral ext4 noatime 0 0"
>>
/etc/fstab
mount /mnt/ephemeral/docker
mount /mnt/ephemeral
move_docker
=
"/mnt/ephemeral"
fi
# Remaining 5% is for kubernetes data
mkdir
-p
/mnt/ephemeral/kubernetes
# TODO: Should this be a thin pool? e.g. would we ever want to snapshot this data?
lvcreate
-l
100%FREE
-n
kubernetes vg-ephemeral
mkfs
-t
ext4 /dev/vg-ephemeral/kubernetes
mkdir
-p
/mnt/ephemeral/kubernetes
echo
"/dev/vg-ephemeral/kubernetes /mnt/ephemeral/kubernetes ext4 noatime 0 0"
>>
/etc/fstab
mount /mnt/ephemeral/kubernetes
move_kubelet
=
"/mnt/ephemeral/kubernetes"
move_docker
=
"/mnt/ephemeral"
else
move_kubelet
=
"/mnt/ephemeral/kubernetes"
fi
else
echo
"Ignoring unknown DOCKER_STORAGE:
${
docker_storage
}
"
echo
"Ignoring unknown DOCKER_STORAGE:
${
docker_storage
}
"
fi
fi
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment