This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
Migrate k8s autodiscovery pipeline #11
Workflow file for this run
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: k8s-autodiscovery | |
on: | |
pull_request: ~ | |
schedule: | |
- cron: '0 18 * * *' | |
jobs: | |
# deploy-test-infra: | |
# runs-on: ubuntu-latest | |
k8s-autodiscovery: | |
# needs: | |
# - deploy-test-infra | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: "kubernetes autodiscover with elastic-agent" | |
tags: "elastic-agent" | |
platforms: [ "debian_10_amd64" ] | |
# - name: "kubernetes autodiscover with filebeat" | |
# tags: "filebeat" | |
# platforms: [ "debian_10_amd64" ] | |
# - name: "kubernetes autodiscover with heartbeat" | |
# tags: "heartbeat" | |
# platforms: [ "debian_10_amd64" ] | |
# - name: "kubernetes autodiscover with metricbeat" | |
# tags: "metricbeat" | |
# platforms: [ "debian_10_amd64" ] | |
env: | |
E2E_SSH_KEY: ${{ github.workspace }}/e2essh | |
E2E_SSH_KEY_PUB: ${{ github.workspace }}/e2essh.pub | |
SSH_KEY: ${{ github.workspace }}/e2essh # TODO: Refactor | |
ANSIBLE_CONFIG: ./.ci/ansible/ansible.cfg | |
ANSIBLE_HOST_KEY_CHECKING: False | |
STACK_INSTANCE_ID: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}_stack | |
STACK_VERSION: 8.9.0-473a43eb-SNAPSHOT | |
steps: | |
- uses: actions/checkout@v2 | |
- id: get-go-version | |
name: Get Go verion | |
run: echo "version=$(cat .go-version)" >> "$GITHUB_OUTPUT" | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ steps.get-go-version.outputs.version }} | |
- run: echo '${{ toJSON(matrix) }}' | |
- uses: hashicorp/[email protected] | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
method: approle | |
secrets: | | |
secret/observability-team/ci/elastic-observability-aws-account-auth access_key | AWS_ACCESS_KEY_ID ; | |
secret/observability-team/ci/elastic-observability-aws-account-auth secret_key | AWS_SECRET_ACCESS_KEY ; | |
- name: Create SSH Key | |
run: ssh-keygen -b 4096 -t rsa -f "${E2E_SSH_KEY}" -q -N "" | |
- name: debug | |
run: ls -la | |
- name: Deploy Stack | |
env: | |
SUITE: fleet | |
SSH_KEY: ${{ env.E2E_SSH_KEY }} | |
run: make -C .ci create-stack | |
- if: always() | |
name: Destroy Stack | |
run: make -C .ci destroy-stack | |