-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging in the AOI chart to keep chart infrastructure in one place --------- Co-authored-by: Thor Anker Kvisgård Lange <[email protected]>
- Loading branch information
Showing
42 changed files
with
2,173 additions
and
10 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
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,2 @@ | ||
# Ignore dependencies downloaded by helm | ||
charts/ |
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,2 @@ | ||
.gitignore | ||
CHANGELOG.md |
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 @@ | ||
# WiP |
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,15 @@ | ||
dependencies: | ||
- name: grafana | ||
repository: https://grafana.github.io/helm-charts | ||
version: 7.3.7 | ||
- name: victoria-metrics-single | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
version: 0.9.17 | ||
- name: victoria-metrics-single | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
version: 0.9.17 | ||
- name: victoria-metrics-alert | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
version: 0.9.4 | ||
digest: sha256:63740c51ac34e8d7d64616b5e8e47f3b6cfc14383a445f8ac51ff8e7b9fbb71f | ||
generated: "2024-09-04T09:41:39.608788+02:00" |
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,32 @@ | ||
apiVersion: v2 | ||
name: aoi | ||
description: A Helm chart for Netic application operations infrastructure | ||
type: application | ||
version: 0.1.20 | ||
home: https://github.com/neticdk/k8s-oaas-observability | ||
sources: | ||
- https://github.com/neticdk/k8s-oaas-observability | ||
maintainers: | ||
- name: alex5517 | ||
email: [email protected] | ||
- name: mathiasfm | ||
email: [email protected] | ||
dependencies: | ||
- name: grafana | ||
version: 7.3.7 | ||
repository: https://grafana.github.io/helm-charts | ||
condition: grafana.enabled | ||
- name: victoria-metrics-single | ||
alias: victoria-metrics-single-1 | ||
version: 0.9.17 | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
condition: global.tsdb.enabled | ||
- name: victoria-metrics-single | ||
alias: victoria-metrics-single-2 | ||
version: 0.9.17 | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
condition: global.tsdb.high_availability.enabled | ||
- name: victoria-metrics-alert | ||
version: 0.9.4 | ||
repository: https://victoriametrics.github.io/helm-charts/ | ||
condition: alerting.enabled |
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 @@ | ||
global: | ||
priorityClassName: "secure-cloud-stack-tenant-namespace-application-critical" | ||
|
||
victoria-metrics-single-1: | ||
server: | ||
priorityClassName: "secure-cloud-stack-tenant-namespace-application-critical" |
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,114 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "aoi.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "aoi.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "aoi.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "aoi.labels" -}} | ||
helm.sh/chart: {{ include "aoi.chart" . }} | ||
{{ include "aoi.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "aoi.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "aoi.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "aoi.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "aoi.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the hostname for the read path to tsdb. | ||
*/}} | ||
{{- define "aoi.readHost" -}} | ||
{{- if .Values.global.tsdb.high_availability.enabled }} | ||
{{- printf "promxy" }} | ||
{{- else }} | ||
{{- printf "victoria-metrics-single-1-server" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the port for the read path to tsdb. | ||
*/}} | ||
{{- define "aoi.readPort" -}} | ||
{{- if .Values.global.tsdb.high_availability.enabled }} | ||
{{- printf "8082" }} | ||
{{- else }} | ||
{{- printf "8428" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
metrics read url | ||
*/}} | ||
{{- define "aoi.readUrl" -}} | ||
{{- printf "http://%s-%s.%s.svc.%s:%s" (include "aoi.name" . ) (include "aoi.readHost" . ) .Release.Namespace .Values.global.clusterDomain (include "aoi.readPort" . ) }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
metrics read url for grafana | ||
*/}} | ||
{{- define "aoi.grafanaReadUrl" -}} | ||
{{- if .Values.authProxy.enabled }} | ||
{{- printf "http://%s-auth-proxy.%s.svc.%s:8080" (include "aoi.name" . ) .Release.Namespace .Values.global.clusterDomain }} | ||
{{- else }} | ||
{{- printf "http://%s-%s.%s.svc.%s:%s" (include "aoi.name" . ) (include "aoi.readHost" . ) .Release.Namespace .Values.global.clusterDomain (include "aoi.readPort" . ) }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the lable value for victoria-metrics kubernetes/name lable. | ||
*/}} | ||
{{- define "aoi.vmLableName" -}} | ||
{{- if .Values.global.tsdb.high_availability.enabled }} | ||
{{- printf "promxy" }} | ||
{{- else }} | ||
{{- printf "victoria-metrics-single-1" }} | ||
{{- end }} | ||
{{- end }} |
125 changes: 125 additions & 0 deletions
125
charts/aoi/templates/application-operations-alerting/HelmRelease.yaml
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,125 @@ | ||
{{- if .Values.alerting.enabled }} | ||
{{- range $i, $namespace := (include "aoi.alerting.namespaces" . | fromJsonArray) }} | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta1 | ||
kind: HelmRelease | ||
metadata: | ||
name: victoria-metrics-alert | ||
namespace: {{ $namespace }} | ||
spec: | ||
chart: | ||
spec: | ||
chart: victoria-metrics-alert | ||
version: {{ include "aoi.alerting.chartVersion" $ }} | ||
sourceRef: | ||
kind: HelmRepository | ||
name: victoria-metrics | ||
interval: 5m | ||
interval: 5m | ||
timeout: 15m | ||
values: | ||
serviceAccount: | ||
create: false | ||
name: victoria-metrics-alert-config-reloader | ||
rbac: | ||
create: false | ||
server: | ||
{{- include "aoi.serverPriorityClassName" $ | nindent 6 }} | ||
image: | ||
repository: "{{ $.Values.alerting.helmRelease.values.server.image.registry }}/{{ $.Values.alerting.helmRelease.values.server.image.repository }}" | ||
pullPolicy: {{ $.Values.alerting.helmRelease.values.server.image.pullPolicy }} | ||
podLabels: | ||
netic.dk/allow-prometheus-scraping: "true" | ||
resources: | ||
{{- toYaml $.Values.alerting.helmRelease.values.server.resources | nindent 8 }} | ||
extraArgs: | ||
rule: '/tmp/rules/*.yaml' | ||
extraVolumes: | ||
- name: alert-rules | ||
emptyDir: {} | ||
extraVolumeMounts: | ||
- name: alert-rules | ||
mountPath: /tmp/rules | ||
datasource: | ||
{{- if eq $namespace $.Values.alerting.clusterWideNamespace.name }} | ||
url: "{{ include "aoi.readUrl" $ }}" | ||
{{- else }} | ||
url: "{{ include "aoi.readUrl" $ }}?extra_label=namespace_id={{ $.Values.alerting.clusterId }}_{{ $namespace }}" | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.server.securityContext | nindent 8 }} | ||
extraContainers: | ||
- name: config-reloader | ||
image: "{{ $.Values.alerting.helmRelease.values.server.configReloader.image.registry }}/{{ $.Values.alerting.helmRelease.values.server.configReloader.image.repository }}:{{ $.Values.alerting.helmRelease.values.server.configReloader.image.tag }}" | ||
imagePullPolicy: {{ $.Values.alerting.helmRelease.values.server.configReloader.image.pullPolicy }} | ||
resources: | ||
{{- toYaml $.Values.alerting.helmRelease.values.server.configReloader.resources | nindent 12 }} | ||
securityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.server.configReloader.securityContext | nindent 12 }} | ||
env: | ||
- name: IGNORE_ALREADY_PROCESSED | ||
value: "true" | ||
- name: METHOD | ||
value: WATCH | ||
- name: LABEL | ||
value: application-operations-alerting | ||
- name: FOLDER | ||
value: /tmp/rules | ||
- name: RESOURCE | ||
value: configmap | ||
- name: REQ_URL | ||
value: http://localhost:8880/-/reload | ||
- name: REQ_METHOD | ||
value: GET | ||
volumeMounts: | ||
- name: alert-rules | ||
mountPath: /tmp/rules | ||
podSecurityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.server.podSecurityContext | nindent 8 }} | ||
alertmanager: | ||
enabled: true | ||
{{- include "aoi.alertmanagerPriorityClassName" $ | nindent 6 }} | ||
image: "{{ $.Values.alerting.helmRelease.values.alertmanager.image.registry }}/{{ $.Values.alerting.helmRelease.values.alertmanager.image.repository }}" | ||
tag: "{{ $.Values.alerting.helmRelease.values.alertmanager.image.tag }}" | ||
resources: | ||
{{- toYaml $.Values.alerting.helmRelease.values.alertmanager.resources | nindent 8 }} | ||
configMap: "alertmanager-config" | ||
securityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.alertmanager.securityContext | nindent 8 }} | ||
podSecurityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.alertmanager.podSecurityContext | nindent 8 }} | ||
extraContainers: | ||
- name: config-reloader | ||
image: "{{ $.Values.alerting.helmRelease.values.alertmanager.configReloader.image.registry }}/{{ $.Values.alerting.helmRelease.values.alertmanager.configReloader.image.repository }}:{{ $.Values.alerting.helmRelease.values.alertmanager.configReloader.image.tag }}" | ||
imagePullPolicy: {{ $.Values.alerting.helmRelease.values.alertmanager.configReloader.image.pullPolicy }} | ||
resources: | ||
{{- toYaml $.Values.alerting.helmRelease.values.alertmanager.configReloader.resources | nindent 12 }} | ||
securityContext: | ||
{{- toYaml $.Values.alerting.helmRelease.values.alertmanager.configReloader.securityContext | nindent 12 }} | ||
env: | ||
- name: WATCH_PATHS | ||
value: /tmp/config | ||
- name: REQ_URL | ||
value: http://localhost:9093/-/reload | ||
- name: REQ_METHOD | ||
value: POST | ||
volumeMounts: | ||
- name: config | ||
mountPath: /tmp/config | ||
{{- if $.Values.alerting.helmRelease.values.alertmanager.emailPasswordMount }} | ||
extraVolumeMounts: | ||
- name: email-password | ||
readOnly: true | ||
mountPath: /etc/email-password | ||
extraVolumes: | ||
- name: email-password | ||
secret: | ||
optional: true | ||
secretName: aoi-alertmanager-email-password | ||
{{- end }} | ||
serviceMonitor: | ||
enabled: true | ||
extraLabels: | ||
netic.dk/monitoring: "true" | ||
{{- end }} | ||
{{- end }} |
14 changes: 14 additions & 0 deletions
14
charts/aoi/templates/application-operations-alerting/HelmRepository.yaml
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,14 @@ | ||
{{- if .Values.alerting.enabled }} | ||
{{- range $i, $namespace := (include "aoi.alerting.namespaces" . | fromJsonArray) }} | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: HelmRepository | ||
metadata: | ||
name: victoria-metrics | ||
namespace: {{ $namespace }} | ||
spec: | ||
interval: 30m0s | ||
url: {{ include "aoi.alerting.helmRepository" $ }} | ||
type: {{ include "aoi.alerting.helmRepository.type" $ }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.