Skip to content

Commit

Permalink
Release 0.15 (Staging)
Browse files Browse the repository at this point in the history
prepare for staging
  • Loading branch information
kameshsampath authored Jan 21, 2021
1 parent 1f50a2b commit 8185802
Show file tree
Hide file tree
Showing 32 changed files with 457 additions and 200 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ staging-gh-pages
triggers/tekton-greeter
app.ini
demo
work
temp
tmp

docker-secrets
docker-secrets
bin/knative.installed
15 changes: 10 additions & 5 deletions bin/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

NS=${1:-tektontutorial}

kubectl delete pods --field-selector=status.phase=Succeeded
kubectl delete pods --field-selector=status.phase=Failed

kubectl delete -n tektontutorial tasks --all
kubectl delete -n tektontutorial tr --all
kubectl delete -n tektontutorial pipelines --all
kubectl delete -n tektontutorial pr --all
kubectl delete -n tektontutorial pipelineresources
kubectl delete -n "$NS" pipeline --all
kubectl delete -n "$NS" pr --all
kubectl delete -n "$NS" tr --all
kubectl delete -n "$NS" deploy,svc demo-greeter 2>/dev/null
kubectl delete -n "$NS" httpproxy demo-greeter 2>/dev/null
kubectl delete -n "$NS" deploy,svc greeter 2>/dev/null
kubectl delete -n "$NS" httpproxy greeter 2>/dev/null
kubectl delete -n "$NS" ksvc greeter 2>/dev/null
45 changes: 29 additions & 16 deletions bin/enable_knative.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/bash

set -eu
set -o pipefail
set -o errexit

knative_version=${KNATIVE_VERSION:-v0.16.0}
knative_serving_version=${KNATIVE_SERVING_VERSION:-v0.16.0}
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

###################################
# Ingress
###################################
knative_version=${KNATIVE_VERSION:-v0.17.0}
knative_serving_version=${KNATIVE_SERVING_VERSION:-v0.17.0}

#############################################################
#
# Setup Ingress
#
#############################################################

kubectl apply -f https://projectcontour.io/quickstart/contour.yaml

Expand All @@ -19,20 +23,20 @@ kubectl rollout status ds envoy -n projectcontour
######################################

kubectl apply \
--filename https://github.com/knative/serving/releases/download/$knative_serving_version/serving-crds.yaml
--filename "https://github.com/knative/serving/releases/download/$knative_serving_version/serving-crds.yaml "

kubectl apply \
--filename \
https://github.com/knative/serving/releases/download/$knative_serving_version/serving-core.yaml
"https://github.com/knative/serving/releases/download/$knative_serving_version/serving-core.yaml"

kubectl rollout status deploy controller -n knative-serving
kubectl rollout status deploy activator -n knative-serving

kubectl apply \
--filename \
https://github.com/knative/net-kourier/releases/download/$knative_version/kourier.yaml
"https://github.com/knative/net-kourier/releases/download/$knative_version/kourier.yaml"

kubectl rollout status deploy 3scale-kourier-control -n kourier-system
kubectl rollout status deploy 3scale-kourier-control -n knative-serving
kubectl rollout status deploy 3scale-kourier-gateway -n kourier-system

kubectl patch configmap/config-network \
Expand All @@ -41,26 +45,35 @@ kubectl patch configmap/config-network \
-p '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'

cat <<EOF | kubectl apply -n kourier-system -f -
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kourier-ingress
namespace: kourier-system
spec:
backend:
serviceName: kourier
servicePort: 80
rules:
- http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: kourier
port:
number: 80
EOF

# skip registriesSkippingTagResolving for few local and development registry prefixes
kubectl patch configmap/config-deployment \
-n knative-serving \
--type merge \
-p '{"data":{"registriesSkippingTagResolving": "ko.local,dev.local,example.com,example.org,test.com,test.org,localhost:5000"}}'
-p '{"data":{"registriesSkippingTagResolving": "ko.local,dev.local,example.com,example.org,test.com,test.org,localhost:5000,registry.local:5000"}}'

# set nip.io resolution
minikube_nip_domain="\"data\":{\"127.0.0.1.nip.io\": \"\"}"
minikube_nip_domain="\"data\":{\"$(minikube ip).nip.io\": \"\"}"
kubectl patch configmap/config-domain \
-n knative-serving \
--type merge \
-p "{$minikube_nip_domain}"

