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

update install script to install into openshift and non default namespaces #19

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The prototype is (hopefully) easy to set up and use - you should be able to get
1. Edit `core/chat-app/config/100-chat-app-credentials.secret.yaml` to include your api key
1. Ensure that Knative Functions is installed on your machine. For installation instructions, see [here](https://knative.dev/docs/functions/install-func/)
1. With your credentials set up so that `kubectl` has access to a running cluster, run `./hack/install.sh`. If you do not already have Knative Serving and Eventing
installed in your cluster, you can instead run `FULL_INSTALL=true ./hack/install.sh`
installed in your cluster, you can instead run `FULL_INSTALL=true ./hack/install.sh`. To configure which namespace the chat app resources are installed into,
set the `CHAT_NAMESPACE` environment variable. If you are installing in openshift, please set `OPENSHIFT=true`.

You will now have a cluster with everything installed and working! If anything did not work in this process, please open a GitHub issue.

Expand Down
24 changes: 19 additions & 5 deletions hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ function wait_for_deployments() {
kubectl wait deployment --all --timeout=-1s --for=condition=Available -n "$1"
}

if [[ -z $CHAT_NAMESPACE ]]; then
export CHAT_NAMESPACE=default
fi

if [[ $OPENSHIFT ]]; then
func_args=("-b=s2i" "--build")
else
func_args=()
fi

if [[ $FULL_INSTALL ]]; then
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.14.1/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.14.1/serving-core.yaml
Expand All @@ -23,10 +33,14 @@ if [[ $FULL_INSTALL ]]; then
wait_for_deployments "knative-eventing"
fi

(cd tools/resource-cost-calculator && func deploy)
(cd tools/average-resource-consumption && func deploy)
(cd tools/resource-cost-calculator && func deploy -n $CHAT_NAMESPACE "${func_args[@]}")
(cd tools/average-resource-consumption && func deploy -n $CHAT_NAMESPACE "${func_args[@]}")

(cd core/request-proxy && ko apply -f ./config -- -n $CHAT_NAMESPACE)
kubectl apply -f ./core/chat-app/config -n $CHAT_NAMESPACE

(cd core/request-proxy && ko apply -f ./config)
kubectl apply -f ./core/chat-app/config
if [[ $OPENSHIFT ]]; then
kubectl apply -f ./core/chat-app/config/openshift
fi

wait_for_deployments "default"
wait_for_deployments $CHAT_NAMESPACE