Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit 5480cf8

Browse files
committed
Incorporating PR feedback
Specifically adding configuration parameters with reasonable defaults, e.g. $ MEMORY=10240 DISK_SIZE=30g ./etc/scripts/install-on-minikube.sh
1 parent ec005cf commit 5480cf8

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

etc/scripts/install-on-minikube.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,34 @@
44
# thereby guaranteeing (hopefully) a clean environment upon successful
55
# completion.
66

7-
if minikube status | grep "host: Running" >/dev/null; then
7+
if minikube status 2>&1 | grep -E "^E[0-9]{4}"; then
8+
echo "minikube is confused, check for conflicting vm's, e.g. minishift"
9+
exit -1
10+
fi
11+
if minikube status | head -1 | grep "Running" >/dev/null; then
812
echo "Please stop your running minikube to acknowledge this script will destroy it."
913
exit 1
1014
fi
1115

1216
set -x
1317

18+
KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.11.5}
19+
MEMORY=${MEMORY:-8192}
20+
CPUS=${CPUS:-4}
21+
DISK_SIZE=${DISK_SIZE:-50g}
22+
1423
# blow away everything in the knative profile
1524
minikube delete --profile knative
1625

1726
# configure knative profile
1827
minikube profile knative
19-
minikube config set kubernetes-version v1.11.5 -p knative
20-
minikube config set memory 10240 -p knative
21-
minikube config set cpus 4 -p knative
22-
minikube config set disk-size 50g -p knative
28+
minikube config set kubernetes-version ${KUBERNETES_VERSION}
29+
minikube config set memory ${MEMORY}
30+
minikube config set cpus ${CPUS}
31+
minikube config set disk-size ${DISK_SIZE}
2332

2433
# Start minikube
2534
minikube start -p knative --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
2635

27-
#oc login -u admin -p admin
28-
2936
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
3037
"$DIR/install.sh" -q

etc/scripts/install-on-minishift.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,27 @@
44
# thereby guaranteeing (hopefully) a clean environment upon successful
55
# completion.
66

7-
if minishift status | grep "Minishift: Running" >/dev/null; then
7+
if minishift status | head -1 | grep "Running" >/dev/null; then
88
echo "Please stop your running minishift to acknowledge this script will destroy it."
99
exit 1
1010
fi
1111

1212
set -x
1313

14+
OPENSHIFT_VERSION=${OPENSHIFT_VERSION:-v3.11.0}
15+
MEMORY=${MEMORY:-10GB}
16+
CPUS=${CPUS:-4}
17+
DISK_SIZE=${DISK_SIZE:-50g}
18+
1419
# blow away everything in the knative profile
1520
minishift profile delete knative --force
1621

1722
# configure knative profile
1823
minishift profile set knative
19-
minishift config set openshift-version v3.11.0
20-
minishift config set memory 10GB
21-
minishift config set cpus 4
22-
minishift config set disk-size 50g
24+
minishift config set openshift-version ${OPENSHIFT_VERSION}
25+
minishift config set memory ${MEMORY}
26+
minishift config set cpus ${CPUS}
27+
minishift config set disk-size ${DISK_SIZE}
2328
minishift config set image-caching true
2429
minishift addons enable admin-user
2530

etc/scripts/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ if oc get ns openshift 2>/dev/null; then
5252
oc adm policy add-scc-to-user anyuid -z default
5353
else
5454
oc create namespace myproject
55-
oc label namespace myproject istio-injection=enabled
5655
oc project myproject
5756
fi
5857

etc/scripts/installation-functions.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function check_operatorgroups {
4949

5050
function enable_admission_webhooks {
5151
if check_openshift_4; then
52-
echo "Detected OpenShift 4 - skipping enabling admission webhooks."
52+
echo "Detected OpenShift 4 - skipping enabling admission webhooks"
5353
elif check_minikube; then
54-
echo "Detected minikube - skipping enabling admission webhooks."
54+
echo "Detected minikube - assuming admission webhooks enabled via --extra-config"
5555
elif check_minishift; then
5656
echo "Detected minishift - checking if admission webhooks are enabled."
5757
if ! minishift openshift config view --target=kube | grep ValidatingAdmissionWebhook >/dev/null; then
@@ -165,7 +165,6 @@ function install_istio {
165165
if check_minikube; then
166166
echo "Detected minikube - incompatible with Maistra operator, so installing upstream istio."
167167
oc apply -f "https://github.com/knative/serving/releases/download/${KNATIVE_SERVING_VERSION}/istio.yaml"
168-
oc label namespace default istio-injection=enabled
169168
wait_for_all_pods istio-system
170169
else
171170
oc create ns istio-operator

0 commit comments

Comments
 (0)