From 5ff550a9465720fd102ea5c2badcd5962fef5355 Mon Sep 17 00:00:00 2001 From: zamaz <71521611+zachariahmiller@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:24:55 -0400 Subject: [PATCH] fix: add working podmonitor for sidekiq (#169) ## Description - add working podmonitor for sidekiq ## Related Issue Fixes # https://github.com/defenseunicorns/uds-package-gitlab/issues/165 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-package-gitlab/blob/main/CONTRIBUTING.md#developer-workflow) followed --- chart/templates/sidekiq-pod-monitor.yaml | 20 ++++++++++++++++++++ chart/templates/uds-package.yaml | 9 +++++++++ tasks.yaml | 10 +++++----- tasks/publish.yaml | 8 ++++---- tests/auth.setup.ts | 2 +- values/common-values.yaml | 4 ++-- 6 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 chart/templates/sidekiq-pod-monitor.yaml diff --git a/chart/templates/sidekiq-pod-monitor.yaml b/chart/templates/sidekiq-pod-monitor.yaml new file mode 100644 index 00000000..82c39352 --- /dev/null +++ b/chart/templates/sidekiq-pod-monitor.yaml @@ -0,0 +1,20 @@ +{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: gitlab-sidekiq-metrics + namespace: {{ .Release.Namespace }} +spec: + scrapeClass: istio-certs + namespaceSelector: + matchNames: + - gitlab + podMetricsEndpoints: + - path: /metrics + port: http-metrics + scheme: https + enableHttp2: false + selector: + matchLabels: + app: sidekiq +{{- end }} diff --git a/chart/templates/uds-package.yaml b/chart/templates/uds-package.yaml index a88d46e7..c56b7f46 100644 --- a/chart/templates/uds-package.yaml +++ b/chart/templates/uds-package.yaml @@ -187,6 +187,15 @@ spec: port: 9235 description: "Pages Service Monitor" + - direction: Ingress + remoteNamespace: monitoring + remoteSelector: + app: prometheus + selector: + app: sidekiq + port: 3807 + description: "Sidekiq Pod Monitor" + - direction: Egress selector: app: registry diff --git a/tasks.yaml b/tasks.yaml index 5feb7cfa..56aa43bc 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -2,11 +2,11 @@ includes: - cleanup: ./tasks/cleanup.yaml - dependencies: ./tasks/dependencies.yaml - test: ./tasks/test.yaml - - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/create.yaml - - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/lint.yaml - - pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/pull.yaml - - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/deploy.yaml - - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/setup.yaml + - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/create.yaml + - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/lint.yaml + - pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/pull.yaml + - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/deploy.yaml + - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/setup.yaml tasks: - name: default diff --git a/tasks/publish.yaml b/tasks/publish.yaml index 364c43f6..bc229ef0 100644 --- a/tasks/publish.yaml +++ b/tasks/publish.yaml @@ -1,10 +1,10 @@ includes: - dependencies: ./dependencies.yaml - test: ./test.yaml - - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/create.yaml - - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/deploy.yaml - - publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/publish.yaml - - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.8.0/tasks/setup.yaml + - create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/create.yaml + - deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/deploy.yaml + - publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/publish.yaml + - setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/setup.yaml tasks: - name: build-package diff --git a/tests/auth.setup.ts b/tests/auth.setup.ts index 44b402c0..d8acb037 100644 --- a/tests/auth.setup.ts +++ b/tests/auth.setup.ts @@ -5,7 +5,7 @@ setup('authenticate', async ({ page, context }) => { await page.goto('/dashboard/projects'); await page.getByLabel('Username or email').fill('doug'); - await page.getByLabel('Password').fill('unicorn123!@#'); + await page.getByLabel('Password').fill('unicorn123!@#UN'); await page.getByRole('button', { name: "Log In" }).click(); await page.waitForURL('/dashboard/projects'); // successful redirect diff --git a/values/common-values.yaml b/values/common-values.yaml index 1688e95a..38d6e1f3 100644 --- a/values/common-values.yaml +++ b/values/common-values.yaml @@ -142,8 +142,8 @@ gitlab: sidekiq: metrics: enabled: true - serviceMonitor: - enabled: true + podMonitor: + enabled: false webservice: ingress: