UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • big-bang/product/packages/loki
1 result
Show changes
Commits on Source (2)
......@@ -2,6 +2,11 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.0.4-bb.1]
### Added
- Added cypress and script testing to the chart
- Added `bbtests` values to the `values.yaml`
## [3.0.4-bb.0]
### Changed
- Updated `chart/` base to upstream chart version `loki-2.11.1`
......
# loki
![Version: 3.0.4-bb.0](https://img.shields.io/badge/Version-3.0.4--bb.0-informational?style=flat-square) ![AppVersion: v2.5.0](https://img.shields.io/badge/AppVersion-v2.5.0-informational?style=flat-square)
![Version: 3.0.4-bb.1](https://img.shields.io/badge/Version-3.0.4--bb.1-informational?style=flat-square) ![AppVersion: v2.5.0](https://img.shields.io/badge/AppVersion-v2.5.0-informational?style=flat-square)
BigBang amalgamation of Grafana upstream charts to provide several ways of deploying Loki; like Prometheus, but for logs.
......@@ -183,6 +183,12 @@ helm install loki chart/
| gel.compactor.nodeSelector | object | `{}` | Node selector for compactor Pods |
| gel.compactor.tolerations | list | `[]` | Tolerations for compactor Pods |
| gel.compactor.terminationGracePeriodSeconds | int | `300` | Grace period to allow the compactor to shutdown before it is killed |
| bbtests.enabled | bool | `false` | |
| bbtests.cypress.artifacts | bool | `true` | |
| bbtests.cypress.envs.cypress_check_datasource | string | `"false"` | |
| bbtests.cypress.envs.cypress_grafana_url | string | `"http://monitoring-grafana.monitoring.svc.cluster.local"` | |
| bbtests.scripts.image | string | `"registry1.dso.mil/ironbank/big-bang/base:1.17.0"` | |
| bbtests.scripts.envs.LOKI_URL | string | `"http://{{ template \"tempo.fullname\" . }}.{{ .Release.Namespace }}.svc:3100"` | |
## Contributing
......
apiVersion: v2
name: loki
version: 3.0.4-bb.0
version: 3.0.4-bb.1
appVersion: v2.5.0
kubeVersion: "^1.10.0-0"
description: "BigBang amalgamation of Grafana upstream charts to provide several ways of deploying Loki; like Prometheus, but for logs."
......
{{- if eq .Values.bbtests.cypress.envs.cypress_check_datasource "true" }}
{{- include "gluon.tests.cypress-configmap.base" .}}
---
{{- include "gluon.tests.cypress-runner.base" .}}
{{- end }}
\ No newline at end of file
{{- include "gluon.tests.script-configmap.overrides" (list . "loki-test.script-configmap") }}
{{- define "loki-test.script-configmap" }}
{{- end }}
---
{{- include "gluon.tests.script-runner.overrides" (list . "loki-test.script-runner") -}}
{{- define "loki-test.script-runner" -}}
{{- end }}
{
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false
}
beforeEach(function () {
cy.getCookies().then(cookies => {
const namesOfCookies = cookies.map(cm => cm.name)
Cypress.Cookies.preserveOnce(...namesOfCookies)
})
})
describe('Loki Test', function() {
Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
if (Cypress.env("check_datasource")) {
it('Check Loki is available as a data source in grafana and connected', function() {
cy.visit(Cypress.env('grafana_url'))
cy.get('input[name="user"]')
.type('admin')
cy.get('input[name="password"]')
.type('prom-operator')
cy.contains("Log in").click()
cy.get('.page-toolbar').contains('General', {timeout: 30000})
// Visit the datasources page
cy.visit(`${Cypress.env('grafana_url')}/datasources`)
// // // Enter 'loki' in the search field and
cy.get('.css-yn255a-input-input')
.type('loki')
// Click on the loki datasource
cy.get('.css-1cqw476').contains('Loki')
cy.get('.css-1cqw476').click()
// Click on the 'Save & test` button
cy.get('.css-1sara2j-button > .css-1mhnkuh').click()
// Check to ensure the data source is working
cy.get('.p-t-2').contains('Data source connected and labels found', {timeout: 10000})
})
after(function () {
cy.clearCookies()
})
}
})
\ No newline at end of file
#!/bin/bash
set -e
loki_timeout=$((6*60))
echo "Hitting loki /ready endpoint..."
time curl --retry-delay 2 --retry-max-time ${loki_timeout} --retry $((loki_timeout/2)) --retry-connrefused -sIS "${LOKI_URL}/ready" 1>/dev/null || loki_ec=$?
# time output shows up a bit after the next two echoes, sleep for formatting
sleep .1
if [ -n "${loki_ec}" ]; then
echo "curl returned exit code ${loki_ec}, see above for error message and curl's elapsed wait time (timeout is ${loki_timeout}s)"
exit 1
fi
echo "Test 1 Success: loki is up, see above for curl's elapsed wait time."
echo "Hitting loki /metrics endpoint..."
time curl --retry-delay 2 --retry-max-time ${loki_timeout} --retry $((loki_timeout/2)) --retry-connrefused -sIS "${LOKI_URL}/metrics" 1>/dev/null || loki_ec=$?
# time output shows up a bit after the next two echoes, sleep for formatting
sleep .1
if [ -n "${loki_ec}" ]; then
echo "curl returned exit code ${loki_ec}, see above for error message and curl's elapsed wait time (timeout is ${loki_timeout}s)"
exit 1
fi
echo "Test 2 Success: loki metrics endpoint returned "
## This test might be good for extending to check appVersion etc
echo "Hitting loki /loki/api/v1/status/buildinfo endpoint..."
time curl --retry-delay 2 --retry-max-time ${loki_timeout} --retry $((loki_timeout/2)) --retry-connrefused -sIS "${LOKI_URL}/loki/api/v1/status/buildinfo" 1>/dev/null || loki_ec=$?
# time output shows up a bit after the next two echoes, sleep for formatting
sleep .1
if [ -n "${loki_ec}" ]; then
echo "curl returned exit code ${loki_ec}, see above for error message and curl's elapsed wait time (timeout is ${loki_timeout}s)"
exit 1
fi
echo "Test 3 Success: loki buildinfo endpoint returned "
echo "Checking for loki version"
loki_response=$(curl "${LOKI_URL}/loki/api/v1/status/buildinfo" 2>/dev/null)
current_version=$(echo ${loki_response} | jq -r '.version')
if [ ! "${LOKI_VERSION}" == "${current_version}" ]; then
echo "Test 4 Failure: Loki version does not match."
echo "Debug information (deployed build info):"
echo "${loki_response}"
echo "/${LOKI_VERSION}/${current_version}/"
exit 1
fi
echo "Test 4 Success: Loki version matches expected version"
\ No newline at end of file
......@@ -592,3 +592,16 @@ gel:
tolerations: []
# -- Grace period to allow the compactor to shutdown before it is killed
terminationGracePeriodSeconds: 300
bbtests:
enabled: false
cypress:
artifacts: true
envs:
cypress_check_datasource: 'false'
cypress_grafana_url: 'http://monitoring-grafana.monitoring.svc.cluster.local'
scripts:
image: registry1.dso.mil/ironbank/big-bang/base:1.17.0
envs:
LOKI_URL: 'http://{{ template "loki.fullname" . }}.{{ .Release.Namespace }}.svc:3100'
LOKI_VERSION: '{{ .Values.loki.image.tag }}'
......@@ -8,3 +8,6 @@ loki-simple-scalable:
gel:
enabled: false
bbtests:
enabled: true
\ No newline at end of file