Release logzio-monitoring
v6.0.7 chart
#6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Logzio Monitoring Helm Chart on EKS Kubernetes Environments | |
on: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'charts/logzio-monitoring/**' | |
jobs: | |
test-helm-chart: | |
name: Test Helm Chart | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
environment: [eks-linux] | |
steps: | |
- name: Generate random id | |
id: random_id | |
run: echo "::set-output name=rand::$(echo $RANDOM)" | |
- name: Set ENV_ID | |
run: echo "ENV_ID=monitoring-test-run-${{ steps.random_id.outputs.rand }}-${{ matrix.environment }}" >> $GITHUB_ENV | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
- name: Set up Helm | |
uses: azure/setup-helm@v4.2.0 | |
- name: Set up kubectl | |
uses: azure/setup-kubectl@v4 | |
- name: Install AWS CLI | |
run: | | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install --update | |
- name: Set up eksctl | |
run: | | |
ARCH=amd64 | |
PLATFORM=$(uname -s)_$ARCH | |
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz" | |
# (Optional) Verify checksum | |
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check | |
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz | |
sudo mv /tmp/eksctl /usr/local/bin | |
- name: Provision Cluster | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
NUMBER_OF_NODES: 3 | |
AWS_REGION: us-west-1 | |
run: | | |
eksctl create cluster --name ${{ env.ENV_ID }}-${{ matrix.environment }} --region ${{ env.AWS_REGION }} --nodes ${{ env.NUMBER_OF_NODES }} --with-oidc | |
aws eks --region ${{ env.AWS_REGION }} update-kubeconfig --name ${{ env.ENV_ID }}-${{ matrix.environment }} | |
- name: Label Nodes | |
run: | | |
kubectl get nodes -o name | xargs -I {} kubectl label {} node-role.kubernetes.io/worker=worker --overwrite | |
- name: Deploy Helm Chart | |
run: | | |
cd charts/logzio-monitoring | |
helm dependency build | |
helm upgrade --install \ | |
--set logs.enabled=true \ | |
--set logzio-logs-collector.enabled=true \ | |
--set logzio-logs-collector.secrets.logzioLogsToken="${{ secrets.LOGZIO_LOGS_TOKEN }}" \ | |
--set logzio-logs-collector.secrets.logzioRegion="us" \ | |
--set logzio-logs-collector.secrets.env_id="${{ env.ENV_ID }}" \ | |
--set secrets.logType="test" \ | |
--set metricsOrTraces.enabled=true \ | |
--set logzio-k8s-telemetry.metrics.enabled=true \ | |
--set logzio-k8s-telemetry.secrets.MetricsToken="${{ secrets.LOGZIO_METRICS_TOKEN }}" \ | |
--set logzio-k8s-telemetry.secrets.ListenerHost="https://listener.logz.io:8053" \ | |
--set logzio-k8s-telemetry.secrets.p8s_logzio_name="${{ env.ENV_ID }}" \ | |
--set logzio-k8s-telemetry.traces.enabled=true \ | |
--set logzio-k8s-telemetry.secrets.TracesToken="${{ secrets.LOGZIO_TRACES_TOKEN }}" \ | |
--set logzio-k8s-telemetry.secrets.LogzioRegion="us" \ | |
--set logzio-k8s-telemetry.spm.enabled=true \ | |
--set logzio-k8s-telemetry.secrets.env_id="${{ env.ENV_ID }}" \ | |
--set logzio-k8s-telemetry.secrets.SpmToken="${{ secrets.LOGZIO_METRICS_TOKEN }}" \ | |
--set logzio-k8s-telemetry.serviceGraph.enabled=true \ | |
logzio-monitoring . | |
kubectl rollout status deployment/logzio-monitoring-otel-collector-standalone --timeout=300s | |
kubectl rollout status deployment/logzio-monitoring-otel-collector-spm --timeout=300s | |
- name: run log generator | |
run: | | |
kubectl apply -f tests/resources/logsgen.yaml | |
kubectl rollout status deployment/log-generator --timeout=300s | |
- name: run trace generator | |
run: | | |
kubectl apply -f tests/resources/tracegen-monitoring.yaml | |
kubectl rollout status deployment/trace-gen --timeout=300s | |
- name: sleep | |
run: sleep 120 | |
- name: Run Go Tests | |
env: | |
KUBERNETES_ENV: ${{ matrix.environment }} | |
LOGZIO_METRICS_API_KEY: ${{ secrets.LOGZIO_METRICS_API_KEY }} | |
LOGZIO_TRACES_API_KEY: ${{ secrets.LOGZIO_TRACES_API_KEY }} | |
LOGZIO_LOGS_API_KEY: ${{ secrets.LOGZIO_LOGS_API_KEY }} | |
run: | | |
go get go.uber.org/zap | |
go test -v ./tests/traces_e2e_test.go ./tests/common.go | |
go test -v ./tests/metrics_e2e_test.go ./tests/common.go | |
go test -v ./tests/logs_e2e_test.go ./tests/common.go | |
- name: Cleanup Environment | |
run: | | |
helm uninstall logzio-monitoring | |
- name: Delete Cluster | |
if: always() | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-west-1 | |
run: | | |
eksctl delete cluster --name ${{ env.ENV_ID }}-${{ matrix.environment }} --region ${{ env.AWS_REGION }} | |