| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 1 | import ( |
| 2 | "strings" |
| 3 | ) |
| 4 | |
| 5 | input: {} |
| 6 | |
| 7 | name: "env-dns" |
| 8 | namespace: "dns" |
| 9 | readme: "env-dns" |
| 10 | description: "Environment local DNS manager" |
| 11 | icon: "" |
| 12 | |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 13 | out: { |
| 14 | images: { |
| 15 | coredns: { |
| 16 | repository: "coredns" |
| 17 | name: "coredns" |
| 18 | tag: "1.11.1" |
| 19 | pullPolicy: "IfNotPresent" |
| 20 | } |
| 21 | api: { |
| 22 | repository: "giolekva" |
| 23 | name: "dns-api" |
| 24 | tag: "latest" |
| 25 | pullPolicy: "Always" |
| 26 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 27 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 28 | |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 29 | charts: { |
| 30 | coredns: { |
| 31 | kind: "GitRepository" |
| 32 | address: "https://code.v1.dodo.cloud/helm-charts" |
| 33 | branch: "main" |
| 34 | path: "charts/coredns" |
| 35 | } |
| 36 | api: { |
| 37 | kind: "GitRepository" |
| 38 | address: "https://code.v1.dodo.cloud/helm-charts" |
| 39 | branch: "main" |
| 40 | path: "charts/dns-api" |
| 41 | } |
| 42 | service: { |
| 43 | kind: "GitRepository" |
| 44 | address: "https://code.v1.dodo.cloud/helm-charts" |
| 45 | branch: "main" |
| 46 | path: "charts/service" |
| 47 | } |
| 48 | ipAddressPool: { |
| 49 | kind: "GitRepository" |
| 50 | address: "https://code.v1.dodo.cloud/helm-charts" |
| 51 | branch: "main" |
| 52 | path: "charts/metallb-ipaddresspool" |
| 53 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 54 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 55 | |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 56 | volumes: data: { |
| 57 | accessMode: "ReadWriteMany" |
| 58 | size: "5Gi" |
| 59 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 60 | |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 61 | helm: { |
| 62 | coredns: { |
| 63 | chart: charts.coredns |
| 64 | values: { |
| 65 | image: { |
| 66 | repository: images.coredns.fullName |
| 67 | tag: images.coredns.tag |
| 68 | pullPolicy: images.coredns.pullPolicy |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 69 | } |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 70 | replicaCount: 1 |
| 71 | resources: { |
| 72 | limits: { |
| 73 | cpu: "100m" |
| 74 | memory: "128Mi" |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 75 | } |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 76 | requests: { |
| 77 | cpu: "100m" |
| 78 | memory: "128Mi" |
| 79 | } |
| 80 | } |
| 81 | rollingUpdate: { |
| 82 | maxUnavailable: 1 |
| 83 | maxSurge: "25%" |
| 84 | } |
| 85 | terminationGracePeriodSeconds: 30 |
| 86 | serviceType: "LoadBalancer" |
| 87 | service: { |
| 88 | name: "coredns" |
| 89 | annotations: { |
| 90 | "metallb.universe.tf/loadBalancerIPs": global.network.dns |
| 91 | } |
| 92 | } |
| 93 | serviceAccount: create: false |
| 94 | rbac: { |
| 95 | create: false |
| 96 | pspEnable: false |
| 97 | } |
| 98 | isClusterService: false |
| 99 | servers: [{ |
| 100 | zones: [{ |
| 101 | zone: "." |
| 102 | }] |
| 103 | port: 53 |
| 104 | plugins: [ |
| 105 | { |
| 106 | name: "log" |
| 107 | }, |
| 108 | { |
| 109 | name: "health" |
| 110 | configBlock: "lameduck 5s" |
| 111 | }, |
| 112 | { |
| 113 | name: "ready" |
| 114 | } |
| 115 | ] |
| 116 | }] |
| 117 | extraConfig: import: parameters: "\(_mountPath)/coredns.conf" |
| 118 | extraVolumes: [{ |
| 119 | name: volumes.data.name |
| 120 | persistentVolumeClaim: claimName: volumes.data.name |
| 121 | }] |
| 122 | extraVolumeMounts: [{ |
| 123 | name: volumes.data.name |
| 124 | mountPath: _mountPath |
| 125 | }] |
| 126 | livenessProbe: { |
| 127 | enabled: true |
| 128 | initialDelaySeconds: 60 |
| 129 | periodSeconds: 10 |
| 130 | timeoutSeconds: 5 |
| 131 | failureThreshold: 5 |
| 132 | successThreshold: 1 |
| 133 | } |
| 134 | readinessProbe: { |
| 135 | enabled: true |
| 136 | initialDelaySeconds: 30 |
| 137 | periodSeconds: 10 |
| 138 | timeoutSeconds: 5 |
| 139 | failureThreshold: 5 |
| 140 | successThreshold: 1 |
| 141 | } |
| 142 | zoneFiles: [] |
| 143 | hpa: enabled: false |
| 144 | autoscaler: enabled: false |
| 145 | deployment: enabled: true |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 146 | } |
| 147 | } |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 148 | api: { |
| 149 | chart: charts.api |
| 150 | values: { |
| 151 | image: { |
| 152 | repository: images.api.fullName |
| 153 | tag: images.api.tag |
| 154 | pullPolicy: images.api.pullPolicy |
| 155 | } |
| 156 | config: "coredns.conf" |
| 157 | db: "records.db" |
| 158 | zone: networks.public.domain |
| 159 | publicIP: strings.Join(global.publicIP, ",") |
| 160 | privateIP: global.network.ingress |
| 161 | nameserverIP: strings.Join(global.nameserverIP, ",") |
| 162 | service: type: "ClusterIP" |
| 163 | volume: { |
| 164 | claimName: volumes.data.name |
| 165 | mountPath: _mountPath |
| 166 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 167 | } |
| 168 | } |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 169 | "coredns-svc-cluster": { |
| 170 | chart: charts.service |
| 171 | values: { |
| 172 | name: "dns" |
| 173 | type: "LoadBalancer" |
| 174 | protocol: "TCP" |
| 175 | ports: [{ |
| 176 | name: "udp-53" |
| 177 | port: 53 |
| 178 | protocol: "UDP" |
| 179 | targetPort: 53 |
| 180 | }] |
| 181 | targetPort: "http" |
| 182 | selector:{ |
| 183 | "app.kubernetes.io/instance": "coredns" |
| 184 | "app.kubernetes.io/name": "coredns" |
| 185 | } |
| 186 | annotations: { |
| 187 | "metallb.universe.tf/loadBalancerIPs": global.network.dnsInClusterIP |
| 188 | } |
| 189 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 190 | } |
| gio | 7fbd4ad | 2024-08-27 10:06:39 +0400 | [diff] [blame] | 191 | "ipaddresspool-dns": { |
| 192 | chart: charts.ipAddressPool |
| 193 | values: { |
| 194 | name: "\(global.id)-dns" |
| 195 | autoAssign: false |
| 196 | from: global.network.dns |
| 197 | to: global.network.dns |
| 198 | namespace: "metallb-system" |
| 199 | } |
| 200 | } |
| 201 | "ipaddresspool-dns-in-cluster": { |
| 202 | chart: charts.ipAddressPool |
| 203 | values: { |
| 204 | name: "\(global.id)-dns-in-cluster" |
| 205 | autoAssign: false |
| 206 | from: global.network.dnsInClusterIP |
| 207 | to: global.network.dnsInClusterIP |
| 208 | namespace: "metallb-system" |
| 209 | } |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | _mountPath: "/pcloud" |