blob: abb2439a3cc20335871780f3a78396336540cebe [file] [log] [blame]
gio3cdee592024-04-17 10:15:56 +04001import (
2 "encoding/base64"
3)
4
5input: {
6 sshPrivateKey: string
7}
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +04008
Giorgi Lekveishvili03d6f4b2024-03-08 13:05:21 +04009name: "ingress-public"
10namespace: "ingress-public"
11
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040012images: {
13 ingressNginx: {
14 registry: "registry.k8s.io"
15 repository: "ingress-nginx"
16 name: "controller"
17 tag: "v1.8.0"
18 pullPolicy: "IfNotPresent"
19 }
gio3cdee592024-04-17 10:15:56 +040020 portAllocator: {
21 repository: "giolekva"
22 name: "port-allocator"
23 tag: "latest"
24 pullPolicy: "Always"
25 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040026}
27
28charts: {
29 ingressNginx: {
giof8843412024-05-22 16:38:05 +040030 kind: "GitRepository"
gio9877f292024-08-17 15:11:15 +040031 address: "https://code.v1.dodo.cloud/helm-charts"
giof8843412024-05-22 16:38:05 +040032 branch: "main"
33 path: "charts/ingress-nginx"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040034 }
gio3cdee592024-04-17 10:15:56 +040035 portAllocator: {
giof8843412024-05-22 16:38:05 +040036 kind: "GitRepository"
gio9877f292024-08-17 15:11:15 +040037 address: "https://code.v1.dodo.cloud/helm-charts"
giof8843412024-05-22 16:38:05 +040038 branch: "main"
39 path: "charts/port-allocator"
gio3cdee592024-04-17 10:15:56 +040040 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040041}
42
43helm: {
44 "ingress-public": {
45 chart: charts.ingressNginx
46 values: {
gio7841f4f2024-07-26 19:53:49 +040047 fullnameOverride: "\(global.pcloudEnvName)-ingress-public"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040048 controller: {
giod28f83c2024-08-15 10:53:40 +040049 kind: "Deployment"
50 replicaCount: 1 // TODO(gio): configurable
51 topologySpreadConstraints: [{
52 labelSelector: {
53 matchLabels: {
54 "app.kubernetes.io/instance": "ingress-public"
55 }
56 }
57 maxSkew: 1
58 topologyKey: "kubernetes.io/hostname"
59 whenUnsatisfiable: "DoNotSchedule"
60 }]
61 hostNetwork: false
62 hostPort: enabled: false
63 updateStrategy: {
64 type: "RollingUpdate"
65 rollingUpdate: {
66 maxSurge: "100%"
67 maxUnavailable: "30%"
68 }
69 }
70 service: {
71 enabled: true
72 type: "NodePort"
73 nodePorts: {
74 http: 80
75 https: 443
76 tcp: {
77 "53": 53
78 }
79 udp: {
80 "53": 53
81 }
82 }
83 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040084 ingressClassByName: true
85 ingressClassResource: {
gio7841f4f2024-07-26 19:53:49 +040086 name: networks.public.ingressClass
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040087 enabled: true
88 default: false
gio7841f4f2024-07-26 19:53:49 +040089 controllerValue: "k8s.io/\(networks.public.ingressClass)"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040090 }
giodb274d12024-04-19 11:53:18 +040091 config: {
92 "proxy-body-size": "200M" // TODO(giolekva): configurable
93 "server-snippet": """
94 more_clear_headers "X-Frame-Options";
95 """
96 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040097 image: {
98 registry: images.ingressNginx.registry
99 image: images.ingressNginx.imageName
100 tag: images.ingressNginx.tag
101 pullPolicy: images.ingressNginx.pullPolicy
102 }
103 }
104 tcp: {
gioe72b54f2024-04-22 10:44:41 +0400105 "53": "\(global.pcloudEnvName)-dns-gateway/coredns:53"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +0400106 }
107 udp: {
gioe72b54f2024-04-22 10:44:41 +0400108 "53": "\(global.pcloudEnvName)-dns-gateway/coredns:53"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +0400109 }
110 }
111 }
gio3cdee592024-04-17 10:15:56 +0400112 "port-allocator": {
113 chart: charts.portAllocator
114 values: {
115 repoAddr: release.repoAddr
116 sshPrivateKey: base64.Encode(null, input.sshPrivateKey)
117 ingressNginxPath: "\(release.appDir)/ingress-public.yaml"
118 image: {
119 repository: images.portAllocator.fullName
120 tag: images.portAllocator.tag
121 pullPolicy: images.portAllocator.pullPolicy
122 }
123 }
124 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +0400125}