Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Add check if container memory is sufficient to install cluster (#67)
Browse files Browse the repository at this point in the history
Fixes #66
  • Loading branch information
fmui authored Feb 7, 2021
1 parent 98fbb80 commit 06657bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions create-cluster-k3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ set -o errexit
SECONDS=0
REGISTRY_CONFIG=${1:-registries.yaml}

# Check memory
MEMORY=8192
REQUIRED_MEMORY=$(expr $MEMORY \* 1024 \* 1024)
DOCKER_MEMEORY=$(docker info --format '{{json .MemTotal}}')

if (( $REQUIRED_MEMORY > $DOCKER_MEMEORY )); then
echo "Container memory in not sufficient. Please configure Docker to support containers with at least ${MEMORY} MB."
exit 1
fi

# Create docker network
docker network create k3d-kyma || echo "k3d-kyma network already exists"

Expand Down

0 comments on commit 06657bf

Please sign in to comment.