Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Logging Tests

on:
workflow_call:
inputs:
service_branch:
required: false
type: string
versions_file:
description: 'Path to versions list file'
type: string
required: true
pipeline_branch:
description: 'Test pipeline branch name'
type: string
required: true
runner_type:
description: 'Runner type (self-hosted or ubuntu-latest)'
type: string
required: false
default: 'ubuntu-latest'
opensearch_version:
type: string
required: true
default: 'release-2025.2-1.14.4'
jobs:
prepare-versions:
runs-on: ${{ inputs.runner_type }}
outputs:
versions: ${{ steps.process-versions.outputs.versions }}
previous_version: ${{ steps.process-versions.outputs.previous_version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: '${{ inputs.service_branch }}'
repository: 'Netcracker/qubership-logging-operator'
path: 'qubership-logging-operator'
- name: Process versions file
id: process-versions
run: |
versions_str=$(cat qubership-logging-operator/${{ inputs.versions_file }})
versions_json=$(echo $versions_str | jq -R -s -c 'split(" ")')
echo "versions=$versions_json" >> $GITHUB_OUTPUT
previous_version=$(echo "$versions_json" | jq -r '.[-1]')
echo "previous_version=$previous_version" >> $GITHUB_OUTPUT
Clean-Latest-Graylog-Fluentbit:
name: Run Integration Tests
runs-on: ${{ inputs.runner_type }}
steps:
- uses: actions/checkout@v4
with:
ref: '${{ inputs.pipeline_branch }}'
repository: 'Netcracker/qubership-test-pipelines'
path: 'qubership-test-pipelines'

- name: Create cluster
uses: ./qubership-test-pipelines/actions/shared/create_cluster
with:
path_to_template: 'qubership-test-pipelines/kind-configs/kind-single-node.yaml'

- name: Install cert-manager
uses: ./qubership-test-pipelines/actions/shared/install_cert_manager

- name: Install Opensearch
uses: ./qubership-test-pipelines/actions/opensearch/helm_deploy_opensearch
with:
path_to_template: 'templates/opensearch-service/opensearch_clean_basic_for_logging.yaml'
service_branch: '${{ inputs.opensearch_version }}'

- name: Check opensearch deployment status
uses: ./qubership-test-pipelines/actions/opensearch/verify_installation_opensearch
with:
service_branch: '${{ inputs.opensearch_version }}'

- name: Create audit directory required for fluentbit
shell: bash
run: |
set -euo pipefail
for node in $(docker ps --format '{{.Names}}' | grep '^kind-' | grep -v 'external-load-balancer'); do
echo "Creating the folder on the $node node"
docker exec "$node" bash -c "mkdir -p /var/log/audit && chown 1000:1000 /var/log/audit && echo 'Created /var/log/audit with the permissions:' && ls -ld /var/log/audit"
done

- name: Install required CRDs
uses: ./qubership-test-pipelines/actions/logging/install_crds

- name: Install logging-operator
uses: ./qubership-test-pipelines/actions/logging/helm_deploy_logging
with:
path_to_template: 'templates/logging-operator/logging_clean_graylog_fluentbit.yaml'
service_branch: ${{ inputs.service_branch }}

- name: Check logging-operator status
uses: ./qubership-test-pipelines/actions/logging/verify_installation_logging
with:
service_branch: ${{ inputs.service_branch }}
54 changes: 54 additions & 0 deletions actions/logging/helm_deploy_logging/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Helm deploy Action for Logging"
description: "GitHub Action for install/upgrade Logging using Helm"
inputs:
deploy_mode:
description: 'See helm_deploy.deploy_mode'
required: true
default: 'install'
restricted:
description: 'See helm_deploy.restricted'
required: true
default: 'false'
type: boolean
path_to_template:
description: 'See helm_deploy.path_to_template'
required: true
service_branch:
description: 'branch name in repository with service'
required: true
service_name:
description: 'See helm_deploy.service_name'
required: true
default: 'logging-operator'
repository_name:
description: 'See helm_deploy.repository_name'
required: true
default: 'Netcracker/qubership-logging-operator'
path_to_chart:
description: 'See helm_deploy.path_to_chart'
required: true
default: 'charts/qubership-logging-operator'
namespace:
description: 'See helm_deploy.namespace'
required: true
default: 'logging'
resource_folder:
description: 'See helm_deploy.resource_folder'
required: true
default: ''
runs:
using: 'composite'
steps:
- name: Run helm_install action for Logging
uses: ./qubership-test-pipelines/actions/shared/helm_deploy
with:
deploy_mode: ${{ inputs.deploy_mode }}
restricted: ${{ inputs.restricted }}
path_to_template: ${{ inputs.path_to_template }}
service_branch: ${{ inputs.service_branch }}
service_name: ${{ inputs.service_name }}
repository_name: ${{ inputs.repository_name }}
path_to_chart: ${{ inputs.path_to_chart }}
namespace: ${{ inputs.namespace }}
resource_folder: ${{ inputs.resource_folder }}
install_crds: 'false'
22 changes: 22 additions & 0 deletions actions/logging/install_crds/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Install CRDs required for logging
description: "GitHub Action for install CRDs required for logging"

inputs:
namespace:
description: 'Namespace where logging is installed'
required: 'true'
default: 'logging'
monitoring_branch:
description: 'Branch with CRDs to be used'
required: 'true'
default: 'tags/0.81.0'
runs:
using: 'composite'
steps:
- name: 'Apply CRDs required for logging'
shell: bash
run: |
kubectl apply -f https://raw.githubusercontent.com/Netcracker/qubership-monitoring-operator/refs/${{ inputs.monitoring_branch }}/charts/qubership-monitoring-operator/charts/grafana-operator/crds/integreatly.org_grafanadashboards.yaml
kubectl apply -f https://raw.githubusercontent.com/Netcracker/qubership-monitoring-operator/refs/${{ inputs.monitoring_branch }}/charts/qubership-monitoring-operator/charts/victoriametrics-operator/crds/monitoring.coreos.com_prometheusrules.yaml
kubectl apply -f https://raw.githubusercontent.com/Netcracker/qubership-monitoring-operator/refs/${{ inputs.monitoring_branch }}/charts/qubership-monitoring-operator/charts/victoriametrics-operator/crds/monitoring.coreos.com_servicemonitors.yaml
kubectl apply -f https://raw.githubusercontent.com/Netcracker/qubership-monitoring-operator/refs/${{ inputs.monitoring_branch }}/charts/qubership-monitoring-operator/charts/victoriametrics-operator/crds/monitoring.coreos.com_podmonitors.yaml
50 changes: 50 additions & 0 deletions actions/logging/verify_installation_logging/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Verify logging installation
description: 'A GitHub Action to verify tests, get logs from pods'
inputs:
namespace:
description: 'See verify_installation.namespace'
required: true
default: logging
max_attempts:
description: 'See verify_installation.max_attempts'
required: true
default: 60
timeout:
description: 'See verify_installation.timeout'
required: true
default: '10s'
max_attempts_for_provisioner:
description: 'See verify_installation.max_attempts'
required: true
default: 50
timeout_for_provisioner:
description: 'See verify_installation.timeout'
required: true
default: '10s'
service_branch:
description: 'See verify_installation.service_branch'
required: true
default: ''
cr_kind:
description: 'See verify_installation.cr_kind'
required: true
default: 'LoggingService'
cr_name:
description: 'See verify_installation.cr_name'
required: true
default: 'qubership-logging'

runs:
using: 'composite'
steps:
- name: Run verify_installation action for Logging
uses: ./qubership-test-pipelines/actions/shared/verify_installation
with:
namespace: ${{ inputs.namespace }}
max_attempts: ${{ inputs.max_attempts }}
timeout: ${{ inputs.timeout }}
max_attempts_for_provisioner: ${{ inputs.max_attempts_for_provisioner }}
timeout_for_provisioner: ${{ inputs.timeout_for_provisioner }}
service_branch: ${{ inputs.service_branch }}
cr_kind: ${{ inputs.cr_kind }}
cr_name: ${{ inputs.cr_name }}
7 changes: 6 additions & 1 deletion actions/shared/create_cluster/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: 'Create Kubernetes cluster Action'
description: 'A GitHub Action that creates Kubernetes cluster using Kind'
inputs:
path_to_template:
description: 'A path to template of kind-cluster layout'
required: true
default: 'qubership-test-pipelines/kind-configs/kind-multi-node.yaml'
runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -39,6 +44,6 @@ runs:
run: >-
./kind create cluster
--image kindest/node:v1.32.2
--config qubership-test-pipelines/kind-configs/kind-multi-node.yaml
--config ${{ inputs.path_to_template }}
--wait 5m
#! check kubernetes version is actual
6 changes: 6 additions & 0 deletions actions/shared/helm_deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ inputs:
- 'upgrade' to upgrade an existing release
required: true
default: 'install'
install_crds:
description: 'Install CRDs before helm installation'
required: false
default: 'true'
type: boolean

restricted:
description: |
Expand Down Expand Up @@ -92,6 +97,7 @@ runs:
- name: Replace CRDs
shell: bash
# language=bash
if: inputs.install_crds == 'true'
run: |
# ▶️ Replace CRDs
cd "${{inputs.repository_name}}/${{inputs.path_to_chart}}"
Expand Down
30 changes: 30 additions & 0 deletions actions/shared/install_cert_manager/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Install cert-manager'
description: 'Installs cert-manager and creates cluster issuer'
inputs:
cert_manager_version:
description: 'Version of cert-manager to install'
required: true
default: 'v1.16.3'
cluster_issuer:
description: 'ClusterIssuer name to create'
required: true
default: 'dev-cluster-issuer'
runs:
using: 'composite'
steps:
- run: |
helm repo add jetstack https://charts.jetstack.io --force-update
helm upgrade -i cert-manager jetstack/cert-manager --namespace cert-manager \
--create-namespace --version ${{ inputs.cert_manager_version }} \
--set prometheus.enabled=true --set crds.enabled=true
shell: bash
- run: |
kubectl apply -f - <<EOF
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: ${{ inputs.cluster_issuer }}
spec:
selfSigned: {}
EOF
shell: bash
17 changes: 17 additions & 0 deletions kind-configs/kind-single-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80 # HTTP
hostPort: 80
protocol: TCP
- containerPort: 443 # HTTPS
hostPort: 443
protocol: TCP
27 changes: 27 additions & 0 deletions templates/logging-operator/logging_clean_graylog_fluentbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
skipMetricsService: false
containerRuntimeType: containerd
graylog:
install: true
indexShards: 1
indexReplicas: 0
mongoStorageClassName: standard
graylogStorageClassName: standard
host: http://graylog.demo.qubership.org
initContainerDockerImage: alpine:3.17.2
elasticsearchHost: http://admin:admin@opensearch.opensearch:9200
cloudEventsReader:
dockerImage: ghcr.io/netcracker/qubership-kube-events-reader:main
fluentbit:
install: true
configmapReload:
dockerImage: ghcr.io/jimmidyson/configmap-reload:v0.13.1
graylogHost: graylog-service
graylogPort: 12201
fluentd:
install: false
integrationTests:
install: true
tags: smokeORlog-generator
externalGraylogServer: "false"
graylogHost: graylog-service
graylogPort: 9000
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
dashboards:
enabled: false
opensearch:
master:
replicas: 1
enabled: true
persistence:
enabled: true
storageClass: "standard"
resources:
requests:
memory: "2Gi"
cpu: 100m
limits:
memory: "3Gi"
cpu: 1000m
securityConfig:
authc:
basic:
username: "admin"
password: "admin"
tls:
enabled: falsec
config:
cluster.routing.allocation.disk.threshold_enabled: false
monitoring:
enabled: false
dbaasAdapter:
enabled: false
curator:
enabled: false
username: "admin"
password: "admin"