| 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: { |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 44 | kind: "GitRepository" |
| 45 | address: "https://github.com/giolekva/pcloud.git" |
| 46 | branch: "main" |
| 47 | path: "charts/zot" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 48 | } |
| 49 | volume: { |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 50 | kind: "GitRepository" |
| 51 | address: "https://github.com/giolekva/pcloud.git" |
| 52 | branch: "main" |
| 53 | path: "charts/volumes" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
| 57 | volumes: { |
| 58 | zot: { |
| 59 | name: "zot" |
| 60 | accessMode: "ReadWriteOnce" |
| 61 | size: "100Gi" |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | _httpPort: 80 |
| 66 | |
| gio | 1de4958 | 2024-04-21 08:33:57 +0400 | [diff] [blame] | 67 | helm: { |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 68 | zot: { |
| 69 | chart: charts.zot |
| gio | f9f0bee | 2024-06-11 20:10:05 +0400 | [diff] [blame^] | 70 | info: "Installing Zot server" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 71 | values: { |
| 72 | image: { |
| 73 | repository: images.zot.fullName |
| 74 | tag: images.zot.tag |
| 75 | pullPolicy: images.zot.pullPolicy |
| 76 | } |
| 77 | service: { |
| 78 | type: "ClusterIP" |
| 79 | additionalAnnotations: { |
| 80 | "metallb.universe.tf/address-pool": global.id |
| 81 | } |
| 82 | port: _httpPort |
| 83 | } |
| 84 | ingress: enabled: false |
| 85 | mountConfig: true |
| 86 | configFiles: { |
| 87 | "config.json": json.Marshal({ |
| 88 | storage: rootDirectory: "/var/lib/registry" |
| 89 | http: { |
| 90 | address: "0.0.0.0" |
| 91 | port: "5000" |
| 92 | } |
| 93 | log: level: "debug" |
| 94 | extensions: { |
| 95 | ui: enable: true |
| 96 | search: enable: true |
| 97 | } |
| 98 | }) |
| 99 | } |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 100 | persistence: true |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 101 | pvc: { |
| 102 | create: false |
| 103 | name: volumes.zot.name |
| 104 | } |
| 105 | startupProbe: {} |
| 106 | } |
| 107 | } |
| 108 | volume: { |
| 109 | chart: charts.volume |
| gio | f9f0bee | 2024-06-11 20:10:05 +0400 | [diff] [blame^] | 110 | info: "Creating disk" |
| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame] | 111 | values: volumes.zot |
| 112 | } |
| 113 | } |