Skip to content

Commit 6f3c974

Browse files
Merge pull request #220 from kameshsampath/release/v0.14.x
Advanced/ QA updates
2 parents d7de871 + 642ab10 commit 6f3c974

15 files changed

Lines changed: 174 additions & 37 deletions

advanced/camel-k/get-started/echoer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
steps:
44
- log:
55
message: "Got Message: ${body}"
6-
- convert-body: "java.lang.String"
6+
- convert-body-to: "java.lang.String"
77
- choice:
88
when:
9-
- simple: "${body} != null && ${body.length} > 0"
9+
- simple: "${body} != null && ${body.trim().length} > 0"
1010
steps:
1111
- set-body:
1212
simple: "${body.toUpperCase()}"

advanced/camel-k/get-started/timed-greeter-source.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ spec:
1111
from:
1212
uri: "timer:tick"
1313
parameters:
14-
period: "10s"
14+
# time in milliseconds
15+
period: 10000
1516
steps:
1617
- set-body:
1718
constant: "Welcome to Apache Camel K"

advanced/camel-k/get-started/timed-greeter.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- from:
22
uri: "timer:tick"
33
parameters:
4-
period: "10s"
4+
# time in milliseconds
5+
period: 10000
56
steps:
67
- set-body:
78
constant: "Welcome to Apache Camel K"

bin/call.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ HOST_HEADER="Host:$KSVC_NAME.$CURR_NS.example.com"
2121

2222
if [ $# -le 1 ]
2323
then
24-
curl -H "$HOST_HEADER" $IP_ADDRESS
24+
http GET $IP_ADDRESS "$HOST_HEADER"
2525
else
26-
if [ -z "$2" ]
27-
then
28-
curl -X POST -H "$HOST_HEADER" $IP_ADDRESS
29-
else
30-
curl -X POST -d "$2" -H "$HOST_HEADER" $IP_ADDRESS
31-
fi
26+
echo "$2" | http --body POST $IP_ADDRESS "$HOST_HEADER" 'Content-Type: plain'
3227
fi
3328

3429
exit_err() {

bin/clean-completed.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
kubectl delete pods --field-selector=status.phase=Succeeded
4+
kubectl delete pods --field-selector=status.phase=Failed

bin/kind-cluster-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
nodes:
4+
- role: control-plane
5+
- role: worker
6+
extraPortMappings:
7+
- containerPort: 80
8+
hostPort: 80
9+
listenAddress: 0.0.0.0
10+
- containerPort: 443
11+
hostPort: 443
12+
listenAddress: 0.0.0.0
13+
containerdConfigPatches:
14+
- |-
15+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${CONTAINER_REGISTRY_PORT}"]
16+
endpoint = ["http://${CONTAINER_REGISTRY_NAME}:${CONTAINER_REGISTRY_PORT}"]
17+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."${CONTAINER_REGISTRY_NAME}:${CONTAINER_REGISTRY_PORT}"]
18+
endpoint = ["http://${CONTAINER_REGISTRY_NAME}:${CONTAINER_REGISTRY_PORT}"]

bin/start-kind-cluster.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
set -o errexit
5+
6+
export CLUSTER_NAME=${CLUSTER_NAME:-knativetutorial}
7+
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
9+
# create registry container unless it already exists
10+
export CONTAINER_REGISTRY_NAME='kind-registry'
11+
export CONTAINER_REGISTRY_PORT='5000'
12+
13+
running="$(docker inspect -f '{{.State.Running}}' "${CONTAINER_REGISTRY_NAME}" 2>/dev/null || true)"
14+
if [ "${running}" != 'true' ]; then
15+
docker run \
16+
-d --restart=always -p "${CONTAINER_REGISTRY_PORT}:5000" --name "${CONTAINER_REGISTRY_NAME}" \
17+
registry:2
18+
fi
19+
20+
# create a cluster with the local registry enabled in containerd
21+
envsubst < ${CURRENT_DIR}/kind-cluster-config.yaml | kind create cluster \
22+
--name="${CLUSTER_NAME}" --config=-
23+
24+
# connect the registry to the cluster network only for new
25+
if [ "${running}" != 'true' ]; then
26+
docker network connect "kind" "${CONTAINER_REGISTRY_NAME}"
27+
fi
28+
29+
## Label nodes for using registry
30+
# tell https://tilt.dev to use the registry
31+
# https://docs.tilt.dev/choosing_clusters.html#discovering-the-registry
32+
for node in $(kind get nodes --name="$CLUSTER_NAME"); do
33+
kubectl annotate node "${node}" \
34+
"tilt.dev/registry=localhost:${CONTAINER_REGISTRY_PORT}" \
35+
"tilt.dev/registry-from-cluster=${CONTAINER_REGISTRY_NAME}:${CONTAINER_REGISTRY_PORT}";
36+
done
37+
38+
## Label worker nodes
39+
kubectl get nodes --no-headers -l '!node-role.kubernetes.io/master' -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}' | xargs -I{} kubectl label node {} node-role.kubernetes.io/worker=''
40+
41+
## Setup helm
42+
43+
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
44+
helm repo update
45+
46+
47+
###################################
48+
# Nginx Ingress
49+
###################################
50+
51+
## Label Worker nodes as nginx ingress
52+
kubectl get nodes --no-headers -l '!node-role.kubernetes.io/master' -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}' | xargs -I{} kubectl label node {} nginx=ingresshost
53+
54+
kubectl create ns ingress-nginx
55+
56+
helm install ingress-nginx stable/nginx-ingress --namespace ingress-nginx \
57+
--set controller.nodeSelector.nginx="ingresshost" \
58+
--set rbac.create=true --set controller.image.pullPolicy="Always" \
59+
--set controller.extraArgs.enable-ssl-passthrough="" \
60+
--set controller.stats.enabled=true --set controller.service.type="ClusterIP" \
61+
--set controller.kind="DaemonSet" --set controller.daemonset.useHostPort=true
62+
63+
kubectl rollout status ds ingress-nginx-nginx-ingress-controller -n ingress-nginx
64+
kubectl rollout status deploy ingress-nginx-nginx-ingress-default-backend -n ingress-nginx

eventing/channel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: messaging.knative.dev/v1alpha1
1+
apiVersion: messaging.knative.dev/v1beta1
22
kind: Channel
33
metadata:
4-
name: eventinghello-ch
4+
name: eventinghello-ch

eventing/default-kafka-channel.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ kind: ConfigMap
33
metadata:
44
name: default-ch-webhook
55
namespace: knative-eventing
6+
labels:
7+
eventing.knative.dev/release: devel
68
data:
79
default-ch-config: |
810
clusterDefault:
911
apiVersion: messaging.knative.dev/v1alpha1
1012
kind: InMemoryChannel
1113
namespaceDefaults:
12-
chapter-4:
14+
knativetutorial:
1315
apiVersion: messaging.knative.dev/v1alpha1
1416
kind: KafkaChannel
1517
spec:
1618
numPartitions: 1
17-
replicationFactor: 1
19+
replicationFactor: 1

eventing/eventing-hello-sink.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ spec:
1010
autoscaling.knative.dev/target: "1"
1111
spec:
1212
containers:
13-
- image: quay.io/burrsutter/eventinghello:0.0.1
14-
13+
- image: quay.io/rhdevelopers/eventinghello:0.0.2

0 commit comments

Comments
 (0)