Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add monitoring virtualservices for alertmanager / prometheus #977

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
12 changes: 6 additions & 6 deletions packages/standard/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ components:
import:
path: ../identity-authorization

# Authservice
- name: authservice
required: true
import:
path: ../identity-authorization

# Neuvector
- name: neuvector
required: true
Expand Down Expand Up @@ -91,12 +97,6 @@ components:
import:
path: ../monitoring

# Authservice
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this up the list in the standard bundle as it should be deployed after keycloak. and tests were failing as monitoring gets deployed before authservice if left alone.

- name: authservice
required: true
import:
path: ../identity-authorization

# Velero
- name: velero
required: true
Expand Down
51 changes: 51 additions & 0 deletions src/prometheus-stack/chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,43 @@ metadata:
name: prometheus-stack
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.sso.enabled }}
sso:
- name: uds-prometheus
clientId: uds-prometheus
redirectUris:
- "https://prom.admin.{{ .Values.domain }}/auth"
enableAuthserviceSelector:
app.kubernetes.io/name: prometheus
groups:
anyOf:
- /UDS Core/Admin
- /UDS Core/Auditor
- name: uds-alertmanager
clientId: uds-alertmanager
redirectUris:
- "https://alerts.admin.{{ .Values.domain }}/auth"
enableAuthserviceSelector:
app.kubernetes.io/name: alertmanager
groups:
anyOf:
- /UDS Core/Admin
- /UDS Core/Auditor
{{- end }}
network:
expose:
- service: alertmanager-operated
selector:
app.kubernetes.io/name: alertmanager
host: alerts
gateway: admin
port: 9093
- service: prometheus-operated
selector:
app: prometheus
host: prom
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open to other names here 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we have grafana and neuvector, might suggest we keep with that pattern and just use the full product name here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(alternatively we could try and lean more into functionality based naming like sso is, so alerts and metrics?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like alerts and metrics. It just provides a better UX. Switched to that

gateway: admin
port: 9090
allow:
# Permit intra-namespace communication
- direction: Ingress
Expand Down Expand Up @@ -65,3 +101,18 @@ spec:
port: 9090
description: "Grafana Metrics Queries"

# Custom rules for unanticipated scenarios
{{- range .Values.custom }}
- direction: {{ .direction }}
selector:
{{ .selector | toYaml | nindent 10 }}
{{- if not .remoteGenerated }}
remoteNamespace: {{ .remoteNamespace }}
remoteSelector:
{{ .remoteSelector | toYaml | nindent 10 }}
port: {{ .port }}
{{- else }}
remoteGenerated: {{ .remoteGenerated }}
{{- end }}
description: {{ .description }}
{{- end }}
13 changes: 13 additions & 0 deletions src/prometheus-stack/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

domain: "###ZARF_VAR_DOMAIN###"

sso:
enabled: true

custom: []
# - direction: Egress
# selector:
# app.kubernetes.io/name: alertmanager
# remoteGenerated: Anywhere
# description: "Egress from alertmanager to anywhere"
# port: 443
Loading