Skip to content

Commit 648100d

Browse files
committed
(upgrade): Setup upgrade to v0.4.0
- add seperate variables for each knative components - seperated minkube and openshift setup Fixes: #68
1 parent 3ece188 commit 648100d

4 files changed

Lines changed: 254 additions & 245 deletions

File tree

documentation/modules/ROOT/pages/01-setup.adoc

Lines changed: 7 additions & 236 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ The following CLI tools are required for running the exercises in this tutorial.
2929
| `sudo curl --output /usr/local/bin/stern -L https://github.com/wercker/stern/releases/download/1.6.0/stern_linux_amd64 && sudo chmod +x /usr/local/bin/stern`
3030
|
3131

32-
| http://xmlstar.sourceforge.net/[xmlstarlet]
33-
| `brew install xmlstarlet`
34-
| http://xmlstar.sourceforge.net/
35-
|
36-
3732
| https://github.com/mikefarah/yq[yq]
3833
| `brew install yq`
3934
| https://github.com/mikefarah/yq/releases/latest
@@ -49,11 +44,6 @@ The following CLI tools are required for running the exercises in this tutorial.
4944
| https://github.com/JoeDog/siege
5045
|
5146

52-
| https://jsonnet.org/
53-
|`brew install jsonnet`
54-
| https://github.com/google/jsonnet
55-
|
56-
5747
| watch
5848
|`brew install watch`
5949
| it will be pre-installed
@@ -76,241 +66,22 @@ git clone https://github.com/redhat-developer-demos/knative-tutorial
7666

7767
The `work` folder in `$TUTORIAL_HOME` can be used to download the demo application resources and refer them during the exercises. The `work` folder has a README, which has instructions on source code repo and git commands to clone the sources.
7868

79-
[IMPORTANT]
69+
[IMPORTANT,subs="+macros,+attributes"]
8070
====
8171
8272
This tutorial was developed and tested with:
8373
84-
- Knative `v0.3.0`
85-
- minikube `v0.34.1`
86-
- OpenShift `v3.11`
87-
- minishift `v1.30.0+186b034`
74+
- Knative `{knative-version}`
75+
- minikube `{minikube-version}`
76+
- OpenShift `{openshift-version}`
77+
- minishift `{minishift-version}`
8878
====
8979

