| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 1 | input: { |
| 2 | servers: [...#Server] |
| 3 | } |
| 4 | |
| 5 | #Server: { |
| 6 | zone: string |
| 7 | address: string |
| 8 | } |
| 9 | |
| 10 | name: "dns-gateway" |
| 11 | namespace: "dns-gateway" |
| 12 | |
| 13 | images: { |
| 14 | coredns: { |
| 15 | repository: "coredns" |
| 16 | name: "coredns" |
| 17 | tag: "1.11.1" |
| 18 | pullPolicy: "IfNotPresent" |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | charts: { |
| 23 | coredns: { |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 24 | kind: "GitRepository" |
| 25 | address: "https://github.com/giolekva/pcloud.git" |
| 26 | branch: "main" |
| 27 | path: "charts/coredns" |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 28 | } |
| 29 | } |
| 30 | |
| 31 | helm: { |
| 32 | coredns: { |
| 33 | chart: charts.coredns |
| 34 | values: { |
| 35 | image: { |
| 36 | repository: images.coredns.fullName |
| 37 | tag: images.coredns.tag |
| 38 | pullPolicy: images.coredns.pullPolicy |
| 39 | } |
| 40 | replicaCount: 1 |
| 41 | resources: { |
| 42 | limits: { |
| 43 | cpu: "100m" |
| 44 | memory: "128Mi" |
| 45 | } |
| 46 | requests: { |
| 47 | cpu: "100m" |
| 48 | memory: "128Mi" |
| 49 | } |
| 50 | } |
| 51 | rollingUpdate: { |
| 52 | maxUnavailable: 1 |
| 53 | maxSurge: "25%" |
| 54 | } |
| 55 | terminationGracePeriodSeconds: 30 |
| 56 | serviceType: "ClusterIP" |
| 57 | service: name: "coredns" |
| 58 | serviceAccount: create: false |
| 59 | rbac: { |
| 60 | create: false |
| 61 | pspEnable: false |
| 62 | } |
| 63 | isClusterService: false |
| 64 | if len(input.servers) > 0 { |
| 65 | servers: [ |
| 66 | for s in input.servers { |
| 67 | zones: [{ |
| 68 | zone: s.zone |
| 69 | }] |
| 70 | port: 53 |
| 71 | plugins: [{ |
| 72 | name: "log" |
| 73 | }, { |
| 74 | name: "forward" |
| 75 | parameters: ". \(s.address)" |
| 76 | }, { |
| 77 | name: "health" |
| 78 | configBlock: "lameduck 5s" |
| 79 | }, { |
| 80 | name: "ready" |
| 81 | }] |
| 82 | } |
| 83 | ] |
| 84 | } |
| 85 | if len(input.servers) == 0 { |
| 86 | servers: [{ |
| 87 | zones: [{ |
| 88 | zone: "." |
| 89 | }] |
| 90 | port: 53 |
| 91 | plugins: [{ |
| 92 | name: "ready" |
| 93 | }] |
| 94 | }] |
| 95 | } |
| 96 | livenessProbe: { |
| 97 | enabled: true |
| 98 | initialDelaySeconds: 60 |
| 99 | periodSeconds: 10 |
| 100 | timeoutSeconds: 5 |
| 101 | failureThreshold: 5 |
| 102 | successThreshold: 1 |
| 103 | } |
| 104 | readinessProbe: { |
| 105 | enabled: true |
| 106 | initialDelaySeconds: 30 |
| 107 | periodSeconds: 10 |
| 108 | timeoutSeconds: 5 |
| 109 | failureThreshold: 5 |
| 110 | successThreshold: 1 |
| 111 | } |
| 112 | zoneFiles: [] |
| 113 | hpa: enabled: false |
| 114 | autoscaler: enabled: false |
| 115 | deployment: enabled: true |
| 116 | } |
| 117 | } |
| 118 | } |