good config!

This commit is contained in:
2024-01-13 18:26:23 +01:00
parent 1d60c61c30
commit 9335b69c74
23 changed files with 925 additions and 336 deletions

View File

@ -0,0 +1,42 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: zot-config
data:
config.json: |
{
"storage": {
"rootDirectory": "/var/lib/registry"
},
"http": {
"address": "0.0.0.0",
"port": "5000"
},
"log": {
"level": "debug"
},
"extensions": {
"sync": {
"credentialsFile": "/etc/zot/credentials.json",
"registries": [
{
"urls": [
"https://ghcr.io"
],
"onDemand": true,
"pollInterval": "6h",
"tlsVerify": false,
"maxRetries": 3,
"retryDelay": "5m",
"onlySigned": false,
"content": [
{
"prefix": "/cyrilix/model-steering",
"destination": "/robocars/model-steering"
}
]
}
]
}
}
}

View File

@ -0,0 +1,61 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: registry
template:
metadata:
labels:
app: registry
spec:
containers:
- name: registry
image: ghcr.io/project-zot/zot-linux-arm64
env:
- name: TZ
value: 'Europe/Paris'
- name: REGISTRY_HTTP_ADDR
value: 0.0.0.0:5000
ports:
- containerPort: 5000
name: http-registry
volumeMounts:
- mountPath: /var/lib/registry
name: registry
- name: config
mountPath: /etc/zot/config.json
subPath: config.json
- name: credentials
mountPath: /etc/zot/credentials.json
subPath: credentials.json
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
volumes:
- name: registry
hostPath:
path: /home/pi/registry
- name: config
configMap:
name: zot-config
items:
- key: config.json
path: config.json
- name: credentials
secret:
secretName: registries-credentials
items:
- key: credentials.json
path: credentials.json

View File

@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: registry
images:
- name: ghcr.io/project-zot/zot-linux-arm64
newTag: v1.4.3
resources:
- namespace.yaml
- configmaps.yaml
- serviceaccount.yaml
- services.yaml
- deployements.yaml

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: registry

View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: registries-credentials
namespace: registry
stringData:
credentials.json: |
{
"ghcr.io": {
"username": "cyrilix",
"password": "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"
}

View File

@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: registry
automountServiceAccountToken: false

View File

@ -0,0 +1,27 @@
apiVersion: v1
kind: Service
metadata:
name: registry-ext
spec:
type: NodePort
ports:
- port: 5000
name: http-registry
targetPort: http-registry
nodePort: 32000
selector:
app: registry
---
apiVersion: v1
kind: Service
metadata:
name: registry
spec:
type: ClusterIP
ports:
- port: 5000
name: http-registry
targetPort: http-registry
selector:
app: registry