Skip to content

Commit

Permalink
Add testing chart in kind
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman committed Apr 12, 2023
1 parent 21abae5 commit 7ceff8f
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/go-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,35 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.11.0
version: 3.11.2

- name: Template Helm chart
working-directory: ./chart
run: helm template . > /dev/null

test-helm-integration:
name: Test integration with Helm chart
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.11.2

- name: Include current chart versions
working-directory: .helm/logstash-integration-test-chart
run: helm dependency update

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.4.0

- name: Install Helm chart
working-directory: .helm/logstash-integration-test-chart
run: helm install --atomic --wait --timeout 15m --debug logstash-integration-test-chart .

test-integration:
name: Test integration with Prometheus
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -256,7 +279,12 @@ jobs:
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
needs: [build-linux, build-darwin, build-windows, build-linux-docker-image]
needs:
- build-linux
- build-darwin
- build-windows
- build-linux-docker-image
- test-integration
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
Expand Down
23 changes: 23 additions & 0 deletions .helm/logstash-integration-test-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions .helm/logstash-integration-test-chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: logstash
repository: https://helm.elastic.co
version: 8.5.1
- name: elasticsearch
repository: https://helm.elastic.co
version: 8.5.1
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 20.2.0
- name: logstash-exporter
repository: file://../../chart/
version: v1.0.2
digest: sha256:0d966a53b3f0eff8f8008de0473ebfbd7c279267a3fb0bde601fece4404539db
generated: "2023-04-12T10:08:39.085004988+02:00"
22 changes: 22 additions & 0 deletions .helm/logstash-integration-test-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: logstash-integration-test-chart
description: Helm chart for testing the logstash-exporter Helm chart
type: application
version: 0.1.0
dependencies:
- name: logstash
version: "8.5.1"
repository: https://helm.elastic.co
condition: logstash.enabled
- name: elasticsearch
version: "8.5.1"
repository: https://helm.elastic.co
condition: elasticsearch.enabled
- name: prometheus
version: "^20.2.0"
repository: https://prometheus-community.github.io/helm-charts
condition: prometheus.enabled
- name: logstash-exporter
version: "*"
repository: file://../../chart/
condition: logstash-exporter.enabled
46 changes: 46 additions & 0 deletions .helm/logstash-integration-test-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
logstash:
enabled: true
config: |
input {
generator {
type => "dummy"
count => -1
message => '{"message": "dummy log"}'
}
}
filter {
json {
source => "message"
}
}
output {
elasticsearch {
hosts => ["http://elasticsearch:9200"]
}
}
prometheus:
enabled: true
config: |
global:
scrape_interval: 5s
scrape_configs:
- job_name: "logstash-exporter"
scrape_interval: 5s
scrape_timeout: 5s
metrics_path: "/metrics"
scheme: "http"
static_configs:
- targets: ["exporter:9198"]
elasticsearch:
enabled: true
replicas: 1
minimumMasterNodes: 1
esJavaOpts: "-Xms512m -Xmx512m"

logstash-exporter:
enabled: true

0 comments on commit 7ceff8f

Please sign in to comment.