Skip to content

Commit

Permalink
Fixed issue-1176: Reduce resource requests while installing minio
Browse files Browse the repository at this point in the history
- Added configurable persistence size option in minio.sh, defaults
to 2Gi
- Set resources.requests.memory to 2Gi
- Updated usage message

Signed-off-by: Pratik Shah <pratik@infracloud.io>
  • Loading branch information
shahpratikr committed Feb 9, 2023
1 parent 263b072 commit e32c860
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ vm-driver ?= "kvm"

# Default OCP version in which the OpenShift apps are going to run
ocp_version ?= "4.11"

# PVC size to use while installing minio
pvc_size ?= "2Gi"

###
### These variables should not need tweaking.
###
Expand Down Expand Up @@ -271,7 +275,7 @@ tiller:
@/bin/bash ./build/init_tiller.sh

install-minio:
@$(MAKE) run CMD='-c "./build/minio.sh install_minio"'
@$(MAKE) run CMD='-c "./build/minio.sh install_minio $(pvc_size)"'

install-csi-hostpath-driver:
@$(MAKE) run CMD='-c "./build/local_kubernetes.sh install_csi_hostpath_driver"'
Expand Down
18 changes: 13 additions & 5 deletions build/minio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MINIO_CHART_VERSION="8.0.0"

install_minio ()
{
local pvc_size=${2:-"2Gi"}
echo "Deploying minio..."
# Add minio helm repo
helm repo add minio https://helm.min.io/
Expand All @@ -37,6 +38,7 @@ install_minio ()
--set environment.MINIO_SSE_AUTO_ENCRYPTION=on \
--set environment.MINIO_SSE_MASTER_KEY=my-minio-key:feb5bb6c5cf851e21dbc0376ca81012a9edc4ca0ceeb9df5064ccba2991ae9de \
--set accessKey="AKIAIOSFODNN7EXAMPLE",secretKey="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
--set resources.requests.memory=2Gi,persistence.size=${pvc_size} \
minio/minio --wait --timeout 3m

# export default creds for minio
Expand All @@ -60,10 +62,16 @@ uninstall_minio ()

usage() {
cat <<EOM
Usage: ${0} <operation>
Where operation is one of the following:
install_minio: installs minio on k8s cluster
uninstall_minio: uninstalls minio
Usage:
${0} install_minio [<pvc_size>]
${0} uninstall_minio
Optional arguments:
pvc_size: Specify persistence size to helm chart. Defaults to 2Gi
Commands:
install_minio: installs minio on k8s cluster
uninstall_minio: uninstalls minio from k8s cluster
EOM
exit 1
}
Expand All @@ -72,7 +80,7 @@ EOM
case "${1}" in
# Alphabetically sorted
install_minio)
time -p install_minio
time -p install_minio ${@}
;;
uninstall_minio)
time -p uninstall_minio
Expand Down

0 comments on commit e32c860

Please sign in to comment.