9080
[#kubernetes-cluster]
9181
== Kubernetes Cluster
9282

93-
[#install-knative-minikube]
94-
=== Minikube
95-
96-
[#start-minikube]
97-
==== Configure and Start minikube
98-
99-
Before installing Knative and its components, we need to add few startup config to minikube.
100-
101-
[source,bash,subs="+macros,+attributes"]
102-
----
103-
minikube profile knative \#<1>
104-
105-
minikube start -p knative --memory=8192 --cpus=4 \#<2>
106-
--kubernetes-version=v1.12.0 \#<3>
107-
--vm-driver=hyperkit \#<4>
108-
--disk-size=50g \
109-
--extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
110-
----
111-
112-
<1> Setting minikube profile to **knative** so that all future minikube commands are executed with this profile context
113-
<2> Starting a profile named **knative**
114-
<3> Minimum kubernetes version needs to be >= 1.12.0, refer to issue https://github.com/knative/serving/issues/3067 for more details.
115-
<4> If you are on linux then use `--vm-driver=kvm2`
116-
117-
[#install-knative-istio]
118-
==== Install Istio
119-
120-
[source,bash,subs="+macros,+attributes"]
121-
----
122-
kubectl apply --filename {knative-serving-repo}/{knative-version}/istio-crds.yaml
123-
kubectl apply --filename {knative-serving-repo}/{knative-version}/istio.yaml
124-
----
125-
126-
[NOTE]
127-
====
128-
Installation of istio components will take some time and its highly recommended that you start Knative components installation only after you see all istio component pods are running. The istio pods can be watched using the command:
129-
[source,bash,subs="+macros,+attributes"]
130-
----
131-
kubectl -n istio-system get pods -w
132-
----
133-
You can use kbd:[CTRL + c ] to terminate the watch
134-
====
135-
136-
A successful istio install will have the pods running in `istio-system` namespace as shown below:
137-
138-
[source,bash]
139-
----
140-
NAME READY STATUS RESTARTS AGE
141-
cluster-local-gateway-547467ccf6-857mx 1/1 Running 0 6h35m
142-
istio-citadel-7d64db8bcf-xgdh7 1/1 Running 0 6h35m
143-
istio-cleanup-secrets-7mjbl 0/1 Completed 0 6h35m
144-
istio-egressgateway-6ddf4c8bd6-sglg6 1/1 Running 0 6h35m
145-
istio-galley-7dd996474-4jhr4 1/1 Running 0 6h35m
146-
istio-ingressgateway-84b89d647f-f9n4h 1/1 Running 0 6h35m
147-
istio-pilot-86bb4fcbbd-ptz7n 2/2 Running 0 6h35m
148-
istio-pilot-86bb4fcbbd-s9qxl 2/2 Running 0 6h34m
149-
istio-pilot-86bb4fcbbd-xd887 2/2 Running 0 6h34m
150-
istio-policy-5c4d9ff96b-tzkbw 2/2 Running 0 6h35m
151-
istio-sidecar-injector-6977b5cf5b-9wsjw 1/1 Running 0 6h35m
152-
istio-statsd-prom-bridge-b44b96d7b-x85xr 1/1 Running 0 6h35m
153-
istio-telemetry-7676df547f-55p6c 2/2 Running 0 6h35m
154-
knative-ingressgateway-75644679c7-5xwx6 1/1 Running 0 6h27m
155-
----
156-
157-
[#install-knative-serving]
158-
===== **Install Knative Serving**
159-
160-
[source,bash,subs="+macros,+attributes"]
161-
----
162-
kubectl apply --filename {knative-serving-repo}/{knative-version}/serving.yaml
163-
----
164-
165-
[NOTE]
166-
====
167-
Installation of knative serving components will take some time, the status of the knative serving pods can be watched using the command:
168-
[source,bash,subs="+macros,+attributes"]
169-
----
170-
kubectl -n knative-serving get pods -w
171-
----
172-
You can use kbd:[CTRL + c ] to terminate the watch
173-
====
174-
175-
A successful Knative serving install will have the pods running in `knative-serving` as shown below:
176-
177-
[source,bash]
178-
----
179-
NAME READY STATUS RESTARTS AGE
180-
activator-69b8474d6b-fhnwq 2/2 Running 0 6h33m
181-
autoscaler-6579b57774-lcjd2 2/2 Running 0 6h33m
182-
controller-66cd7d99df-6lt2t 1/1 Running 0 6h33m
183-
webhook-6d9568d-htxlt 1/1 Running 0 6h33m
184-
----
185-
186-
[#install-knative-build]
187-
===== **Install Knative Build**
188-
189-
[source,bash,subs="+macros,+attributes"]
190-
----
191-
kubectl apply --filename {knative-build-repo}/{knative-version}/release.yaml
192-
----
193-
194-
[NOTE]
195-
====
196-
Installation of knative build components will take some time, the status of the knative serving pods can be watched using the command:
197-
[source,bash,subs="+macros,+attributes"]
198-
----
199-
kubectl -n knative-build get pods -w
200-
----
201-
You can use kbd:[CTRL + c ] to terminate the watch
202-
====
203-
204-
A successful Knative build install will have the pods running in `knative-build` as shown below:
205-
206-
[source,bash]
207-
----
208-
NAME READY STATUS RESTARTS AGE
209-
build-controller-658d64d9bd-4m7l9 1/1 Running 0 6h32m
210-
build-webhook-6bb747665f-trjxg 1/1 Running 0 6h32m
211-
----
212-
213-
[#install-knative-eventing]
214-
===== **Install Knative Eventing**
215-
216-
[source,bash,subs="+macros,+attributes"]
217-
----
218-
kubectl apply --filename {knative-eventing-repo}/{knative-version}/release.yaml
219-
kubectl apply --filename {knative-eventing-repo}/{knative-version}/in-memory-channel.yaml
220-
kubectl apply --filename {knative-sources-repo}/{knative-version}/release.yaml
221-
----
222-
223-
[NOTE]
224-
====
225-
Installation of knative eventing components will take some time, the status of the knative serving pods can be watched using the command:
226-
[source,bash,subs="+macros,+attributes"]
227-
----
228-
kubectl -n knative-sources get pods -w
229-
kubectl -n knative-eventing get pods -w
230-
----
231-
You can use kbd:[CTRL + c ] to terminate the watch
232-
====
233-
234-
A successful Knative eventing install will have the pods running `knative-eventing` and `knative-sources` in as shown below:
235-
236-
.knative-eventing namespace
237-
238-
[source,bash]
239-
----
240-
NAME READY STATUS RESTARTS AGE
241-
eventing-controller-cfbb757bd-lg5zk 1/1 Running 0 6h35m
242-
in-memory-channel-controller-75d6cc4b77-f8bfl 1/1 Running 0 6h35m
243-
in-memory-channel-dispatcher-c89db8bb8-ktr26 2/2 Running 1 6h35m
244-
webhook-5fbb8dbcc7-gk6cx 1/1 Running 0 6h35m
245-
----
246-
247-
.knative-sources namespace
248-
249-
[source,bash]
250-
----
251-
NAME READY STATUS RESTARTS AGE
252-
controller-manager-0 1/1 Running 0 6h35m
253-
----
254-
255-
[#set-knative-tutorial-ns]
256-
==== Configuring Kubernetes namespace
257-
258-
We will use a non default kubernetes namespace called `knativetutorial` for all the tutorial exercises.
259-
260-
[source,bash]
261-
----
262-
kubectl create namespace knativetutorial
263-
----
264-
265-
[#install-knative-openshift]
266-
=== OpenShift
267-
268-
For OpenShift Knative installations we will use the OpenShift Cloud Function's https://github.com/openshift-cloud-functions/knative-operators[Knative Operators].
269-
270-
Clone the Knative Operator sources locally:
271-
272-
[source,bash,linenums]
273-
-----
274-
cd $TUTORIAL_HOME/work
275-
git clone https://github.com/openshift-cloud-functions/knative-operators
276-
cd knative-operators
277-
-----
278-
279-
[#install-knative-ocp]
280-
==== OCP
281-
282-
If you have an existing OpenShift cluster then run the following commands:
283-
284-
[source,bash,linenums]
285-
-----
286-
./etc/scripts/install.sh
287-
-----
288-
289-
If you need more details about the installation or customizations refer https://github.com/openshift-cloud-functions/Documentation/blob/master/knative-OCP.md[Knative with OpenShift].
290-
291-
[#install-knative-minishift]
292-
==== minishift
293-
294-
Run the following commands to configure Knative with minishift:
295-
296-
[source,bash,linenums]
297-
-----
298-
./etc/scripts/install-on-minishift.sh #<1>
299-
-----
300-
301-
<1> It will create a minishift profile and install knative. It also assumes that you already have minishift and your computer has 10GB or more of memory
302-
303-
[#configure-openshift-project]
304-
==== Configuring OpenShift project for Knative applications
305-
306-
[source,bash,linenums]
307-
----
308-
oc new-project knativetutorial
309-
oc adm policy add-scc-to-user privileged -z default #<1>
310-
oc adm policy add-scc-to-user anyuid -z default
311-
----
312-
313-
<1> The `oc adm policy` adds the **privileged** https://docs.okd.io/3.10/admin_guide/manage_scc.html[Security Context Constraints(SCCs)]to the **default** Service Account. The SCCs are the precursor to the PSP (Pod Security Policy) mechanism in kubernetes.
83+
include::partial$minikube-setup.adoc[]
84+
include::partial$openshift-setup.adoc[]
31485

31586
[#setup-work-folder]
31687
== Work folder
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
:moduledir: ..
22
:branch: master
33
:github-repo: https://github.com/redhat-developer-demos/knative-tutorial/blob/{branch}
4-
:basics-repo: 01-basics
5-
:configs-and-routes-repo: 02-configs-and-routes
6-
:scaling-repo: 03-scaling
7-
:build-repo: 04-build
8-
:eventing-repo: 05-eventing
4+
:basics-repo: 02-basics
5+
:configs-and-routes-repo: 03-configs-and-routes
6+
:scaling-repo: 04-scaling
7+
:build-repo: 05-build
8+
:eventing-repo: 06-eventing
99
:experimental:
10-
:knative-version: v0.3.0
11-
:knative-serving-uri: https://github.com/knative/serving
12-
:knative-serving-repo: {knative-serving-uri}/releases/download
10+
:minikube-version: v1.0.0
11+
:knative-version: v0.4.0
12+
:openshift-version: v3.11
13+
:minishift-version: v1.30.0+186b034
14+
15+
:knative-serving-repo: https://github.com/knative/serving/releases/download
16+
:knative-serving-version: v0.4.0
1317
:knative-build-repo: https://github.com/knative/build/releases/download
18+
:knative-build-version: v0.4.0
1419
:knative-eventing-repo: https://github.com/knative/eventing/releases/download
15-
:knative-sources-repo: https://github.com/knative/eventing-sources/releases/download
20+
:knative-eventing-version: v0.4.0
21+
:knative-sources-repo: https://github.com/knative/eventing-sources/releases/download
22+
:knative-sources-version: v0.4.0

0 commit comments

Comments
 (0)