Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps committed Oct 16, 2024
1 parent f8df224 commit 8bf00af
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
64 changes: 32 additions & 32 deletions packages/extra/ingress/templates/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}

{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $host := index $myNS.metadata.annotations "namespace.cozystack.io/host" }}
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $host := index $myNS.metadata.annotations "namespace.cozystack.io/host" }}

{{- if .Values.dashboard }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
{{- if .Values.dashboard }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
{{- if eq $issuerType "cloudflare" }}
{{- else }}
acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}
{{- end }}
name: dashboard-{{ .Release.Namespace }}
namespace: cozy-dashboard
spec:
ingressClassName: {{ .Release.Namespace }}
rules:
- host: dashboard.{{ $host }}
http:
paths:
- backend:
service:
name: dashboard
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- dashboard.{{ $host }}
secretName: dashboard-{{ .Release.Namespace }}-tls
{{- else }}
acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}
{{- end }}
name: dashboard-{{ .Release.Namespace }}
namespace: cozy-dashboard
spec:
ingressClassName: {{ .Release.Namespace }}
rules:
- host: dashboard.{{ $host }}
http:
paths:
- backend:
service:
name: dashboard
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- dashboard.{{ $host }}
secretName: dashboard-{{ .Release.Namespace }}-tls
{{- end }}
4 changes: 2 additions & 2 deletions packages/extra/monitoring/templates/alerta/alerta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}

{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
Expand Down Expand Up @@ -36,7 +36,7 @@ data:
'endpoint' : "/api",
'provider' : "basic"
})
.constant('colors', {});
.constant('colors', {});
---
apiVersion: v1
kind: Service
Expand Down
4 changes: 2 additions & 2 deletions packages/extra/monitoring/templates/grafana/grafana.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}

{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
metadata:
annotations:
{{- if ne $issuerType "cloudflare" }}
acme.cert-manager.io/http01-ingress-class: "{{ $ingress }}"
acme.cert-manager.io/http01-ingress-class: "{{ $ingress }}"
{{- end }}
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
Expand Down

0 comments on commit 8bf00af

Please sign in to comment.