2023-08-21 02:01:33 -04:00
|
|
|
name: Log Collection Deployment
|
|
|
|
description: Deploy log collection functionality to the cluster.
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
logstash-port:
|
|
|
|
description: "The port of the logstash service."
|
|
|
|
default: "5045"
|
|
|
|
kubeconfig:
|
|
|
|
description: "The kubeconfig of the cluster to deploy to."
|
|
|
|
required: true
|
|
|
|
opensearchUser:
|
|
|
|
description: "The username of the opensearch cluster."
|
|
|
|
required: true
|
|
|
|
opensearchPwd:
|
|
|
|
description: "The password of the opensearch cluster."
|
|
|
|
required: true
|
|
|
|
test:
|
|
|
|
description: "The e2e test payload."
|
|
|
|
required: true
|
|
|
|
provider:
|
|
|
|
description: "The CSP of the cluster."
|
|
|
|
required: true
|
|
|
|
isDebugImage:
|
|
|
|
description: "Whether the cluster is a debug cluster / uses a debug image."
|
|
|
|
required: true
|
2023-09-26 07:17:59 -04:00
|
|
|
refStream:
|
|
|
|
description: "Reference and stream of the image in use"
|
|
|
|
required: false
|
|
|
|
kubernetesVersion:
|
|
|
|
description: "Kubernetes version of the cluster"
|
|
|
|
required: false
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation:
|
|
|
|
description: "How the infrastructure for the e2e test was created. One of [cli, self-managed, terraform]."
|
|
|
|
default: "cli"
|
2023-08-21 02:01:33 -04:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Template Logcollection Helm Values
|
|
|
|
id: template
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
bazel run //hack/logcollector template -- \
|
|
|
|
--dir $(realpath .) \
|
|
|
|
--username ${{ inputs.opensearchUser }} \
|
|
|
|
--password ${{ inputs.opensearchPwd }} \
|
|
|
|
--port ${{ inputs.logstash-port }} \
|
|
|
|
--fields github.actor="${{ github.triggering_actor }}" \
|
|
|
|
--fields github.workflow="${{ github.workflow }}" \
|
|
|
|
--fields github.run-id="${{ github.run_id }}" \
|
|
|
|
--fields github.run-attempt="${{ github.run_attempt }}" \
|
|
|
|
--fields github.ref-name="${{ github.ref_name }}" \
|
|
|
|
--fields github.sha="${{ github.sha }}" \
|
|
|
|
--fields github.runner-os="${{ runner.os }}" \
|
|
|
|
--fields github.e2e-test-payload="${{ inputs.test }}" \
|
2023-09-27 10:17:31 -04:00
|
|
|
--fields github.is-debug-cluster="${{ inputs.isDebugImage }}" \
|
2023-08-21 02:01:33 -04:00
|
|
|
--fields github.e2e-test-provider="${{ inputs.provider }}" \
|
2023-09-26 07:17:59 -04:00
|
|
|
--fields github.ref-stream="${{ inputs.refStream }}" \
|
|
|
|
--fields github.kubernetes-version="${{ inputs.kubernetesVersion }}" \
|
2023-12-15 04:37:29 -05:00
|
|
|
--fields github.cluster-creation="${{ inputs.clusterCreation }}" \
|
2023-08-21 02:01:33 -04:00
|
|
|
--fields deployment-type="k8s"
|
|
|
|
|
2023-09-14 06:03:13 -04:00
|
|
|
# Make sure that helm is installed
|
|
|
|
# This is not always the case, e.g. on MacOS runners
|
|
|
|
- name: Install Helm
|
2023-09-14 08:29:46 -04:00
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2023-09-14 06:03:13 -04:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
|
2023-08-21 02:01:33 -04:00
|
|
|
- name: Deploy Logstash
|
|
|
|
id: deploy-logstash
|
|
|
|
shell: bash
|
|
|
|
working-directory: ./logstash
|
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
run: |
|
|
|
|
helm repo add elastic https://helm.elastic.co
|
|
|
|
helm repo update
|
|
|
|
helm install logstash elastic/logstash \
|
|
|
|
--wait --timeout=1200s --values values.yml
|
|
|
|
|
|
|
|
- name: Deploy Filebeat
|
|
|
|
id: deploy-filebeat
|
|
|
|
shell: bash
|
|
|
|
working-directory: ./filebeat
|
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
run: |
|
|
|
|
helm repo add elastic https://helm.elastic.co
|
|
|
|
helm repo update
|
|
|
|
helm install filebeat elastic/filebeat \
|
|
|
|
--wait --timeout=1200s --values values.yml
|