Skip to content

Commit

Permalink
Create kubernetes deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-yves-monnet committed Sep 24, 2024
1 parent 01b927f commit 32e0096
Show file tree
Hide file tree
Showing 15 changed files with 446 additions and 10 deletions.
73 changes: 73 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
49 changes: 49 additions & 0 deletions .github/workflows/deploy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# see https://github.com/camunda-community-hub/community-action-maven-release
name: Deploy artifacts with Maven
on:
push:
branches: [main]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java environment
uses: actions/setup-java@v1
with:
java-version: 17
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }}
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE
- name: Deploy SNAPSHOT / Release
uses: camunda-community-hub/community-action-maven-release@v1
with:
release-version: ${{ github.event.release.tag_name }}
release-profile: community-action-maven-release
nexus-usr: ${{ secrets.NEXUS_USR }}
nexus-psw: ${{ secrets.NEXUS_PSW }}
maven-usr: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_USR }}
maven-psw: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_PSW }}
maven-url: oss.sonatype.org
maven-gpg-passphrase: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_PASSPHRASE }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# maven-additional-options: -source 17
id: release
- if: github.event.release
name: Attach artifacts to GitHub Release (Release only)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.release.outputs.artifacts_archive_path }}
asset_name: ${{ steps.release.outputs.artifacts_archive_path }}
asset_content_type: application/zip
26 changes: 26 additions & 0 deletions .github/workflows/mvn-build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build via Maven and run tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Set up NPM
uses: actions/setup-node@v3

- name: Build with Maven
run: CI=false mvn --batch-mode --update-snapshots package
58 changes: 58 additions & 0 deletions .github/workflows/mvn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy artifacts with Maven
on:
push:
branches: [main]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: mvn-release Checkout
uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java environment
uses: actions/setup-java@v1
with:
java-version: 17
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }}
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE

- name: Set up NPM
uses: actions/setup-node@v3

- name: Build with Maven
run: CI=false mvn --batch-mode --update-snapshots package

- name: Deploy SNAPSHOT / Release
uses: camunda-community-hub/community-action-maven-release@main
with:
release-version: ${{ github.event.release.tag_name }}
nexus-usr: ${{ secrets.NEXUS_USR }}
nexus-psw: ${{ secrets.NEXUS_PSW }}
maven-usr: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_USR }}
maven-psw: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_PSW }}
maven-gpg-passphrase: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_PASSPHRASE }}
github-token: ${{ secrets.GITHUB_TOKEN }}
maven-auto-release-after-close: true
maven-url: s01.oss.sonatype.org
id: release

- if: github.event.release
name: Attach artifacts to GitHub Release (Release only)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.release.outputs.artifacts_archive_path }}
asset_name: ${{ steps.release.outputs.artifacts_archive_path }}
asset_content_type: application/zip
63 changes: 63 additions & 0 deletions .github/workflows/publish-github.package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.


name: Create and publish a Docker image

on:
push:
branches: [main]
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: publish-github Checkout repository
uses: actions/checkout@v3

- name: Set up Java environment
uses: actions/setup-java@v1
with:
java-version: 17
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }}
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE

- name: Set up NPM
uses: actions/setup-node@v3

- name: Build with Maven
run: CI=false mvn --batch-mode --update-snapshots package

- name: OperationLog in to the Container registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
version: v0.7.0
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# docker build -t zeebe-cherry:1.0.0 .
FROM eclipse-temurin:21-jdk-alpine
EXPOSE 9081
COPY target/camunda-8-monitor-exporters-*-exec.jar /camunda-8-monitor-exporters.jar
COPY pom.xml /pom.xml

WORKDIR /

ENTRYPOINT ["java","-jar","/camunda-8-monitor-exporters.jar"]

43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Does Operate importer follow the throughput? Are late behind?
This project help to monitor this section.

it will take every X seconds a photography on different tools, and on different item (process instance, variable) and calculate the delay.
It will provide the tendance: does Operate retrieve the backlog? Or diverge?
It will provide the tendency: does Operate retrieve the backlog? Or diverge?

# Run as a project
Run the command
Expand All @@ -21,7 +21,46 @@ Run the command
To integrate the monitoring in a another tool, follow this instruction


# REST API
# Create a Docker image for a new version

Run
```shell
mvn package

```

Manual operation
Now, create a docker image.
````
docker build -t pierre-yves-monnet/camunda-8-monitor-exporters:1.0.0 .
````


Push the image to the Camunda hub (you must be login first to the docker registry)

````
docker tag pierre-yves-monnet/camunda-8-monitor-exporters:1.0.0 ghcr.io/camunda-community-hub/camunda-8-monitor-exporters:1.0.0
docker push ghcr.io/camunda-community-hub/camunda-8-monitor-exporters:1.0.0
````


Tag as the latest:
````
docker tag pierre-yves-monnet/camunda-8-monitor-exporters:1.0.0 ghcr.io/camunda-community-hub/camunda-8-monitor-exporters:latest
docker push ghcr.io/camunda-community-hub/camunda-8-monitor-exporters:latest
````


The image is available here.

```
ghcr.io/camunda-community-hub/camunda-8-monitor-exporters:latest
````
# REST API Used
See https://confluence.camunda.com/pages/viewpage.action?pageId=207061205
## Zeebe
The Rest API collect
Expand Down
24 changes: 24 additions & 0 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Introduction
This directory contains a help deployment to deploy Monitor Exporter runtime on 1 pods

# Deployment
Check the deployment file, and adapt it.

## Connection to ElasticSearch
The deployment must be run in the same cluster as Zeebe. If it is a different cluster, then the zeebe connection must be adapted

# Operation

```shell
kubectl create -f camunda-8-monitor-exporters.yaml
```
Check the logs

```shell
kubectl get pods
kubectl logs -f
```

```shell
kubectl delete -f camunda-8-monitor-exporters.yaml
```
Loading

0 comments on commit 32e0096

Please sign in to comment.