touch "$CURRENT_DIR/knative.installed"
32 changes: 17 additions & 15 deletions bin/start-minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ CPUS=${CPUS:-4}
declare PLATFORM_SPECIFIC_OPTIONS=""

# Enable if you are going to use Tekton with Knative
EXTRA_CONFIG="apiserver.enable-admission-plugins=\
LimitRanger,\
NamespaceExists,\
NamespaceLifecycle,\
ResourceQuota,\
ServiceAccount,\
DefaultStorageClass,\
MutatingAdmissionWebhook"
# EXTRA_CONFIG="apiserver.enable-admission-plugins=\
# LimitRanger,\
# NamespaceExists,\
# NamespaceLifecycle,\
# ResourceQuota,\
# ServiceAccount,\
# DefaultStorageClass,\
# MutatingAdmissionWebhook"

unamestr=$(uname)

if [ "${unamestr}" == "Darwin" ]; then
# Add MacOS specific options for minikube
PLATFORM_SPECIFIC_OPTIONS="--driver hyperkit --apiserver-names=docker.for.mac.localhost"
# Add MacOS specific options for minikube
PLATFORM_SPECIFIC_OPTIONS=("--driver=hyperkit" "--apiserver-names=docker.for.mac.localhost")
fi


minikube start -p $PROFILE_NAME \
--memory=$MEMORY --cpus=$CPUS \
minikube start -p "$PROFILE_NAME" \
--memory="$MEMORY" --cpus="$CPUS" \
--disk-size=50g \
--insecure-registry='10.0.0.0/24' ${PLATFORM_SPECIFIC_OPTIONS}
--kubernetes-version='v1.19.0' \
--insecure-registry='10.0.0.0/24' \
"${PLATFORM_SPECIFIC_OPTIONS[@]}"

minikube profile $PROFILE_NAME
minikube profile "$PROFILE_NAME"

15 changes: 9 additions & 6 deletions dev-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ asciidoc:
attributes:
tutorial-namespace: tektontutorial
workshop-domain: guru.devx.red
kubernetes-version: v1.18.0
kubernetes-version: v1.19.0
release-version: master
openshift-console-url: https://console-openshift-console.apps.example.com
etherpad-url: http://example.com
page-pagination: true
tekton-version: v0.14.3
triggers-version: v0.6.1
kn-version: v0.16.0
tekton-cli-version: 0.12.0
tekton-version: v0.19.0
triggers-version: v0.10.2
kn-version: v0.17.3
tekton-cli-version: 0.15.0
cli: kubectl
openshift-version: 4.5
openshift-version: 4.6
kind-version: v0.9.0
minikube-version: v1.16.0
tutorial-apps-revision: master
extensions:
- ./lib/remote-include-processor.js
- ./lib/tab-block.js
Expand Down
5 changes: 1 addition & 4 deletions documentation/modules/ROOT/examples/build-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- name: url
value: https://github.com/redhat-scholars/tekton-tutorial-greeter
- name: revision
value: staging
value: master
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
Expand All @@ -18,7 +18,4 @@ spec:
type: image
params:
- name: url
# use internal registry
value: example.com/rhdevelopers/tekton-tutorial-greeter
# if you are on OpenShift uncomment the line below
#value: "image-registry.openshift-image-registry.svc:5000/tektontutorial/greeter"
3 changes: 0 additions & 3 deletions documentation/modules/ROOT/pages/_partials/_attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
:branch: master
:github-repo: https://github.com/redhat-scholars/tekton-tutorial/blob/{branch}
:tutorial-apps-repo: https://github.com/redhat-scholars/tekton-tutorial-greeter
:tutorial-apps-revision: staging
:experimental:
:minikube-version: v1.12.1+
:openshift-version: v4.5+

:tekton-repo: https://github.com/tektoncd/pipeline/releases/download
:pipelines-repo: pipelines
Expand Down
52 changes: 38 additions & 14 deletions documentation/modules/ROOT/pages/_partials/_pipelines.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ The command should show a output like:
[.console-output]
[source,bash]
----
NAME AGE
build-app 2 hours ago
source-lister 7 seconds ago
NAME DESCRIPTION AGE
build-app 20 minutes ago
source-lister 22 minutes ago
----

