diff --git a/docs/eventing/samples/helloworld/helloworld-go/README.md b/docs/eventing/samples/helloworld/helloworld-go/README.md index 2f7ad7c6a8b..59b79f74e96 100644 --- a/docs/eventing/samples/helloworld/helloworld-go/README.md +++ b/docs/eventing/samples/helloworld/helloworld-go/README.md @@ -157,9 +157,13 @@ cd knative-docs/docs/eventing/samples/helloworld/helloworld-go metadata: name: default namespace: knative-samples + annotations: + # Note: you can set the eventing.knative.dev/broker.class annotation to change the class of the broker. + # The default broker class is MTChannelBasedBroker, but Knative also supports use of the other class. + eventing.knative.dev/broker.class: MTChannelBasedBroker spec: {} --- - # Helloworld-go app deploment + # Helloworld-go app deployment apiVersion: apps/v1 kind: Deployment metadata: @@ -303,7 +307,7 @@ with correct CloudEvent headers set. -X POST \ -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \ -H "Ce-Specversion: 1.0" \ - -H "Ce-Type: dev.knative.samples.helloworld" \ + -H "Ce-Type: dev.knative.samples.hifromknative" \ -H "Ce-Source: dev.knative.samples/helloworldsource" \ -H "Content-Type: application/json" \ -d '{"msg":"Hello World from the curl pod."}' @@ -427,7 +431,7 @@ mesh via the Broker and can be delivered to other services using a Trigger EOF ``` -1. [Send a CloudEvent to the Broker](#send-cloudevent-to-the-broker) +1. [Send a CloudEvent to the Broker](#send-and-verify-cloudevents) 1. Check the logs of `event-display` service: diff --git a/docs/eventing/samples/helloworld/helloworld-go/sample-app.yaml b/docs/eventing/samples/helloworld/helloworld-go/sample-app.yaml index 1eba73b86c2..542642ebe19 100644 --- a/docs/eventing/samples/helloworld/helloworld-go/sample-app.yaml +++ b/docs/eventing/samples/helloworld/helloworld-go/sample-app.yaml @@ -10,6 +10,10 @@ kind: Broker metadata: name: default namespace: knative-samples + annotations: + # Note: you can set the eventing.knative.dev/broker.class annotation to change the class of the broker. + # The default broker class is MTChannelBasedBroker, but Knative also supports use of the other class. + eventing.knative.dev/broker.class: MTChannelBasedBroker spec: {} --- # Helloworld-go app deployment @@ -33,15 +37,15 @@ spec: --- # Service that exposes helloworld-go app. # This will be the subscriber for the Trigger - kind: Service - apiVersion: v1 - metadata: - name: helloworld-go - namespace: knative-samples - spec: - selector: - app: helloworld-go - ports: +apiVersion: v1 +kind: Service +metadata: + name: helloworld-go + namespace: knative-samples +spec: + selector: + app: helloworld-go + ports: - protocol: TCP port: 80 targetPort: 8080 diff --git a/docs/eventing/samples/helloworld/helloworld-python/README.md b/docs/eventing/samples/helloworld/helloworld-python/README.md index f95f18e1a6d..4db2d807e94 100644 --- a/docs/eventing/samples/helloworld/helloworld-python/README.md +++ b/docs/eventing/samples/helloworld/helloworld-python/README.md @@ -87,7 +87,19 @@ cd knative-docs/docs/eventing/samples/helloworld/helloworld-python labels: eventing.knative.dev/injection: enabled --- - # Helloworld-python app deploment + # A default broker + apiVersion: eventing.knative.dev/v1 + kind: Broker + metadata: + name: default + namespace: knative-samples + annotations: + # Note: you can set the eventing.knative.dev/broker.class annotation to change the class of the broker. + # The default broker class is MTChannelBasedBroker, but Knative also supports use of the other class. + eventing.knative.dev/broker.class: MTChannelBasedBroker + spec: {} + --- + # Helloworld-python app deployment apiVersion: apps/v1 kind: Deployment metadata: @@ -109,18 +121,18 @@ cd knative-docs/docs/eventing/samples/helloworld/helloworld-python --- # Service that exposes helloworld-python app. # This will be the subscriber for the Trigger - kind: Service - apiVersion: v1 - metadata: - name: helloworld-python - namespace: knative-samples - spec: - selector: - app: helloworld-python - ports: - - protocol: TCP - port: 80 - targetPort: 8080 + apiVersion: v1 + kind: Service + metadata: + name: helloworld-python + namespace: knative-samples + spec: + selector: + app: helloworld-python + ports: + - protocol: TCP + port: 80 + targetPort: 8080 --- # Knative Eventing Trigger to trigger the helloworld-python service apiVersion: eventing.knative.dev/v1 @@ -198,7 +210,7 @@ You can send an HTTP request directly to the Knative [broker](../../../broker) i 1. Run the following command in the SSH terminal: ```bash - curl -v "default-broker.knative-samples.svc.cluster.local" \ + curl -v "broker-ingress.knative-eventing.svc.cluster.local/knative-samples/default" \ -X POST \ -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \ -H "Ce-specversion: 0.3" \ @@ -310,7 +322,7 @@ The `helloworld-python` app replies with an event type `type= dev.knative.sample EOF ``` - 1. [Send a CloudEvent to the Broker](#send-cloudevent-to-the-broker) + 1. [Send a CloudEvent to the Broker](#send-and-verify-cloudevents) 1. Check the logs of `event-display` Service: diff --git a/docs/eventing/samples/helloworld/helloworld-python/sample-app.yaml b/docs/eventing/samples/helloworld/helloworld-python/sample-app.yaml index 18fdcb95548..a932d8faf0a 100644 --- a/docs/eventing/samples/helloworld/helloworld-python/sample-app.yaml +++ b/docs/eventing/samples/helloworld/helloworld-python/sample-app.yaml @@ -4,9 +4,21 @@ kind: Namespace metadata: name: knative-samples labels: - eventing.knative.dev/injection: enabled + eventing.knative.dev/injection: enabled --- -# Helloworld-go app deploment +# A default broker +apiVersion: eventing.knative.dev/v1 +kind: Broker +metadata: + name: default + namespace: knative-samples + annotations: + # Note: you can set the eventing.knative.dev/broker.class annotation to change the class of the broker. + # The default broker class is MTChannelBasedBroker, but Knative also supports use of the other class. + eventing.knative.dev/broker.class: MTChannelBasedBroker +spec: {} +--- +# helloworld-python app deployment apiVersion: apps/v1 kind: Deployment metadata: @@ -23,25 +35,25 @@ spec: spec: containers: - name: helloworld-python - image: docker.io/axsauze/helloworld-python + image: docker.io/{username}/helloworld-python imagePullPolicy: IfNotPresent --- -# Service that exposes helloworld-go app. +# Service that exposes helloworld-python app. # This will be the subscriber for the Trigger - kind: Service - apiVersion: v1 - metadata: - name: helloworld-python - namespace: knative-samples - spec: - selector: - app: helloworld-python - ports: +apiVersion: v1 +kind: Service +metadata: + name: helloworld-python + namespace: knative-samples +spec: + selector: + app: helloworld-python + ports: - protocol: TCP port: 80 targetPort: 8080 --- -# Knative Eventing Trigger to trigger the helloworld-go service +# Knative Eventing Trigger to trigger the helloworld-python service apiVersion: eventing.knative.dev/v1 kind: Trigger metadata: