https://github.com/kubeshop/testkube-executor-keptn
https://github.com/kubeshop/testkube-executor-keptn
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kubeshop/testkube-executor-keptn
- Owner: kubeshop
- License: apache-2.0
- Created: 2022-02-04T11:21:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T14:14:36.000Z (almost 3 years ago)
- Last Synced: 2025-03-22T19:24:05.619Z (about 1 month ago)
- Language: Go
- Size: 60.5 KB
- Stars: 3
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# TestKube Executor Keptn
[](https://opensource.org/licenses/Apache-2.0) [](http://makeapullrequest.com) [](https://goreportcard.com/report/github.com/kubeshop/testkube-executor-keptn)
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](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](https://github.com/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](main.go) (specifically `processKeptnCloudEvent`), [deploy/service.yaml](deploy/service.yaml),
consult the [Keptn docs](https://keptn.sh/docs/) as well as existing [Keptn Core](https://github.com/keptn/keptn) and
[Keptn Contrib](https://github.com/keptn-contrib/) services.### Common tasks
* Build the binary: `go build -ldflags '-linkmode=external' -v -o testkube-executor-keptn`
* Run tests: `go test -race -v ./...`
* Build the docker image: `docker build . -t kubeshop/testkube-executor-keptn:0.12.0` (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:0.12.0`
* Push the docker image to DockerHub: `docker push kubeshop/testkube-executor-keptn:0.12.0` (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 testkube-executor-keptn -o wide`
* Get logs using `kubectl`: `kubectl -n keptn logs deployment/testkube-executor-keptn -f`
* Watch the deployed pods using `kubectl`: `kubectl -n keptn get pods -l run=testkube-executor-keptn`
* Deploy the service using [Skaffold](https://skaffold.dev/): `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](skaffold.yaml))### Testing Cloud Events
We have dummy cloud-events in the form of [RFC 2616](https://ietf.org/rfc/rfc2616.txt) requests in the [test-events/](test-events/) directory. These can be easily executed using third party plugins such as the [Huachao Mao REST Client in VS Code](https://marketplace.visualstudio.com/items?itemName=humao.rest-client).