If you don't see the output as above please ensure you have completed all the exercises of xref::pipeline-resources.adoc[Chapter 2] and xref::tasks.adoc[Chapter 3] before proceeding further.
Expand Down Expand Up @@ -73,10 +73,10 @@ The Task list should now list the following two Tasks:
[.console-output]
[source,bash,subs="+macros,attributes+"]
----
NAME AGE
build-app 2 hours ago
openshift-client 3 seconds ago
source-lister 10 minutes ago
NAME DESCRIPTION AGE
build-app 21 minutes ago
openshift-client This task runs comm... 6 seconds ago
source-lister 23 minutes ago
----

[#tekton-pipeline-create]
Expand Down Expand Up @@ -194,8 +194,6 @@ It will take few seconds for the PipelineRun to show status as `Running` as it n
* Use `pr` as shorcut for pipelinerun commands e.g to list pipelinerun run the command `tkn pr ls`
====

include::master@tekton-tutorial:ROOT:partial$logs-view.adoc[tags="pr"]

If you see the PipelineRun status as `Failed` or `Error` use the following command to check the reason for error:

[.console-input]
Expand All @@ -204,26 +202,52 @@ If you see the PipelineRun status as `Failed` or `Error` use the following comma
tkn pipelinerun describe <pipelinerun-name>
----

The successful `Pipeline` run would have created a Kubernetes deployment and service called `greeter`:

[.console-input]
[source,bash,subs="+macros,attributes+"]
----
kubectl get deploy,svc -n {tutorial-namespace} -l=app=greeter
----

[.console-output]
[source,bash]
----
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/greeter 1/1 1 1 9m31s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/greeter NodePort 10.96.251.232 <none> 8080:31918/TCP 9m31s
----

[#tekton-test-pipeline]
== Invoke Service

Get the service URL,

[tabs]
====
Minikube::
+
--
[.console-input]
[source,bash,subs="+macros,attributes+"]
----
SVC_URL=$(minikube -p {tutorial-namespace} -n {tutorial-namespace} service greeter --url)
SVC_URL=$(minikube -p {tutorial-namespace} -n {chapter-namespace} greeter --url)
----

[NOTE]
====
--
OpenShift::
+
--
In OpenShift you can use the routes like:
[.console-input]
[source,bash,subs="+macros,attributes+"]
----
oc expose svc greeter
SVC_URL=$(oc get routes greeter -o yaml | yq r - 'spec.url.host' )
----
--
====

Run the service,
Expand All @@ -239,7 +263,7 @@ The `http` command should return a response containing a line similar to **Meeow
[#tekton-pipeline-cleanup]
== Cleanup

Delete the pipeline service account and its related permissions:
Clean the completed/failed Task and Pipeline run pods

[.console-input]
[source,bash,subs="+macros,attributes+"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ metadata:
namespace: {chapter-namespace}
secrets:
#- name: github-pat-secret#
- name: build-bot-token-8nl2v
- name: github-bot-token-9p2wg
----

[#tekton-create-clone-pipeline]
Expand Down
13 changes: 9 additions & 4 deletions documentation/modules/ROOT/pages/_partials/_setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ The following CLI tools are required for running the exercises in this tutorial.
| `dnf install docker`
| https://docs.docker.com/docker-for-windows/install[Docker for Windows]

| `Minikube`
| https://minikube.sigs.k8s.io/docs/start/
| https://minikube.sigs.k8s.io/docs/start/
| https://minikube.sigs.k8s.io/docs/start/

| `kubectl`
| https://kubernetes.io/docs/tasks/tools/install-kubectl/[Install]
| https://kubernetes.io/docs/tasks/tools/install-kubectl/[Install]
Expand All @@ -27,10 +32,10 @@ The following CLI tools are required for running the exercises in this tutorial.
| https://github.com/wercker/stern/releases/download/1.6.0/stern_linux_amd64[Download]
| https://github.com/wercker/stern/releases/download/1.11.0/stern_windows_amd64.exe[Download]

| https://github.com/mikefarah/yq[yq]
| brew install yq
| brew install yq
| choco install yq
| https://github.com/mikefarah/yq[yqv3.x]
| brew install yq@3
| brew install yq@3
| choco install yq@3

| https://httpie.org/[httpie]
| `brew install httpie`
Expand Down
Loading

0 comments on commit 8185802

Please sign in to comment.