mirror of https://github.com/knative/docs.git
Fix rendering issue in helloworld-go eventing (#2739)
This commit is contained in:
parent
8783e31e9b
commit
ec79229f17
|
@ -137,74 +137,74 @@ cd knative-docs/docs/eventing/samples/helloworld/helloworld-go
|
||||||
definition into the file. Make sure to replace `{username}` with your Docker
|
definition into the file. Make sure to replace `{username}` with your Docker
|
||||||
Hub username.
|
Hub username.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Namespace for sample application
|
# Namespace for sample application
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: knative-samples
|
name: knative-samples
|
||||||
---
|
---
|
||||||
# A default broker
|
# A default broker
|
||||||
apiVersion: eventing.knative.dev/v1
|
apiVersion: eventing.knative.dev/v1
|
||||||
kind: Broker
|
kind: Broker
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec: {}
|
spec: {}
|
||||||
---
|
---
|
||||||
# Helloworld-go app deploment
|
# Helloworld-go app deploment
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: helloworld-go
|
name: helloworld-go
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels: &labels
|
matchLabels: &labels
|
||||||
app: helloworld-go
|
app: helloworld-go
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels: *labels
|
labels: *labels
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: helloworld-go
|
- name: helloworld-go
|
||||||
image: docker.io/{username}/helloworld-go
|
image: docker.io/{username}/helloworld-go
|
||||||
|
|
||||||
---
|
---
|
||||||
# Service that exposes helloworld-go app.
|
# Service that exposes helloworld-go app.
|
||||||
# This will be the subscriber for the Trigger
|
# This will be the subscriber for the Trigger
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: helloworld-go
|
name: helloworld-go
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: helloworld-go
|
app: helloworld-go
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
---
|
---
|
||||||
# Knative Eventing Trigger to trigger the helloworld-go service
|
# Knative Eventing Trigger to trigger the helloworld-go service
|
||||||
apiVersion: eventing.knative.dev/v1
|
apiVersion: eventing.knative.dev/v1
|
||||||
kind: Trigger
|
kind: Trigger
|
||||||
metadata:
|
metadata:
|
||||||
name: helloworld-go
|
name: helloworld-go
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec:
|
spec:
|
||||||
broker: default
|
broker: default
|
||||||
filter:
|
filter:
|
||||||
attributes:
|
attributes:
|
||||||
type: dev.knative.samples.helloworld
|
type: dev.knative.samples.helloworld
|
||||||
source: dev.knative.samples/helloworldsource
|
source: dev.knative.samples/helloworldsource
|
||||||
subscriber:
|
subscriber:
|
||||||
ref:
|
ref:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
name: helloworld-go
|
name: helloworld-go
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Use the go tool to create a
|
1. Use the go tool to create a
|
||||||
[`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest.
|
[`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest.
|
||||||
|
@ -355,44 +355,44 @@ mesh via the Broker and can be delivered to other services using a Trigger
|
||||||
|
|
||||||
1. Deploy a pod that receives any CloudEvent and logs the event to its output.
|
1. Deploy a pod that receives any CloudEvent and logs the event to its output.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl --namespace knative-samples apply --filename - << END
|
kubectl --namespace knative-samples apply --filename - << END
|
||||||
# event-display app deploment
|
# event-display app deploment
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: event-display
|
name: event-display
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels: &labels
|
matchLabels: &labels
|
||||||
app: event-display
|
app: event-display
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels: *labels
|
labels: *labels
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: helloworld-go
|
- name: helloworld-go
|
||||||
# Source code: https://github.com/knative/eventing-contrib/tree/master/cmd/event_display
|
# Source code: https://github.com/knative/eventing-contrib/tree/master/cmd/event_display
|
||||||
image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
|
image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
|
||||||
---
|
---
|
||||||
# Service that exposes event-display app.
|
# Service that exposes event-display app.
|
||||||
# This will be the subscriber for the Trigger
|
# This will be the subscriber for the Trigger
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: event-display
|
name: event-display
|
||||||
namespace: knative-samples
|
namespace: knative-samples
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: event-display
|
app: event-display
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
END
|
END
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Create a trigger to deliver the event to the above service
|
1. Create a trigger to deliver the event to the above service
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue