diff --git a/applications/minio-operator/v5.0.6/Kubefile b/applications/minio-operator/v5.0.6/Kubefile new file mode 100644 index 000000000..d628b52da --- /dev/null +++ b/applications/minio-operator/v5.0.6/Kubefile @@ -0,0 +1,8 @@ +FROM scratch + +ENV NAME=${NAME:-"minio-operator"} +ENV NAMESPACE=${NAMESPACE:-"minio-system"} + +COPY . . + +CMD ["bash entrypoint.sh"] \ No newline at end of file diff --git a/applications/minio-operator/v5.0.6/entrypoint.sh b/applications/minio-operator/v5.0.6/entrypoint.sh new file mode 100644 index 000000000..302822c6a --- /dev/null +++ b/applications/minio-operator/v5.0.6/entrypoint.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -e + +ARCHIVE="operator-5.0.6.tgz" + +if ! helm -n $NAMESPACE status $NAME &> /dev/null; then + if [ ! -f $ARCHIVE ]; then + wget $URL -O $ARCHIVE + fi + + helm install $NAME $ARCHIVE --namespace $NAMESPACE --create-namespace +else + echo "MinIO Operator is already installed. Skipping installation." +fi + +kubectl wait --for=condition=Available deployment/minio-operator -n $NAMESPACE + +echo "MinIO Operator is installed and ready." \ No newline at end of file diff --git a/applications/minio-operator/v5.0.6/init.sh b/applications/minio-operator/v5.0.6/init.sh new file mode 100644 index 000000000..0bdd041f2 --- /dev/null +++ b/applications/minio-operator/v5.0.6/init.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -e + +RetryPullFileInterval=3 +RetrySleepSeconds=3 +ARCHIVE="operator-5.0.6.tgz" + +retryPullFile() { + local file=$1 + local retry=0 + local retryMax=3 + set +e + while [ $retry -lt $RetryPullFileInterval ]; do + curl $file --create-dirs -o $ARCHIVE >/dev/null && break + retry=$(($retry + 1)) + echo "retry pull file $file, retry times: $retry" + sleep $RetrySleepSeconds + done + set -e + if [ $retry -eq $retryMax ]; then + echo "pull file $file failed" + exit 1 + fi +} + +retryPullFile https://raw.githubusercontent.com/minio/operator/master/helm-releases/operator-5.0.6.tgz \ No newline at end of file