blob: 3cc7d1e769977134fba68baaf37219822a68a657 [file] [log] [blame]
gio3cdee592024-04-17 10:15:56 +04001import (
2 "encoding/base64"
3)
4
5input: {
gio9bd87ca2025-04-20 08:05:34 +04006 sshPrivateKey: string
giof55ab362025-04-11 17:48:17 +04007 controllerReplicaCount: int | *3
gio3cdee592024-04-17 10:15:56 +04008}
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +04009
gio9bd87ca2025-04-20 08:05:34 +040010name: "ingress-public"
Giorgi Lekveishvili03d6f4b2024-03-08 13:05:21 +040011namespace: "ingress-public"
12
gio7fbd4ad2024-08-27 10:06:39 +040013out: {
14 images: {
15 ingressNginx: {
gio9bd87ca2025-04-20 08:05:34 +040016 registry: "registry.k8s.io"
gio7fbd4ad2024-08-27 10:06:39 +040017 repository: "ingress-nginx"
gio9bd87ca2025-04-20 08:05:34 +040018 name: "controller"
19 tag: "v1.8.0"
gio7fbd4ad2024-08-27 10:06:39 +040020 pullPolicy: "IfNotPresent"
21 }
22 portAllocator: {
23 repository: "giolekva"
gio9bd87ca2025-04-20 08:05:34 +040024 name: "port-allocator"
25 tag: "latest"
gio7fbd4ad2024-08-27 10:06:39 +040026 pullPolicy: "Always"
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +040027 }
28 }
gio7fbd4ad2024-08-27 10:06:39 +040029
30 charts: {
31 ingressNginx: {
gio9bd87ca2025-04-20 08:05:34 +040032 kind: "GitRepository"
gio7fbd4ad2024-08-27 10:06:39 +040033 address: "https://code.v1.dodo.cloud/helm-charts"
gio9bd87ca2025-04-20 08:05:34 +040034 branch: "main"
35 path: "charts/ingress-nginx"
gio7fbd4ad2024-08-27 10:06:39 +040036 }
37 portAllocator: {
gio9bd87ca2025-04-20 08:05:34 +040038 kind: "GitRepository"
gio7fbd4ad2024-08-27 10:06:39 +040039 address: "https://code.v1.dodo.cloud/helm-charts"
gio9bd87ca2025-04-20 08:05:34 +040040 branch: "main"
41 path: "charts/port-allocator"
gio7fbd4ad2024-08-27 10:06:39 +040042 }
43 }
44
45 helm: {
46 "ingress-public": {
47 chart: charts.ingressNginx
48 values: {
49 fullnameOverride: "\(global.pcloudEnvName)-ingress-public"
50 controller: {
gio9bd87ca2025-04-20 08:05:34 +040051 kind: "Deployment"
giof55ab362025-04-11 17:48:17 +040052 replicaCount: input.controllerReplicaCount
gio7fbd4ad2024-08-27 10:06:39 +040053 topologySpreadConstraints: [{
54 labelSelector: {
55 matchLabels: {
56 "app.kubernetes.io/instance": "ingress-public"
57 }
58 }
gio9bd87ca2025-04-20 08:05:34 +040059 maxSkew: 1
60 topologyKey: "kubernetes.io/hostname"
gio7fbd4ad2024-08-27 10:06:39 +040061 whenUnsatisfiable: "DoNotSchedule"
62 }]
63 hostNetwork: false
64 hostPort: enabled: false
65 updateStrategy: {
66 type: "RollingUpdate"
67 rollingUpdate: {
gio9bd87ca2025-04-20 08:05:34 +040068 maxSurge: "50%"
gio7fbd4ad2024-08-27 10:06:39 +040069 maxUnavailable: "30%"
70 }
71 }
72 service: {
73 enabled: true
gio9bd87ca2025-04-20 08:05:34 +040074 type: "NodePort"
gio7fbd4ad2024-08-27 10:06:39 +040075 nodePorts: {
gio9bd87ca2025-04-20 08:05:34 +040076 http: 80
gio7fbd4ad2024-08-27 10:06:39 +040077 https: 443
78 tcp: {
79 "53": 53
80 }
81 udp: {
82 "53": 53
83 }
84 }
85 }
86 ingressClassByName: true
87 ingressClassResource: {
gio9bd87ca2025-04-20 08:05:34 +040088 name: networks.public.ingressClass
89 enabled: true
90 default: false
gio7fbd4ad2024-08-27 10:06:39 +040091 controllerValue: "k8s.io/\(networks.public.ingressClass)"
92 }
93 config: {
94 "proxy-body-size": "200M" // TODO(giolekva): configurable
95 "server-snippet": """
96 more_clear_headers "X-Frame-Options";
97 """
98 }
99 image: {
gio9bd87ca2025-04-20 08:05:34 +0400100 registry: images.ingressNginx.registry
101 image: images.ingressNginx.imageName
102 tag: images.ingressNginx.tag
gio7fbd4ad2024-08-27 10:06:39 +0400103 pullPolicy: images.ingressNginx.pullPolicy
104 }
105 }
106 tcp: {
107 "53": "\(global.pcloudEnvName)-dns-gateway/coredns:53"
108 }
109 udp: {
110 "53": "\(global.pcloudEnvName)-dns-gateway/coredns:53"
111 }
112 }
113 }
114 "port-allocator": {
115 chart: charts.portAllocator
116 values: {
gio9bd87ca2025-04-20 08:05:34 +0400117 repoAddr: release.repoAddr
118 sshPrivateKey: base64.Encode(null, input.sshPrivateKey)
gio7fbd4ad2024-08-27 10:06:39 +0400119 ingressNginxPath: "\(release.appDir)/ingress-public.yaml"
120 image: {
121 repository: images.portAllocator.fullName
gio9bd87ca2025-04-20 08:05:34 +0400122 tag: images.portAllocator.tag
gio7fbd4ad2024-08-27 10:06:39 +0400123 pullPolicy: images.portAllocator.pullPolicy
124 }
gio3cdee592024-04-17 10:15:56 +0400125 }
126 }
127 }
Giorgi Lekveishvilie009a5d2024-01-05 14:10:11 +0400128}