This implements a freight-keptn-go for Keptn. If you want to learn more about Keptn visit them on keptn.sh
Keptn Version | freight-keptn-go Docker Image |
---|---|
0.6.1 | freightclear/freight-keptn-go:0.1.0 |
The freight-keptn-go can be installed as a part of Keptn's uniform.
To deploy the current version of the freight-keptn-go in your Keptn Kubernetes cluster, apply the deploy/service.yaml
file:
kubectl apply -f deploy/service.yaml
This should install the freight-keptn-go
together with a Keptn distributor
into the freight-keptn
namespace, which you can verify using
kubectl -n keptn get deployment freight-keptn-go -o wide
kubectl -n keptn get pods -l run=freight-keptn-go
Adapt and use the following command in case you want to up- or downgrade your installed version (specified by the $VERSION
placeholder):
kubectl -n keptn set image deployment/freight-keptn-go freight-keptn-go=freightclear/freight-keptn-go:$VERSION --record
To delete a deployed freight-keptn-go, use the file deploy/*.yaml
files from this repository and delete the Kubernetes resources:
kubectl delete -f deploy/service.yaml
It is recommended to make use of branches as follows:
master
contains the latest potentially unstable versionrelease-*
contains a stable version of the service (e.g.,release-0.1.0
contains version 0.1.0)- create a new branch for any changes that you are working on, e.g.,
feature/my-cool-stuff
orbug/overflow
- once ready, create a pull request from that branch back to the
master
branch
When writing code, it is recommended to follow the coding style suggested by the Golang community.
To better understand Keptn CloudEvents, please look at the Keptn Spec.
If you want to get more insights, please look into main.go, deploy/service.yaml, consult the Keptn docs as well as existing Keptn Core and Keptn Contrib services.
- Build the binary:
go build -ldflags '-linkmode=external' -v -o freight-keptn-go
- Run tests:
go test -race -v ./...
- Build the docker image:
docker build . -t freightclear/freight-keptn-go:dev
(Note: Ensure that you use the correct DockerHub account/organization) - Run the docker image locally:
docker run --rm -it -p 8080:8080 freightclear/freight-keptn-go:dev
- Push the docker image to DockerHub:
docker push freightclear/freight-keptn-go: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 freight-keptn-go -o wide
- Get logs using
kubectl
:kubectl -n keptn logs deployment/freight-keptn-go -f
- Watch the deployed pods using
kubectl
:kubectl -n keptn get pods -l run=freight-keptn-go
- Deploy the service using Skaffold:
skaffold run --default-repo=your-docker-registry --tail
(Note: Replaceyour-docker-registry
with your DockerHub username; also make sure to adapt the image name in skaffold.yaml)
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.
This repo uses reviewdog for automated reviews of Pull Requests.
You can find the details in .github/workflows/reviewdog.yml.
This repo has automated unit tests for pull requests.
You can find the details in .github/workflows/tests.yml.
This repo uses Travis-CI to automatically build docker images. You can find the implementation of the build-job in .travis.yml.
If any problems occur, fix them in the release branch and test them again.
Once you have confirmed that everything works and your version is ready to go, you should
- create a new release on the release branch using the GitHub releases page, and
- merge any changes from the release branch back to the master branch.
Please find more information in the LICENSE file.