Skip to content

Instantly share code, notes, and snippets.

@cab105
Created June 30, 2022 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cab105/446c07cc54c646913dca459d2ddd9a9f to your computer and use it in GitHub Desktop.
Save cab105/446c07cc54c646913dca459d2ddd9a9f to your computer and use it in GitHub Desktop.
Sample Kubernetes Configuration to leverage TriggerMesh transformation in a Spring Boot Migrator generated service
# This YAML file requires a Kubernetes cluster with Knative and TriggerMesh installed.
# Instantiate the Dataweave transformation service
apiVersion: flow.triggermesh.io/v1alpha1
kind: DataWeaveTransformation
metadata:
name: dw
namespace: default # change this to your target namespace
spec:
allowPerEventDwSpell: true
# Uncomment to allow the transformation to be accessible outside of the cluster
#adapterOverrides:
# public: true
---
# The Knative Sink Binding to associate the generated service with the Dataweave transformation
apiVersion: sources.knative.dev/v1
kind: SinkBinding
metadata:
name: mule-binding
spec:
subject:
apiVersion: apps/v1
kind: Deployment
name: mule-deployment # Ensure this reflects the target deployment
sink:
ref:
apiVersion: flow.triggermesh.io/v1alpha1
kind: DataWeaveTransformation
name: dw
---
# The generated deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: mule-deployment
labels:
app: MuleSoftMigratedService # Should be specific to your service name
spec:
selector:
matchLabels:
app: MuleSoftMigratedService
template:
metadata:
labels:
app: MuleSoftMigratedService
spec:
containers:
# This needs to reflect your generated service coordinates in the docker registry
- name: mule-migrated-sbm-svc
image: gcr.io/triggermesh/mule-migrated-sbm-svc:latest
---
# Create a regular Kubernetes service to expose your service
apiVersion: v1
kind: Service
metadata:
name: mule-migrated-sbm-svc
spec:
selector:
app: MuleSoftMigratedService
type: LoadBalancer
ports:
- protocol: TCP
port: 8081
targetPort: 8081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment