From 957ca234a609b2350ff29e40242ce31d006da4ad Mon Sep 17 00:00:00 2001 From: Jim Crossley Date: Thu, 24 Jan 2019 17:34:49 -0500 Subject: [PATCH 1/6] Get the dumpy service working on OCP4 Update registry name and IP for curl command. Still lots of minishift references to remove --- knative-kubecon/README.md | 5 +++-- knative-kubecon/serving/010-service.yaml | 2 +- knative-kubecon/serving/011-service-update.yaml | 2 +- knative-kubecon/serving/012-service-traffic.yaml | 2 +- knative-kubecon/serving/013-service-final.yaml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/knative-kubecon/README.md b/knative-kubecon/README.md index 6fff4fb..cb41e63 100644 --- a/knative-kubecon/README.md +++ b/knative-kubecon/README.md @@ -187,7 +187,7 @@ spec: containerConcurrency: 1 container: imagePullPolicy: Always - image: docker-registry.default.svc:5000/myproject/dumpy:latest + image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest ``` It's very apparent that the `spec.runLatest.configuration.build` part is a one-to-one copy of the Build @@ -268,7 +268,8 @@ servicemesh, which is listening on `$(minishift ip):32380`). Stringed together w command: ```bash -$ curl -H "Host: dumpy.myproject.example.com" "http://$(minishift ip):32380/health" +$ NODE_IP=$(oc get node -ojsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}') +$ curl -H "Host: dumpy.myproject.example.com" "http://$NODE_IP:32380/health" 888 888 888 888 888 888 diff --git a/knative-kubecon/serving/010-service.yaml b/knative-kubecon/serving/010-service.yaml index 4702d3b..868069f 100644 --- a/knative-kubecon/serving/010-service.yaml +++ b/knative-kubecon/serving/010-service.yaml @@ -28,4 +28,4 @@ spec: containerConcurrency: 1 container: imagePullPolicy: Always - image: docker-registry.default.svc:5000/myproject/dumpy:latest + image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/011-service-update.yaml b/knative-kubecon/serving/011-service-update.yaml index b6b4a3b..e889c86 100644 --- a/knative-kubecon/serving/011-service-update.yaml +++ b/knative-kubecon/serving/011-service-update.yaml @@ -30,4 +30,4 @@ spec: containerConcurrency: 1 container: imagePullPolicy: Always - image: docker-registry.default.svc:5000/myproject/dumpy:latest + image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/012-service-traffic.yaml b/knative-kubecon/serving/012-service-traffic.yaml index 7f23410..e9ba17e 100644 --- a/knative-kubecon/serving/012-service-traffic.yaml +++ b/knative-kubecon/serving/012-service-traffic.yaml @@ -30,4 +30,4 @@ spec: containerConcurrency: 1 container: imagePullPolicy: Always - image: docker-registry.default.svc:5000/myproject/dumpy:latest + image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/013-service-final.yaml b/knative-kubecon/serving/013-service-final.yaml index da2604e..076a04d 100644 --- a/knative-kubecon/serving/013-service-final.yaml +++ b/knative-kubecon/serving/013-service-final.yaml @@ -30,4 +30,4 @@ spec: containerConcurrency: 1 container: imagePullPolicy: Always - image: docker-registry.default.svc:5000/myproject/dumpy:latest + image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest From a2986835f396a2589b21a743d0b03fb2119909ff Mon Sep 17 00:00:00 2001 From: Jim Crossley Date: Wed, 27 Feb 2019 09:49:17 -0500 Subject: [PATCH 2/6] Use the istio ingress rather than the node's ip --- knative-kubecon/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/knative-kubecon/README.md b/knative-kubecon/README.md index cb41e63..e590727 100644 --- a/knative-kubecon/README.md +++ b/knative-kubecon/README.md @@ -268,8 +268,8 @@ servicemesh, which is listening on `$(minishift ip):32380`). Stringed together w command: ```bash -$ NODE_IP=$(oc get node -ojsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}') -$ curl -H "Host: dumpy.myproject.example.com" "http://$NODE_IP:32380/health" +$ IP=$(oc get -n istio-system service istio-ingressgateway -ojsonpath='{.status.loadBalancer.ingress[0].hostname}') +$ curl -H "Host: dumpy.myproject.example.com" "http://$IP/health" 888 888 888 888 888 888 From 08155294789cb6f2a37f3c623a48a47643555484 Mon Sep 17 00:00:00 2001 From: Martin Gencur Date: Thu, 28 Feb 2019 09:02:45 +0100 Subject: [PATCH 3/6] Quicker scale-down for demo purposes. (#31) * Scale down revision in 60s instead of the default 5m --- knative-kubecon/serving/010-service.yaml | 1 + knative-kubecon/serving/011-service-update.yaml | 1 + knative-kubecon/serving/012-service-traffic.yaml | 1 + knative-kubecon/serving/013-service-final.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/knative-kubecon/serving/010-service.yaml b/knative-kubecon/serving/010-service.yaml index 868069f..618a490 100644 --- a/knative-kubecon/serving/010-service.yaml +++ b/knative-kubecon/serving/010-service.yaml @@ -26,6 +26,7 @@ spec: alpha.image.policy.openshift.io/resolve-names: "*" spec: containerConcurrency: 1 + timeoutSeconds: 60 container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/011-service-update.yaml b/knative-kubecon/serving/011-service-update.yaml index e889c86..6ecabdf 100644 --- a/knative-kubecon/serving/011-service-update.yaml +++ b/knative-kubecon/serving/011-service-update.yaml @@ -28,6 +28,7 @@ spec: alpha.image.policy.openshift.io/resolve-names: "*" spec: containerConcurrency: 1 + timeoutSeconds: 60 container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/012-service-traffic.yaml b/knative-kubecon/serving/012-service-traffic.yaml index e9ba17e..c00075d 100644 --- a/knative-kubecon/serving/012-service-traffic.yaml +++ b/knative-kubecon/serving/012-service-traffic.yaml @@ -28,6 +28,7 @@ spec: alpha.image.policy.openshift.io/resolve-names: "*" spec: containerConcurrency: 1 + timeoutSeconds: 60 container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest diff --git a/knative-kubecon/serving/013-service-final.yaml b/knative-kubecon/serving/013-service-final.yaml index 076a04d..fd7632d 100644 --- a/knative-kubecon/serving/013-service-final.yaml +++ b/knative-kubecon/serving/013-service-final.yaml @@ -28,6 +28,7 @@ spec: alpha.image.policy.openshift.io/resolve-names: "*" spec: containerConcurrency: 1 + timeoutSeconds: 60 container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest From e4ef2a8df9a8b32f3f50b99fce927a974771c00a Mon Sep 17 00:00:00 2001 From: Ben Browning Date: Mon, 11 Mar 2019 03:55:34 -0400 Subject: [PATCH 4/6] Request far less CPU for the dumpy ksvc pods (#32) This prevents smaller OpenShift 4 clusters from running out of CPU just to run this demo. The Knative default is 400m and this cuts that down to 1/8th, or 50m. These pods don't consume any real CPU anyway. --- knative-kubecon/serving/010-service.yaml | 3 +++ knative-kubecon/serving/011-service-update.yaml | 3 +++ knative-kubecon/serving/012-service-traffic.yaml | 3 +++ knative-kubecon/serving/013-service-final.yaml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/knative-kubecon/serving/010-service.yaml b/knative-kubecon/serving/010-service.yaml index 618a490..267c5ea 100644 --- a/knative-kubecon/serving/010-service.yaml +++ b/knative-kubecon/serving/010-service.yaml @@ -30,3 +30,6 @@ spec: container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest + resources: + requests: + cpu: 50m diff --git a/knative-kubecon/serving/011-service-update.yaml b/knative-kubecon/serving/011-service-update.yaml index 6ecabdf..7ab38ee 100644 --- a/knative-kubecon/serving/011-service-update.yaml +++ b/knative-kubecon/serving/011-service-update.yaml @@ -32,3 +32,6 @@ spec: container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest + resources: + requests: + cpu: 50m diff --git a/knative-kubecon/serving/012-service-traffic.yaml b/knative-kubecon/serving/012-service-traffic.yaml index c00075d..bb16cb9 100644 --- a/knative-kubecon/serving/012-service-traffic.yaml +++ b/knative-kubecon/serving/012-service-traffic.yaml @@ -32,3 +32,6 @@ spec: container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest + resources: + requests: + cpu: 50m diff --git a/knative-kubecon/serving/013-service-final.yaml b/knative-kubecon/serving/013-service-final.yaml index fd7632d..23a5a06 100644 --- a/knative-kubecon/serving/013-service-final.yaml +++ b/knative-kubecon/serving/013-service-final.yaml @@ -32,3 +32,6 @@ spec: container: imagePullPolicy: Always image: image-registry.openshift-image-registry.svc:5000/myproject/dumpy:latest + resources: + requests: + cpu: 50m From 70b88c9c5d11c652e9fcdd80f8cee205ce011265 Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Mon, 13 May 2019 14:59:56 +0200 Subject: [PATCH 5/6] Broker/Trigger usage --- knative-kubecon/eventing/010-channel.yaml | 9 --------- .../{030-subscription.yaml => 010-trigger.yaml} | 11 +++++------ knative-kubecon/eventing/021-source.yaml | 5 +++-- 3 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 knative-kubecon/eventing/010-channel.yaml rename knative-kubecon/eventing/{030-subscription.yaml => 010-trigger.yaml} (56%) diff --git a/knative-kubecon/eventing/010-channel.yaml b/knative-kubecon/eventing/010-channel.yaml deleted file mode 100644 index 2941574..0000000 --- a/knative-kubecon/eventing/010-channel.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: eventing.knative.dev/v1alpha1 -kind: Channel -metadata: - name: testchannel -spec: - provisioner: - apiVersion: eventing.knative.dev/v1alpha1 - kind: ClusterChannelProvisioner - name: in-memory-channel diff --git a/knative-kubecon/eventing/030-subscription.yaml b/knative-kubecon/eventing/010-trigger.yaml similarity index 56% rename from knative-kubecon/eventing/030-subscription.yaml rename to knative-kubecon/eventing/010-trigger.yaml index f19c65a..9db3361 100644 --- a/knative-kubecon/eventing/030-subscription.yaml +++ b/knative-kubecon/eventing/010-trigger.yaml @@ -1,13 +1,12 @@ apiVersion: eventing.knative.dev/v1alpha1 -kind: Subscription +kind: Trigger metadata: - name: testevents-subscription + name: my-service-trigger namespace: myproject spec: - channel: - apiVersion: eventing.knative.dev/v1alpha1 - kind: Channel - name: testchannel + filter: + sourceAndType: + type: dev.knative.source.heartbeats subscriber: ref: apiVersion: serving.knative.dev/v1alpha1 diff --git a/knative-kubecon/eventing/021-source.yaml b/knative-kubecon/eventing/021-source.yaml index 8204a9e..89088e9 100644 --- a/knative-kubecon/eventing/021-source.yaml +++ b/knative-kubecon/eventing/021-source.yaml @@ -2,6 +2,7 @@ apiVersion: sources.eventing.knative.dev/v1alpha1 kind: ContainerSource metadata: name: heartbeat-event-source + namespace: myproject spec: image: docker.io/matzew/kube-heartbeat args: @@ -9,5 +10,5 @@ spec: - '--period=400' sink: apiVersion: eventing.knative.dev/v1alpha1 - kind: Channel - name: testchannel + kind: Broker + name: default From 3cebf2fb3730e92a1e14d07564d3e13fa246bfa4 Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Tue, 21 May 2019 09:07:19 +0200 Subject: [PATCH 6/6] Using productized image and its event type --- knative-kubecon/eventing/010-trigger.yaml | 2 +- knative-kubecon/eventing/021-source.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/knative-kubecon/eventing/010-trigger.yaml b/knative-kubecon/eventing/010-trigger.yaml index 9db3361..e49bac9 100644 --- a/knative-kubecon/eventing/010-trigger.yaml +++ b/knative-kubecon/eventing/010-trigger.yaml @@ -6,7 +6,7 @@ metadata: spec: filter: sourceAndType: - type: dev.knative.source.heartbeats + type: dev.knative.eventing.samples.heartbeat subscriber: ref: apiVersion: serving.knative.dev/v1alpha1 diff --git a/knative-kubecon/eventing/021-source.yaml b/knative-kubecon/eventing/021-source.yaml index 89088e9..bcf0261 100644 --- a/knative-kubecon/eventing/021-source.yaml +++ b/knative-kubecon/eventing/021-source.yaml @@ -4,7 +4,7 @@ metadata: name: heartbeat-event-source namespace: myproject spec: - image: docker.io/matzew/kube-heartbeat + image: quay.io/openshift-knative/knative-eventing-sources-heartbeats:v0.5.0 args: - '--label="<3"' - '--period=400'