Skip to content

Commit

Permalink
feat: enable prometheus metrics to be Made for UDS (#111)
Browse files Browse the repository at this point in the history
## Description

This enables the service monitor for GLR to officially finish the Made
for UDS journey.
## Related Issue

Fixes #104

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] 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-runner/blob/main/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
Racer159 committed Jul 31, 2024
1 parent dafe6b2 commit 27001f1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 🏭 UDS Gitlab Runner Package

[<img alt="Made for UDS" src="https://raw.githubusercontent.com/defenseunicorns/uds-common/main/docs/made-for-uds.svg" height="20px"/>](https://github.com/defenseunicorns/uds-core)
[![Latest Release](https://img.shields.io/github/v/release/defenseunicorns/uds-package-gitlab-runner)](https://github.com/defenseunicorns/uds-package-gitlab-runner/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/defenseunicorns/uds-package-gitlab-runner/tag-and-release.yaml)](https://github.com/defenseunicorns/uds-package-gitlab-runner/actions/workflows/tag-and-release.yaml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/uds-package-gitlab-runner/badge)](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/uds-package-gitlab-runner)
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- selector:
app: gitlab-runner
targetPort: 9252
portName: metrics
portName: http-metrics
description: Metrics

network:
Expand All @@ -34,7 +34,7 @@ spec:
remoteNamespace: {{ .Values.sandboxNamespace }}
remoteSelector:
uds/network-access-gitlab: "true"

# Custom rules for unanticipated scenarios
{{- range .Values.custom }}
- direction: {{ .direction }}
Expand Down
9 changes: 9 additions & 0 deletions common/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ components:
- cmd: |
test -n "${ZARF_VAR_RUNNER_AUTH_TOKEN}" && echo "${ZARF_VAR_RUNNER_AUTH_TOKEN}" && exit 0 || true
./zarf tools kubectl wait pod --for=condition=Ready -n gitlab -l "app=webservice" > /dev/null
RUNNER_REGISTRATION_TOKEN=$(./zarf tools kubectl get secret -n gitlab gitlab-gitlab-runner-secret -o jsonpath={.data.runner-registration-token} | base64 -d)
WEBSERVICE_POD=$(./zarf tools kubectl get pod -n gitlab -l "app=webservice" -o json | ./zarf tools yq '[.items[] | select(.status.phase = "Running") | .metadata.name][0]')
Expand Down Expand Up @@ -55,3 +57,10 @@ components:
name: gitlab-runner-sandbox
namespace: ${ZARF_VAR_RUNNER_SANDBOX_NAMESPACE}
condition: "'{.status.phase}'=Ready"
- description: Gitlab Runner to be Healthy
wait:
cluster:
kind: Deployment
name: gitlab-runner
namespace: gitlab-runner
condition: Available
7 changes: 0 additions & 7 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ tasks:
kind: Secret
name: gitlab-gitlab-runner-secret
namespace: gitlab-runner
- description: Check Gitlab Runner Deployment
wait:
cluster:
kind: Deployment
name: gitlab-runner
namespace: gitlab-runner
condition: Available
- description: Check GitLab Runner Logs for Successful Registration
dir: test
cmd: npm test -- journey/registration.test.ts
Expand Down
2 changes: 1 addition & 1 deletion values/common-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ service:
enabled: true
metrics:
enabled: true

portName: http-metrics

resources:
limits:
Expand Down

0 comments on commit 27001f1

Please sign in to comment.