Skip to content

refactor: use kubernetes custom resource to execute helm install #11

Open
@AmitKumarDas

Description

@AmitKumarDas

ProblemStatement: I want to simplify below codebase by dividing them into two separate blocks where each block is embedded into specific Kubernetes custom resources. These custom resources should be invoked only if they satisfy the eligibility criteria. These custom resources are engineered to handle executing the terminal commands as well as their outputs (stdop, stderr, streaming, timeout, retries, etc).

if [ "$USE_KUBERA_REPO" == "true" ]
then

  echo -e "\nDeploying Kubera using kubera-charts repo\n"
  echo -e "\nCloning $KUBERA_BRANCH branch of kubera-charts repo\n"
  git clone -b "$KUBERA_BRANCH" https://"$GIT_USERNAME":"$GIT_PASSWORD"@github.com/mayadata-io/kubera-charts.git
  cd kubera-charts

  echo -e "\nSet release version,openebsRCEnable,maxMemberCountInOneProject and URL"
  echo -e "\nInstalling Kubera using kubera-charts/values.yaml"
  helm install --namespace kubera kubera \
  --set server.url="$URL" \
  --set server.release="$RELEASE" \
  --set server.openebsRCEnable=true \
  --set server.maxMemberCountInOneProject=50 -f values.yaml .

else

  echo -e "\nDeploying Kubera using official Kubera charts\n"
  helm repo update

  echo -e "\nAdd kubera in local repository"
  helm repo add kubera https://charts.mayadata.io/

  echo -e "\nApply helm chart"
  helm install kubera kubera/kubera-charts \
  --set server.url="$URL" \
  --set server.release="$RELEASE" \
  --set server.maxMemberCountInOneProject=100 \
  --set server.openebsRCEnable=true \
  -n kubera

fi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions