-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Kubernetes target #1441
Labels
Comments
Raised at least 2 more times by users wanting to trigger a Kubernetes Job. |
I have a similar requirement. I have to create and execute a container everytime a particular event is received. I have tried a lot playing around different K8S APIs, but have been half-successful. Here is what I've tried:
Target YAML: apiVersion: targets.triggermesh.io/v1alpha1
kind: HTTPTarget
metadata:
name: call-abi-pod
namespace: default
spec:
restartPolicy: Always
response:
eventType: CallPodResponseEvent
eventSource: kubernetes-api-response
skipVerify: true
endpoint: 'https://kubernetes.docker.internal:6443/apis/batch/v1/namespaces/default/jobs'
method: 'POST'
headers:
Content-type: 'application/yaml'
data: |
apiVersion: batch/v1
kind: Job
metadata:
name: sample-abi-job
spec:
ttlSecondsAfterFinished: 30
template:
metadata:
name: sample-abi-job
spec:
containers:
- name: abi-demo
image: busybox
imagePullPolicy: IfNotPresent
env:
- name: JOB_LOG_DIR
value: "/tmp/log/abinitio/" # This should be changed to above line in the actual Ab Initio container
command:
- /bin/sh
- -c
- mkdir -p ${JOB_LOG_DIR}; echo [`date +"%Y-%m-%d-%H:%M:%S"`]-Hello this is a sample log file from Ab>Initio job. >> ${JOB_LOG_DIR}/fl_scenario.log; echo "Log file written successfully."; cat ${JOB_LOG_DIR}/fl_scenario.log;
restartPolicy: Never
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, It will be awesome if we can transform our Event to Kubernetes manifest and post it to API.
I think a bigger problem here is a templating, because we need to merge our event data with kubernetes manifest data. (I'm not sure if it's a nature for TriggerMash).
Links with similar implementations:
The text was updated successfully, but these errors were encountered: