zendesk/

directory
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2020 License: Apache-2.0

README

Zendesk Source for Knative

The Zendesk Source enables integration of Zendesk events with Knative, allowing end-users the ablility to subscribe new Ticket events.

Contents

Building

The entry point (main package) for the controller and target adapter are respectively under cmd/controller/ and cmd/adapter/. Both these programs can be built using the Go toolchain from the knative-sources/zendesk directory:

$ make build

Binaries will be generated for your current OS and architecture inside the root repo _output thdirectory.

Those binaries can also be packaged as container images in order to run inside a Kubernetes cluster:

$ make image

To list the other 'make' functions:

$ make help

Deploy a Controller

Deploy a Zendesk Source Controller From Code

ko provides a quick method to build from source and apply the associated Kuberneties configurations.

$ ko apply -f ./config/

Alternatively you can base on the manifests at the config repo to build a set of kubernetes manifests that use your customized images and namespace.

Create Zendesk Integration

Deploy a Zendesk Source

An instance of the Zendesk Source is created by applying a manifest that fullfills its CRD schema. Accepted Spec parameters are:

  • subdomain for the Zendesk tenant being used.
  • email associated with THE Zendesk account.
  • token generated from Zendesk admin site for the integration.
  • webhookUsername that will be used to verify event callbacks.
  • webhookPassword that will be used to verify event callbacks.

All parameters are required.

Note that webhookUsername and webhookPassword are arbitrary values and will be used from zendesk to sign requests, and at the Zendesk source to verify them.

Example Secret Deployment:

apiVersion: v1
kind: Secret
metadata:
  name: zendesksource
type: Opaque
stringData:
  token: 'tHpUJ2ieiXsxEvBotczR99EwpETeQOiUU07KovBJ'
  password: 'Pa$$sw0rd'

Example Source Deployment:

apiVersion: sources.triggermesh.io/v1alpha1
kind: ZendeskSource
metadata:
  name: zendesksource
spec:
  email: coyote@acmeanvils.com
  subdomain: 'acmeanvils'
  token:
    secretKeyRef:
      name: zendesksource
      key: token
  webhookUsername: 'webhookuser'
  webhookPassword:
    secretKeyRef:
      name: zendesksource
      key: webhookPassword
  sink:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: event-display

The example relies on an event-display service and on the zendesksource secret that should contains token and webhookPassword keys.

Verify a Zendesk Source Deployment
  • To verify a successful deployment of a Zendesk source instance navigate to the settings sidebar of your Zendesk subdomain and select Extensions:

i

  • A Zendesk Source creates a new Extension/Target prefixed with: io.triggermesh..

i

  • The target is linked to a Trigger which can be found by navigating to the settings sidebar of your Zendesk subdomain and selecting Triggers.

i

  • A Trigger is assigned the same name as the associated Target:

i

  • Click on the source created Trigger to access the configured conditions and actions.

i

Customizing the integration

The integration can be customized by modifying the Trigger configuration. The action Notify target and the source created target should be selected.

We provide a default JSON body that will be ingested through the Zendesk source, but you can add and remove fields to fit your needs.

It is important to note that the we try to populate the Cloud Events header using incoming fields:

  • id field at the JSON body will be used to populate the Cloud Event ID.
  • title field at the JSON body will be used to populate the Cloud Event Subject.
  • ticket_type field at the JSON body will be used to populate a Cloud Event extension called ticket_type.

Events

Below you can find an example Cloudevent from a Zendesk Source.

Validation: valid
Context Attributes,
  specversion: 1.0
  type: com.zendesk.ticket
  source: triggermesh.zendesksource-tmtickets
  subject: play that again
  id: 42
  time: 2020-07-15T09:05:11.539147977Z
  datacontenttype: application/json
Data,
  {
    "asignee": "Pauline Oliveros",
    "description": "----------------------------------------------\n\nTriggermesh Developer, Jul 15, 2020, 6:05 AM\n\nwe have many requests to play that again",
    "due_date": "",
    "id": "42",
    "organization": "",
    "requester": "Triggermesh Developer",
    "tags": "",
    "title": "play that again",
    "type": "Ticket",
    "url": "triggermesh.zendesk.com/agent/tickets/42"
  }

Support

This is heavily Work In Progress We would love your feedback on this Operator so don't hesitate to let us know what is wrong and how we could improve it, just file an issue

Directories

Path Synopsis
cmd
adapter command
controller command
pkg
apis/sources/v1alpha1
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=sources.triggermesh.io
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=sources.triggermesh.io
client/generated/clientset/internalclientset
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/generated/clientset/internalclientset/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/generated/clientset/internalclientset/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/generated/clientset/internalclientset/typed/sources/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/generated/clientset/internalclientset/typed/sources/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL