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

Add Ingress for Alertmanager and Grafana #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions apps/monitoring/templates/ingresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ if .Values.ingresses }}
{{ range .Values.ingresses }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ .name }}
annotations:
kubernetes.io/ingress.class: "nginx"
{{ if .ssl }}
cert-manager.io/cluster-issuer: letsencrypt
{{ end }}
{{ if .httpauth }}
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: {{ .httpauth.secretName | quote }}
nginx.ingress.kubernetes.io/auth-realm: {{ .httpauth.message | quote }}
{{ end }}
{{ if .permanentRedirect }}
nginx.ingress.kubernetes.io/permanent-redirect: {{ .permanentRedirect | quote }}
{{ end }}
spec:
rules:
{{ range .rules }}
- host: {{ .host }}
http:
paths:
- backend:
serviceName: {{ .serviceName }}
servicePort: {{ .servicePort }}
{{ end }}
{{ if .ssl }}
tls:
- hosts:
{{ range .rules }}
- {{ .host }}
{{ end }}
secretName: {{ .name }}-cert
{{ end }}
---
{{ end }}
{{ end }}
11 changes: 11 additions & 0 deletions apps/monitoring/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ if .Values.secrets }}
{{ range .Values.secrets }}
kind: Secret
apiVersion: v1
metadata:
name: {{ .name }}
type: Opaque
data: {{ toJson .data }}
---
{{ end }}
{{ end }}
21 changes: 21 additions & 0 deletions apps/monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ kube-prometheus-stack:
persistence:
enabled: true
storageClassName: nfs-client
admin:
existingSecret: "grafana-admin-password"

prometheusOperator:
resources:
Expand All @@ -43,3 +45,22 @@ kube-prometheus-stack:
memory: 600Mi
limits:
memory: 1200Mi

ingresses:
- name: alertmanager
ssl: true
rules:
- host: xxx
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 wasn’t sure which FQDNs to set

serviceName: http-web
servicePort: 3000
- name: grafana
ssl: true
rules:
- host: xxx
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 wasn’t sure which FQDNs to set

serviceName: http-web
servicePort: 9093

secrets:
- name: grafana-admin-password
data:
GRAFANA_ADMIN_PASSWORD: "~vault:Projects/monitoring/k8s-secrets:GRAFANA_ADMIN_PASSWORD~"