| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 1 | input: { |
| 2 | network: #Network |
| 3 | subdomain: string |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame^] | 4 | auth: #Auth |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 5 | } |
| 6 | |
| 7 | _domain: "\(input.subdomain).\(input.network.domain)" |
| 8 | |
| Giorgi Lekveishvili | ef21c13 | 2024-01-17 18:57:58 +0400 | [diff] [blame] | 9 | name: "Pi-hole" |
| 10 | namespace: "app-pihole" |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 11 | readme: "Installs pihole at https://\(_domain)" |
| Giorgi Lekveishvili | ef21c13 | 2024-01-17 18:57:58 +0400 | [diff] [blame] | 12 | description: "Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network." |
| 13 | icon: "<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 24 24'><path fill='currentColor' d='M4.344 0c.238 4.792 3.256 7.056 6.252 7.376c.165-1.692-4.319-5.6-4.319-5.6c-.008-.011.009-.025.019-.014c0 0 4.648 4.01 5.423 5.645c2.762-.15 5.196-1.947 5-4.912c0 0-4.12-.613-5 4.618C11.48 2.753 8.993 0 4.344 0zM12 7.682v.002a3.68 3.68 0 0 0-2.591 1.077L4.94 13.227a3.683 3.683 0 0 0-.86 1.356a3.31 3.31 0 0 0-.237 1.255A3.681 3.681 0 0 0 4.92 18.45l4.464 4.466a3.69 3.69 0 0 0 2.251 1.06l.002.001c.093.01.187.015.28.017l-.1-.008c.06.003.117.009.177.009l-.077-.001L12 24l-.004-.005a3.68 3.68 0 0 0 2.61-1.077l4.469-4.465a3.683 3.683 0 0 0 1.006-1.888l.012-.063a3.682 3.682 0 0 0 .057-.541l.003-.061c0-.017.003-.05.004-.06h-.002a3.683 3.683 0 0 0-1.077-2.607l-4.466-4.468a3.694 3.694 0 0 0-1.564-.927l-.07-.02a3.43 3.43 0 0 0-.946-.133L12 7.682zm3.165 3.357c.023 1.748-1.33 3.078-1.33 4.806c.164 2.227 1.733 3.207 3.266 3.146c-.035.003-.068.007-.104.009c-1.847.135-3.209-1.326-5.002-1.326c-2.23.164-3.21 1.736-3.147 3.27l-.008-.104c-.133-1.847 1.328-3.21 1.328-5.002c-.173-2.32-1.867-3.284-3.46-3.132c.1-.011.203-.021.31-.027c1.847-.133 3.209 1.328 5.002 1.328c2.082-.155 3.074-1.536 3.145-2.968zM4.344 0c.238 4.792 3.256 7.056 6.252 7.376c.165-1.692-4.319-5.6-4.319-5.6c-.008-.011.009-.025.019-.014c0 0 4.648 4.01 5.423 5.645c2.762-.15 5.196-1.947 5-4.912c0 0-4.12-.613-5 4.618C11.48 2.753 8.993 0 4.344 0zM12 7.682v.002a3.68 3.68 0 0 0-2.591 1.077L4.94 13.227a3.683 3.683 0 0 0-.86 1.356a3.31 3.31 0 0 0-.237 1.255A3.681 3.681 0 0 0 4.92 18.45l4.464 4.466a3.69 3.69 0 0 0 2.251 1.06l.002.001c.093.01.187.015.28.017l-.1-.008c.06.003.117.009.177.009l-.077-.001L12 24l-.004-.005a3.68 3.68 0 0 0 2.61-1.077l4.469-4.465a3.683 3.683 0 0 0 1.006-1.888l.012-.063a3.682 3.682 0 0 0 .057-.541l.003-.061c0-.017.003-.05.004-.06h-.002a3.683 3.683 0 0 0-1.077-2.607l-4.466-4.468a3.694 3.694 0 0 0-1.564-.927l-.07-.02a3.43 3.43 0 0 0-.946-.133L12 7.682zm3.165 3.357c.023 1.748-1.33 3.078-1.33 4.806c.164 2.227 1.733 3.207 3.266 3.146c-.035.003-.068.007-.104.009c-1.847.135-3.209-1.326-5.002-1.326c-2.23.164-3.21 1.736-3.147 3.27l-.008-.104c-.133-1.847 1.328-3.21 1.328-5.002c-.173-2.32-1.867-3.284-3.46-3.132c.1-.011.203-.021.31-.027c1.847-.133 3.209 1.328 5.002 1.328c2.082-.155 3.074-1.536 3.145-2.968z'/></svg>" |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 14 | |
| 15 | images: { |
| 16 | pihole: { |
| 17 | repository: "pihole" |
| 18 | name: "pihole" |
| 19 | tag: "v5.8.1" |
| 20 | pullPolicy: "IfNotPresent" |
| 21 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 22 | authProxy: { |
| 23 | repository: "giolekva" |
| 24 | name: "auth-proxy" |
| 25 | tag: "latest" |
| 26 | pullPolicy: "Always" |
| 27 | } |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | charts: { |
| 31 | pihole: { |
| 32 | chart: "charts/pihole" |
| 33 | sourceRef: { |
| 34 | kind: "GitRepository" |
| 35 | name: "pcloud" |
| 36 | namespace: global.id |
| 37 | } |
| 38 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 39 | ingress: { |
| 40 | chart: "charts/ingress" |
| 41 | sourceRef: { |
| 42 | kind: "GitRepository" |
| 43 | name: "pcloud" |
| 44 | namespace: global.id |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame] | 45 | } |
| 46 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 47 | authProxy: { |
| 48 | chart: "charts/auth-proxy" |
| 49 | sourceRef: { |
| 50 | kind: "GitRepository" |
| 51 | name: "pcloud" |
| 52 | namespace: global.id |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | _piholeServiceName: "pihole-web" |
| 58 | _authProxyServiceName: "auth-proxy" |
| 59 | _httpPortName: "http" |
| 60 | _serviceWebPort: 80 |
| 61 | |
| 62 | helm: { |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 63 | pihole: { |
| 64 | chart: charts.pihole |
| 65 | values: { |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 66 | fullnameOverride: "pihole" |
| 67 | persistentVolumeClaim: { // TODO(gio): create volume separately as a dependency |
| 68 | enabled: true |
| 69 | size: "5Gi" |
| 70 | } |
| 71 | admin: { |
| 72 | enabled: false |
| 73 | } |
| 74 | ingress: { |
| 75 | enabled: false |
| 76 | } |
| 77 | serviceDhcp: { |
| 78 | enabled: false |
| 79 | } |
| 80 | serviceDns: { |
| 81 | type: "ClusterIP" |
| 82 | } |
| 83 | serviceWeb: { |
| 84 | type: "ClusterIP" |
| 85 | http: { |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 86 | enabled: true |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 87 | port: _serviceWebPort |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 88 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 89 | https: { |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 90 | enabled: false |
| 91 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 92 | } |
| 93 | virtualHost: _domain |
| 94 | resources: { |
| 95 | requests: { |
| 96 | cpu: "250m" |
| 97 | memory: "100M" |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 98 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 99 | limits: { |
| 100 | cpu: "500m" |
| 101 | memory: "250M" |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 102 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 103 | } |
| 104 | image: { |
| 105 | repository: images.pihole.fullName |
| 106 | tag: images.pihole.tag |
| 107 | pullPolicy: images.pihole.pullPolicy |
| 108 | } |
| 109 | } |
| 110 | } |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame^] | 111 | if input.auth.enabled { |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 112 | "auth-proxy": { |
| 113 | chart: charts.authProxy |
| 114 | values: { |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 115 | image: { |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 116 | repository: images.authProxy.fullName |
| 117 | tag: images.authProxy.tag |
| 118 | pullPolicy: images.authProxy.pullPolicy |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 119 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 120 | upstream: "\(_piholeServiceName).\(release.namespace).svc.cluster.local" |
| 121 | whoAmIAddr: "https://accounts.\(global.domain)/sessions/whoami" |
| 122 | loginAddr: "https://accounts-ui.\(global.domain)/login" |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame^] | 123 | membershipAddr: "http://memberships.\(global.id)-core-auth-memberships.svc.cluster.local/api/user" |
| 124 | groups: input.auth.groups |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 125 | portName: _httpPortName |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 126 | } |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | ingress: { |
| 130 | chart: charts.ingress |
| 131 | values: { |
| 132 | domain: _domain |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 133 | ingressClassName: input.network.ingressClass |
| 134 | certificateIssuer: input.network.certificateIssuer |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 135 | service: { |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame^] | 136 | if input.auth.enabled { |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 137 | name: _authProxyServiceName |
| 138 | port: name: _httpPortName |
| 139 | } |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame^] | 140 | if !input.auth.enabled { |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 141 | name: _piholeServiceName |
| 142 | port: number: _serviceWebPort |
| 143 | } |
| 144 | } |
| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | } |