Move charts to chart directory

This commit is contained in:
Raffael H
2023-08-09 14:50:44 +02:00
parent 626e854c0f
commit ad84cc053b
21 changed files with 1 additions and 3 deletions

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "user-monitoring.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 "user-monitoring.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 "user-monitoring.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "user-monitoring.labels" -}}
helm.sh/chart: {{ include "user-monitoring.chart" . }}
{{ include "user-monitoring.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "user-monitoring.selectorLabels" -}}
app.kubernetes.io/name: {{ include "user-monitoring.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "user-monitoring.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "user-monitoring.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,7 @@
apiVersion: v1
data:
admin: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
{{ .Values.user }}: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
kind: Secret
metadata:
name: basic-auth

View File

@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
haproxy.org/auth-secret: basic-auth
haproxy.org/auth-type: basic-auth
haproxy.org/auth-realm: Authentication Required
name: {{ .Values.user }}-prometheus
spec:
ingressClassName: haproxy
rules:
- host: {{ .Values.user }}-prometheus.training.cluster.acend.ch
http:
paths:
- backend:
service:
name: prometheus-operated
port:
number: 9090
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- {{ .Values.user }}-prometheus.training.cluster.acend.ch
secretName: acend-wildcard

View File

@@ -0,0 +1,20 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus-{{ .Values.user }}
rules:
- apiGroups: [""]
resources:
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["get"]
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs: ["get", "list", "watch"]

View File

@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-{{ .Values.user }}
subjects:
- kind: ServiceAccount
name: prometheus-{{ .Values.user }}

View File

@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus-{{ .Values.user }}

View File

@@ -0,0 +1,22 @@
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
spec:
serviceAccountName: prometheus-{{ .Values.user }}
serviceMonitorNamespaceSelector:
matchLabels:
user: {{ .Values.user }}
serviceMonitorSelector:
matchLabels:
user: {{ .Values.user }}
resources:
requests:
memory: 400Mi
enableAdminAPI: false
storage:
volumeClaimTemplate:
spec:
resources:
requests:
storage: 2Gi