Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installing from local installer scripts #208

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions hack/deploy/kubedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export KUBEDB_IMAGE_PULL_SECRET=
export KUBEDB_UNINSTALL=0
export KUBEDB_PURGE=0

export APPSCODE_ENV=${APPSCODE_ENV:-prod}
export SCRIPT_LOCATION="curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/"
if [ "$APPSCODE_ENV" = "dev" ]; then
export SCRIPT_LOCATION="cat "
fi

KUBE_APISERVER_VERSION=$(kubectl version -o=json | $ONESSL jsonpath '{.serverVersion.gitVersion}')
$ONESSL semver --check='<1.9.0' $KUBE_APISERVER_VERSION || { export KUBEDB_ENABLE_ADMISSION_WEBHOOK=true; }

Expand Down Expand Up @@ -216,23 +222,23 @@ export TLS_SERVING_CERT=$(cat server.crt | $ONESSL base64)
export TLS_SERVING_KEY=$(cat server.key | $ONESSL base64)
export KUBE_CA=$($ONESSL get kube-ca | $ONESSL base64)

curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/hack/deploy/operator.yaml | $ONESSL envsubst | kubectl apply -f -
${SCRIPT_LOCATION}hack/deploy/operator.yaml | $ONESSL envsubst | kubectl apply -f -

if [ "$KUBEDB_ENABLE_RBAC" = true ]; then
kubectl create serviceaccount $KUBEDB_SERVICE_ACCOUNT --namespace $KUBEDB_NAMESPACE
kubectl label serviceaccount $KUBEDB_SERVICE_ACCOUNT app=kubedb --namespace $KUBEDB_NAMESPACE
curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/hack/deploy/rbac-list.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/hack/deploy/user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
${SCRIPT_LOCATION}hack/deploy/rbac-list.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
${SCRIPT_LOCATION}hack/deploy/user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -

fi

if [ "$KUBEDB_RUN_ON_MASTER" -eq 1 ]; then
kubectl patch deploy kubedb-operator -n $KUBEDB_NAMESPACE \
--patch="$(curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/hack/deploy/run-on-master.yaml)"
--patch="$(${SCRIPT_LOCATION}hack/deploy/run-on-master.yaml)"
fi

if [ "$KUBEDB_ENABLE_ADMISSION_WEBHOOK" = true ]; then
curl -fsSL https://github.com/raw/kubedb/cli/0.8.0-beta.2/hack/deploy/admission.yaml | $ONESSL envsubst | kubectl apply -f -
${SCRIPT_LOCATION}hack/deploy/admission.yaml | $ONESSL envsubst | kubectl apply -f -
fi

echo
Expand Down