Skip to content

Commit f8df224

Browse files
committed
Move configuration to ingress
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent cde1bca commit f8df224

8 files changed

Lines changed: 50 additions & 28 deletions

File tree

‎packages/extra/ingress/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: ingress
33
description: NGINX Ingress Controller
44
icon: /logos/ingress-nginx.svg
55
type: application
6-
version: 1.2.0
6+
version: 1.3.0

‎packages/extra/ingress/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
| `whitelist` | List of client networks | `[]` |
1212
| `clouflareProxy` | Restoring original visitor IPs when Cloudflare proxied is enabled | `false` |
1313
| `dashboard` | Should ingress serve Cozystack service dashboard | `false` |
14+
| `cdiUploadProxy` | Should ingress serve CDI upload proxy | `false` |
1415

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}
2+
{{- $issuerType := (index $cozyConfig.data "clusterissuer") | default "http01" }}
3+
4+
{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
5+
{{- $host := index $myNS.metadata.annotations "namespace.cozystack.io/host" }}
6+
7+
{{- if .Values.cdiUploadProxy }}
8+
apiVersion: networking.k8s.io/v1
9+
kind: Ingress
10+
metadata:
11+
annotations:
12+
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
13+
cert-manager.io/cluster-issuer: letsencrypt-prod
14+
{{- if eq $issuerType "cloudflare" }}
15+
{{- else }}
16+
acme.cert-manager.io/http01-ingress-class: {{ .Release.Namespace }}
17+
{{- end }}
18+
name: cdi-uploadproxy-{{ .Release.Namespace }}
19+
namespace: cozy-kubevirt-cdi
20+
spec:
21+
ingressClassName: {{ .Release.Namespace }}
22+
rules:
23+
- host: cdi-uploadproxy.{{ $host }}
24+
http:
25+
paths:
26+
- backend:
27+
service:
28+
name: cdi-uploadproxy
29+
port:
30+
number: 443
31+
path: /
32+
pathType: Prefix
33+
tls:
34+
- hosts:
35+
- cdi-uploadproxy.{{ $host }}
36+
secretName: cdi-uploadproxy-{{ .Release.Namespace }}-tls
37+
{{- end }}

‎packages/extra/ingress/values.schema.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"type": "boolean",
3131
"description": "Should ingress serve Cozystack service dashboard",
3232
"default": false
33+
},
34+
"cdiUploadProxy": {
35+
"type": "boolean",
36+
"description": "Should ingress serve CDI upload proxy",
37+
"default": false
3338
}
3439
}
3540
}

‎packages/extra/ingress/values.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ clouflareProxy: false
2727

2828
## @param dashboard Should ingress serve Cozystack service dashboard
2929
dashboard: false
30+
31+
## @param cdiUploadProxy Should ingress serve CDI upload proxy
32+
cdiUploadProxy: false

‎packages/system/kubevirt-cdi/templates/cdi-cr.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ metadata:
44
name: cdi
55
spec:
66
config:
7-
{{- with .Values.uploadProxyHost }}
8-
uploadProxyURLOverride: "https://{{ . }}"
7+
{{- with .Values.uploadProxyURL }}
8+
uploadProxyURLOverride: {{ quote . }}
99
{{- end }}
1010
featureGates:
1111
- HonorWaitForFirstConsumer

‎packages/system/kubevirt-cdi/templates/ingress.yaml‎

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
uploadProxyHost: "cdi.infra.aenix.org"
2-
ingressClass: "tenant-root"
1+
uploadProxyURL: ""

0 commit comments

Comments
 (0)