Among Argo tools, Argo Workflows can be found.
Kubernetes-native workflow engine supporting DAG and step-based workflows.
Some of Argo Workflows features –
Memphis provides multiple features that enhance the experience with Argo, like:
…
One of the key advantages of using Memphis is the ability to troubleshoot complicated async processes using message tracing, data-level observability, self-healing policies, and real-time notifications, which can be a great help, especially for auditing and logging when events and triggers are fired from multiple places towards your Argo and potentially can create highly expensive resources and workflows.
memphis-creds
secret in argo-evens
namespaceCreate a file called “memphis_eventsource.yaml”
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: memphis
spec:
nats:
example:
# url of the nats service
url: nats://<MEMPHIS_BROKER_URL>:6666
# jsonBody specifies that all event body payload coming from this
# source will be JSON
jsonBody: true
# subject name = memphis station
subject: argo_workflows
auth:
token:
name: memphis-creds
key: CONNECTION_TOKEN
# optional backoff time for connection retries.
# if not provided, default connection backoff time will be used.
connectionBackoff:
# duration in nanoseconds, or strings like "4s", "1m". following value is 10 seconds
duration: 10s
# how many backoffs
steps: 5
# factor to increase on each step.
# setting factor > 1 makes backoff exponential.
factor: 2
jitter: 0.2
kubectl create secret generic memphis-creds \
–from-literal=CONNECTION_TOKEN=<APPLICATION_USER>::<CONNECTION_TOKEN> \ -n argo-events
kubectl apply -f memphis_eventsource.yaml
Create a file called “memphis_sensor.yaml”
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: memphis
spec:
template:
serviceAccountName: operate-workflow-sa
dependencies:
- name: test-dep
eventSourceName: memphis
eventName: example
triggers:
- template:
name: memphis-workflow-trigger
k8s:
operation: create
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: memphis-workflow-
spec:
entrypoint: whalesay
arguments:
parameters:
- name: message
value: hello world
templates:
- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
parameters:
- src:
dependencyName: test-dep
dest: spec.arguments.parameters.0.value
kubectl apply -f memphis_sensor.yaml
As Memphis works with streams, wrapping the subject will enable Memphis to control the subject.
To complete that step, NATS cli is needed.
For creating Memphis application-type users, read here.
nats stream add -s <MEMPHIS_BROKER_URL>:6666 --user=<MEMPHIS_APPLICATION_USER>::<MEMPHIS_CONNECTION_TOKEN>
? Stream Name argo_event_source
? Subjects argo_workflows
? Storage file
? Replication 3
? Retention Policy Limits
? Discard Policy Old
? Stream Messages Limit -1
? Per Subject Messages Limit -1
? Total Stream Size -1
? Message TTL -1
? Max Message Size -1
? Duplicate tracking time window 2m0s
? Allow message Roll-ups No
? Allow message deletion Yes
? Allow purging subjects or the entire stream Yes
Stream argo_event_source was created
Have a great day!