Go to file
Ben Wilson e96ad9e658
Merge pull request #13 from benzcash/tekton/tag-pipelines
Added tekton pipeline tag objects
2020-06-18 13:47:24 -04:00
kubernetes Fixed cloudlog refspec 2020-06-18 13:37:52 -04:00
.gitignore Second update 2020-03-24 09:12:37 -04:00
Dockerfile Smaller docker image 2020-04-07 10:01:23 -04:00
Makefile Smaller docker image 2020-04-07 10:01:23 -04:00
README.md Added README 2020-03-19 09:34:23 -04:00
go.mod Update go modules 2020-06-16 15:19:46 -04:00
go.sum Update go modules 2020-06-16 15:19:46 -04:00
main.go Second update 2020-03-24 09:12:37 -04:00
test Added test file 2020-04-13 14:03:31 -04:00
version.go Initial commit 2020-03-19 09:06:59 -04:00

README.md

cloudlog

A small application to forward received messages.

Right now, it will take in a CloudEvent message from a Tekton task and send Slack notifications.

Usage

Local usage for testing

$ slackURL='https://hooks.slack.com/services/T...' ./cloudlog

Kubernetes deployment

# Create Slack Webhook secret
kubectl create secret generic cloudlog-secret --from-literal slackURL='https://hooks.slack.com/services/T...'

# Create the cloudlog service
kubectl apply -f kubernetes/service.yml

# Create the cloudlog deployment (build your own image?)
kubectl apply -f kubernetes/deployment.yml

# Check that the pod is running
kubectl get pods  -l app=cloudlog

# Follow the logs
kubectl logs -f -l app=cloudlog

Tekton usage

Create a resource for the service

---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
  name: event-to-cloudlog
spec:
  type: cloudEvent
  params:
    - name: targetURI
      value: http://cloudlog.default.svc.cluster.local:3000/inbox

Utilize the resource as the output for a task

---
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: send-a-message
spec:
  inputs:
...
  outputs:
    resources:
      - name: notification
        type: cloudEvent

Provide TaskRun parameters for the resource

---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  generateName: send-message-
  label: send-message
spec:
...
  outputs:
    resources:
      - name: notification
        resourceRef:
          name: event-to-cloudlog