Skip to content

kingsathurthi/testkube-executor-keptn

 
 

Repository files navigation

TestKube Executor Keptn

License PRs Welcome Go Report Card

Discord server: https://discord.gg/8RVUapTP

DockerHub repository: https://hub.docker.com/repository/docker/kubeshop/testkube-executor-keptn

This is a Keptn Service Template written in GoLang. Follow the instructions below for writing your own Keptn integration.

Where to start

If you don't care about the details, your first entrypoint is eventhandlers.go. Within this file you can add implementation for pre-defined Keptn Cloud events.

To better understand all variants of Keptn CloudEvents, please look at the Keptn Spec.

If you want to get more insights into processing those CloudEvents or even defining your own CloudEvents in code, please look into main.go (specifically processKeptnCloudEvent), deploy/service.yaml, consult the Keptn docs as well as existing Keptn Core and Keptn Contrib services.

Common tasks

  • Build the binary: go build -ldflags '-linkmode=external' -v -o keptn-service-template-go
  • Run tests: go test -race -v ./...
  • Build the docker image: docker build . -t kubeshop/testkube-executor-keptn:dev (Note: Ensure that you use the correct DockerHub account/organization)
  • Run the docker image locally: docker run --rm -it -p 8080:8080 kubeshop/testkube-executor-keptn:dev
  • Push the docker image to DockerHub: docker push kubeshop/testkube-executor-keptn:dev (Note: Ensure that you use the correct DockerHub account/organization)
  • Deploy the service using kubectl: kubectl apply -f deploy/
  • Delete/undeploy the service using kubectl: kubectl delete -f deploy/
  • Watch the deployment using kubectl: kubectl -n keptn get deployment keptn-service-template-go -o wide
  • Get logs using kubectl: kubectl -n keptn logs deployment/keptn-service-template-go -f
  • Watch the deployed pods using kubectl: kubectl -n keptn get pods -l run=keptn-service-template-go
  • Deploy the service using Skaffold: skaffold run --default-repo=your-docker-registry --tail (Note: Replace your-docker-registry with your DockerHub username; also make sure to adapt the image name in skaffold.yaml)

Testing Cloud Events

We have dummy cloud-events in the form of RFC 2616 requests in the test-events/ directory. These can be easily executed using third party plugins such as the Huachao Mao REST Client in VS Code.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 88.1%
  • Dockerfile 4.7%
  • Smarty 4.2%
  • Shell 3.0%