| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 1 | import ( |
| 2 | "encoding/json" |
| 3 | ) |
| 4 | |
| 5 | input: { |
| gio | 44f621b | 2024-04-29 09:44:38 +0400 | [diff] [blame] | 6 | network: #Network @name(Network) |
| 7 | subdomain: string @name(Subdomain) |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 8 | } |
| 9 | |
| 10 | _domain: "\(input.subdomain).\(input.network.domain)" |
| gio | 09a3e5b | 2024-04-26 14:11:06 +0400 | [diff] [blame] | 11 | url: "https://\(_domain)" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 12 | |
| gio | 44f621b | 2024-04-29 09:44:38 +0400 | [diff] [blame] | 13 | name: "Zot" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 14 | namespace: "app-zot" |
| 15 | readme: "OCI-native container image registry, simplified" |
| 16 | description: "OCI-native container image registry, simplified" |
| 17 | icon: "<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 24 24'><path fill='currentColor' d='M21.231 2.462L7.18 20.923h14.564V24H2.256v-2.462L16.308 3.076H2.975V0h18.256z'/></svg>" |
| 18 | |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 19 | ingress: { |
| 20 | zot: { |
| 21 | auth: enabled: false |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 22 | network: input.network |
| 23 | subdomain: input.subdomain |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 24 | service: { |
| 25 | name: "zot" |
| 26 | port: number: _httpPort // TODO(gio): make optional |
| 27 | } |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 28 | } |
| 29 | } |
| 30 | |
| 31 | // TODO(gio): configure busybox |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 32 | images: { |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 33 | zot: { |
| 34 | registry: "ghcr.io" |
| 35 | repository: "project-zot" |
| 36 | name: "zot-linux-amd64" |
| 37 | tag: "v2.0.3" |
| 38 | pullPolicy: "IfNotPresent" |
| 39 | } |
| 40 | } |
| 41 | |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 42 | charts: { |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 43 | zot: { |
| 44 | chart: "charts/zot" |
| 45 | sourceRef: { |
| 46 | kind: "GitRepository" |
| 47 | name: "pcloud" |
| 48 | namespace: global.id |
| 49 | } |
| 50 | } |
| 51 | volume: { |
| 52 | chart: "charts/volumes" |
| 53 | sourceRef: { |
| 54 | kind: "GitRepository" |
| 55 | name: "pcloud" |
| 56 | namespace: global.id |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | volumes: { |
| 62 | zot: { |
| 63 | name: "zot" |
| 64 | accessMode: "ReadWriteOnce" |
| 65 | size: "100Gi" |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | _httpPort: 80 |
| 70 | |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 71 | helm: { |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 72 | zot: { |
| 73 | chart: charts.zot |
| 74 | values: { |
| 75 | image: { |
| 76 | repository: images.zot.fullName |
| 77 | tag: images.zot.tag |
| 78 | pullPolicy: images.zot.pullPolicy |
| 79 | } |
| 80 | service: { |
| 81 | type: "ClusterIP" |
| 82 | additionalAnnotations: { |
| 83 | "metallb.universe.tf/address-pool": global.id |
| 84 | } |
| 85 | port: _httpPort |
| 86 | } |
| 87 | ingress: enabled: false |
| 88 | mountConfig: true |
| 89 | configFiles: { |
| 90 | "config.json": json.Marshal({ |
| 91 | storage: rootDirectory: "/var/lib/registry" |
| 92 | http: { |
| 93 | address: "0.0.0.0" |
| 94 | port: "5000" |
| 95 | } |
| 96 | log: level: "debug" |
| 97 | extensions: { |
| 98 | ui: enable: true |
| 99 | search: enable: true |
| 100 | } |
| 101 | }) |
| 102 | } |
| 103 | persistnce: true |
| 104 | pvc: { |
| 105 | create: false |
| 106 | name: volumes.zot.name |
| 107 | } |
| 108 | startupProbe: {} |
| 109 | } |
| 110 | } |
| 111 | volume: { |
| 112 | chart: charts.volume |
| 113 | values: volumes.zot |
| 114 | } |
| 115 | } |