Skip to content

Instantly share code, notes, and snippets.

@matzew
Last active October 8, 2018 14:52
Show Gist options
  • Save matzew/2f9df694b9733605b14ac501ecf7575b to your computer and use it in GitHub Desktop.
Save matzew/2f9df694b9733605b14ac501ecf7575b to your computer and use it in GitHub Desktop.
## oc v3.11.0-alpha.0+f7602dd-1284
## kubernetes v1.11.0+d4cacc0
## features: Basic-Auth GSSAPI Kerberos SPNEGO
##
## Server https://192.168.42.142:8443
## kubernetes v1.11.0+d4cacc0
minishift profile set knative
# Ensuring the preflight checks are not done as an unreleased OpenShift version is used
minishift config set skip-startup-checks true
# Pinning to the right unreleased version needed in this case v3.11.0
minishift config set openshift-version v3.11.0
# memory for the vm
minishift config set memory 8GB
# the vCpus for the vm
minishift config set cpus 4
# extra disk size for the vm
minishift config set disk-size 50g
# caching the images that will be downloaded during app deployments
minishift config set image-caching true
# Add new user called admin with password with role cluster-admin
minishift addons enable admin-user
# Allow the containers to be run with uid 0
minishift addons enable anyuid
# Start minishift
minishift start knative
eval $(minishift oc-env)
# Enable admission controller webhooks
# The configuration stanzas below look weird and are just to workaround
# https://bugzilla.redhat.com/show_bug.cgi?id=1635918
minishift openshift config set --target=kube --patch '{
"admissionConfig": {
"pluginConfig": {
"ValidatingAdmissionWebhook": {
"configuration": {
"apiVersion": "apiserver.config.k8s.io/v1alpha1",
"kind": "WebhookAdmission",
"kubeConfigFile": "/dev/null"
}
},
"MutatingAdmissionWebhook": {
"configuration": {
"apiVersion": "apiserver.config.k8s.io/v1alpha1",
"kind": "WebhookAdmission",
"kubeConfigFile": "/dev/null"
}
}
}
}
}'
# It may take a few minutes for OpenShift to restart after running the above command
# If the oc login command below fails, wait a bit and try again
oc login -u admin -p admin
oc project myproject
oc adm policy add-scc-to-user privileged -z default
git clone https://github.com/minishift/minishift-addons
minishift addon install ./minishift-addons/add-ons/istio
minishift addon enable istio
minishift addon apply istio
##oc -n istio-system get pods -w --as system:admin
sleep 5; while echo && oc -n istio-system get pods | grep -v -E "(Running|Completed|STATUS)"; do sleep 5; done
##### The CM for privilaged... was NOT updated!!!!!!!
oc login -u admin -p admin
oc project myproject
oc adm policy add-scc-to-user privileged -z default
## KNATIVE
# Grant the necessary privileges to the service accounts Knative will use:
oc adm policy add-scc-to-user anyuid -z build-controller -n knative-build
oc adm policy add-scc-to-user anyuid -z controller -n knative-serving
oc adm policy add-scc-to-user anyuid -z autoscaler -n knative-serving
oc adm policy add-cluster-role-to-user cluster-admin -z build-controller -n knative-build
oc adm policy add-cluster-role-to-user cluster-admin -z controller -n knative-serving
# Install Knative - the release-no-mon.yaml gives us the lightest install possible
curl -L https://storage.googleapis.com/knative-releases/serving/latest/release-no-mon.yaml \
| sed 's/LoadBalancer/NodePort/' \
| oc apply -f -
# Monitor the Knative components until all of the components show a STATUS of Running:
oc get pods -n knative-serving
oc get pods -n knative-build
## Installed
### gcr.io/knative-samples/helloworld-go worked
############### EVENTING
oc adm policy add-scc-to-user anyuid -z eventing-controller -n knative-eventing
oc adm policy add-cluster-role-to-user cluster-admin -z eventing-controller -n knative-eventing
## Eventing w/ kafka as the bus (not stub)
curl -L https://storage.googleapis.com/knative-releases/eventing/latest/release.yaml \
| sed 's/default-cluster-bus: stub/default-cluster-bus: kafka/' \
| oc apply -f -
wget https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.7.0/strimzi-0.7.0.tar.gz
tar xfvz strimzi-0.7.0.tar.gz
cd strimzi-0.7.0
oc adm policy add-scc-to-user restricted -z strimzi-cluster-operator -n myproject
oc adm policy add-scc-to-user anyuid -z strimzi-cluster-operator -n myproject
oc adm policy add-scc-to-user anyuid -z my-cluster-zookeeper-0 -n myproject
oc apply -f examples/install/cluster-operator -n myproject
oc apply -f examples/templates/cluster-operator -n myproject
#WAIT for the operator............
oc apply -f https://raw.githubusercontent.com/knative/eventing/master/config/buses/kafka/strimzi/kafka-persistent.yaml
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment