-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to get config remotely (#805)
Signed-off-by: Pete Wall <[email protected]>
- Loading branch information
Showing
77 changed files
with
1,675 additions
and
298 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
name: Platform Test | ||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- 'charts/**' | ||
- '!charts/k8s-monitoring-v1/**' | ||
pull_request: | ||
paths: | ||
- 'charts/**' | ||
- '!charts/k8s-monitoring-v1/**' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
list-tests: | ||
name: List tests | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tests: ${{ steps.list_tests.outputs.tests }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: List tests | ||
id: list_tests | ||
run: | | ||
if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{contains(github.event.pull_request.labels.*.name, 'run-platform-tests')}}" != "true" ]; then | ||
echo "Skipping platform tests" | ||
exit 0 | ||
fi | ||
tests=$(ls charts/k8s-monitoring/tests/platform) | ||
echo "Tests: ${tests}" | ||
echo "tests=$(echo "${tests}" | jq --raw-input --slurp --compact-output 'split("\n") | map(select(. != ""))')" >> "${GITHUB_OUTPUT}" | ||
run-tests: | ||
name: Platform Test | ||
needs: list-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test: ${{ fromJson(needs.list-tests.outputs.tests) }} | ||
fail-fast: false | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
|
||
- name: Check for cluster config | ||
id: check-cluster-config | ||
run: | | ||
if [ -f "charts/k8s-monitoring/tests/integration/${{ matrix.test }}/cluster.yaml" ]; then | ||
echo "has-cluster-config=true" >> "${GITHUB_OUTPUT}" | ||
else | ||
echo "has-cluster-config=false" >> "${GITHUB_OUTPUT}" | ||
fi | ||
- name: Create kind cluster | ||
if: ${{ steps.check-cluster-config.outputs.has-cluster-config == 'false' }} | ||
uses: helm/kind-action@v1 | ||
|
||
- name: Create kind cluster with special config | ||
if: ${{ steps.check-cluster-config.outputs.has-cluster-config == 'true' }} | ||
uses: helm/kind-action@v1 | ||
with: | ||
config: charts/k8s-monitoring/tests/integration/${{ matrix.test }}/cluster.yaml | ||
|
||
- name: Random number | ||
id: random-number | ||
uses: yakubique/[email protected] | ||
with: | ||
min: 100000 | ||
max: 999999 | ||
|
||
- name: Run test | ||
env: | ||
CREATE_CLUSTER: "false" | ||
DEPLOY_GRAFANA: "false" | ||
GRAFANA_CLOUD_FLEET_MGMT_USER: ${{ secrets.GRAFANA_CLOUD_FLEET_MGMT_USER }} | ||
GRAFANA_CLOUD_FLEET_MGMT_TOKEN: ${{ secrets.GRAFANA_CLOUD_FLEET_MGMT_TOKEN }} | ||
GRAFANA_CLOUD_METRICS_USERNAME: ${{ secrets.GRAFANA_CLOUD_METRICS_USERNAME }} | ||
GRAFANA_CLOUD_LOGS_USERNAME: ${{ secrets.GRAFANA_CLOUD_LOGS_USERNAME }} | ||
GRAFANA_CLOUD_RW_POLICY_TOKEN: ${{ secrets.GRAFANA_CLOUD_RW_POLICY_TOKEN }} | ||
RANDOM_NUMBER: ${{ steps.random-number.outputs.number }} | ||
|
||
run: ./scripts/run-integration-test.sh "charts/k8s-monitoring/tests/platform/${{ matrix.test }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
docs | ||
schema-mods | ||
Makefile | ||
README.md | ||
README.md.gotmpl |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces | ||
suite: Various methods for loading secrets | ||
templates: | ||
- secret.yaml | ||
- tests/test-pod.yaml | ||
tests: | ||
- it: creates its own secret when env is set | ||
set: | ||
tests: | ||
- env: | ||
PROMETHEUS_URL: http://prometheus.monitoring.svc.cluster.local:9090 | ||
PROMETHEUS_USER: prometheus | ||
PROMETHEUS_PASSWORD: prompassword | ||
queries: | ||
- query: kube_node_info | ||
type: promql | ||
asserts: | ||
- template: secret.yaml | ||
isKind: | ||
of: Secret | ||
- template: secret.yaml | ||
equal: | ||
path: stringData["PROMETHEUS_URL"] | ||
value: http://prometheus.monitoring.svc.cluster.local:9090 | ||
- template: tests/test-pod.yaml | ||
hasDocuments: | ||
count: 1 | ||
- template: tests/test-pod.yaml | ||
equal: | ||
path: spec.containers[0].envFrom[0].secretRef.name | ||
value: RELEASE-NAME-k8s-monitoring-test-0 | ||
- it: does not create a secret when only using envFrom | ||
set: | ||
tests: | ||
- envFrom: | ||
- secretRef: | ||
name: grafana-cloud-credentials | ||
queries: | ||
- query: kube_node_info | ||
type: promql | ||
asserts: | ||
- template: tests/test-pod.yaml | ||
hasDocuments: | ||
count: 1 | ||
- template: tests/test-pod.yaml | ||
equal: | ||
path: spec.containers[0].envFrom[0].secretRef.name | ||
value: grafana-cloud-credentials | ||
- it: uses both | ||
set: | ||
tests: | ||
- env: | ||
PROMETHEUS_URL: http://prometheus.monitoring.svc.cluster.local:9090 | ||
PROMETHEUS_USER: prometheus | ||
PROMETHEUS_PASSWORD: prompassword | ||
envFrom: | ||
- secretRef: | ||
name: grafana-cloud-credentials | ||
queries: | ||
- query: kube_node_info | ||
type: promql | ||
asserts: | ||
- template: secret.yaml | ||
isKind: | ||
of: Secret | ||
- template: secret.yaml | ||
equal: | ||
path: stringData["PROMETHEUS_URL"] | ||
value: http://prometheus.monitoring.svc.cluster.local:9090 | ||
- template: tests/test-pod.yaml | ||
hasDocuments: | ||
count: 1 | ||
- template: tests/test-pod.yaml | ||
equal: | ||
path: spec.containers[0].envFrom[0].secretRef.name | ||
value: RELEASE-NAME-k8s-monitoring-test-0 | ||
- template: tests/test-pod.yaml | ||
equal: | ||
path: spec.containers[0].envFrom[1].secretRef.name | ||
value: grafana-cloud-credentials |
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
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
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
Binary file modified
BIN
+1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz
Binary file not shown.
Oops, something went wrong.