0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-04-11 06:01:21 +00:00

Add "Too many requests to registry" section in FAQ ()

This commit is contained in:
CrazyMax 2020-09-06 20:42:59 +02:00
parent e9c047f4aa
commit f7607c898e
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
12 changed files with 37 additions and 210 deletions

View file

@ -1,37 +0,0 @@
version: "3.2"
services:
diun:
image: crazymax/diun:latest
container_name: diun
volumes:
- "./data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Europe/Paris"
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_PROVIDERS_DOCKER=true"
labels:
- "diun.enable=true"
- "diun.watch_repo=true"
restart: always
cloudflared:
image: crazymax/cloudflared:latest
ports:
- target: 5053
published: 5053
protocol: udp
- target: 49312
published: 49312
protocol: tcp
environment:
- "TZ=Europe/Paris"
- "TUNNEL_DNS_UPSTREAM=https://1.1.1.1/dns-query,https://1.0.0.1/dns-query"
labels:
- "diun.enable=true"
- "diun.watch_repo=true"
restart: always

View file

@ -1,81 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
name: diun
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: diun
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: diun
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: diun
subjects:
- kind: ServiceAccount
name: diun
namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: default
name: diun
spec:
replicas: 1
selector:
matchLabels:
app: diun
template:
metadata:
labels:
app: diun
annotations:
diun.enable: "true"
diun.watch_repo: "true"
spec:
serviceAccountName: diun
containers:
- name: diun
image: crazymax/diun:latest
imagePullPolicy: Always
env:
- name: TZ
value: "Europe/Paris"
- name: LOG_LEVEL
value: "info"
- name: LOG_JSON
value: "false"
- name: DIUN_WATCH_WORKERS
value: "20"
- name: DIUN_WATCH_SCHEDULE
value: "*/30 * * * *"
- name: DIUN_PROVIDERS_KUBERNETES
value: "true"
volumeMounts:
- mountPath: "/data"
name: "data"
restartPolicy: Always
volumes:
# Set up a data directory for diun
# For production usage, you should consider using PV/PVC instead(or simply using storage like NAS)
# For more details, please see https://kubernetes.io/docs/concepts/storage/volumes/
- name: "data"
hostPath:
path: "/data"
type: Directory

View file

@ -1,23 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: default
name: nginx
spec:
selector:
matchLabels:
run: nginx
replicas: 2
template:
metadata:
labels:
run: nginx
annotations:
diun.enable: "true"
diun.watch_repo: "true"
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80

View file

@ -1,24 +0,0 @@
version: "3.5"
services:
diun:
image: crazymax/diun:latest
volumes:
- "./data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Europe/Paris"
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_PROVIDERS_SWARM=true"
deploy:
mode: replicated
replicas: 1
labels:
- "diun.enable=true"
- "diun.watch_repo=true"
placement:
constraints:
- node.role == manager

View file

@ -1,15 +0,0 @@
version: "3.5"
services:
nginx:
image: nginx
ports:
- target: 80
published: 80
protocol: udp
deploy:
mode: replicated
replicas: 2
labels:
- "diun.enable=true"
- "diun.watch_repo=true"

View file

@ -1,17 +0,0 @@
[Unit]
Description=Diun
Documentation=https://github.com/crazy-max/diun
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=diun
Group=diun
ExecStart=/usr/local/bin/diun --config /etc/diun/diun.yml --log-level info
Restart=always
Environment=DIUN_DB_PATH=/var/lib/diun/diun.db
[Install]
WantedBy=multi-user.target

View file

@ -16,7 +16,8 @@ $ docker-compose exec diun diun --test-notif
## field docker|swarm uses unsupported type: invalid
If you have the error `failed to decode configuration from file: field docker uses unsupported type: invalid` that's because your `docker`, `swarm` or `kubernetes` provider is not initialized in your configuration:
If you have the error `failed to decode configuration from file: field docker uses unsupported type: invalid` that's
because your `docker`, `swarm` or `kubernetes` provider is not initialized in your configuration:
!!! failure
```yaml
@ -34,9 +35,12 @@ should be:
## No image found in manifest list for architecture, variant, OS
If you encounter this kind of warning, you are probably using the [file provider](providers/file.md) containing an image with an erroneous or empty platform. If the platform is not filled in, it will be deduced automatically from the information of your operating system on which Diun is running.
If you encounter this kind of warning, you are probably using the [file provider](providers/file.md) containing an
image with an erroneous or empty platform. If the platform is not filled in, it will be deduced automatically from the
information of your operating system on which Diun is running.
In the example below, Diun is running (`diun_x.x.x_windows_i386.zip`) on Windows 10 and tries to analyze the `crazymax/cloudflared` image with the detected platform (`windows/386)`:
In the example below, Diun is running (`diun_x.x.x_windows_i386.zip`) on Windows 10 and tries to analyze the
`crazymax/cloudflared` image with the detected platform (`windows/386)`:
```yaml
- name: crazymax/cloudflared:2020.2.1
@ -60,3 +64,23 @@ You have to force the platform for this image if you are not on a supported plat
!!! success
`Fri, 27 Mar 2020 01:24:33 UTC INF New image found image=docker.io/crazymax/cloudflared:2020.2.1 provider=file`
## Too many requests to registry
The error `Cannot create image closer: too many requests to registry` is returned when the HTTP status code returned
by the registry is 429.
This can happen on the DockerHub registry because of the [rate-limited anonymous pulls](https://docs.docker.com/docker-hub/download-rate-limit/).
To solve this you must first be authenticated against the registry through the [`regopts` settings](config/regopts.md):
```yaml
regopts:
- name: "docker.io"
selector: image
username: foo
password: bar
```
If this is not enough, tweak the [`schedule` setting](config/watch.md#schedule) with something
like `0 */6 * * *` (every 6 hours).

View file

@ -46,7 +46,7 @@ services:
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_PROVIDERS_DOCKER=true"
- "DIUN_PROVIDERS_DOCKER_WATCHSTOPPED=true"
labels:
@ -70,7 +70,7 @@ $ docker run -d --name diun \
-e "LOG_LEVEL=info" \
-e "LOG_JSON=false" \
-e "DIUN_WATCH_WORKERS=20" \
-e "DIUN_WATCH_SCHEDULE=*/30 * * * *" \
-e "DIUN_WATCH_SCHEDULE=0 */6 * * *" \
-e "DIUN_PROVIDERS_DOCKER=true" \
-e "DIUN_PROVIDERS_DOCKER_WATCHSTOPPED=true" \
-v "$(pwd)/data:/data" \
@ -111,7 +111,7 @@ services:
watch:
workers: 20
schedule: "*/30 * * * *"
schedule: "0 */6 * * *"
providers:
docker:

View file

@ -26,7 +26,7 @@ services:
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_PROVIDERS_DOCKER=true"
- "DIUN_PROVIDERS_DOCKER_WATCHSTOPPED=true"
restart: always
@ -70,8 +70,8 @@ diun_1 | Sat, 14 Dec 2019 15:30:12 CET INF New image found id=mydocker i
diun_1 | Sat, 14 Dec 2019 15:30:12 CET INF New image found id=mydocker image=docker.io/crazymax/cloudflared:2019.11.0 provider=docker
diun_1 | Sat, 14 Dec 2019 15:30:12 CET INF New image found id=mydocker image=docker.io/crazymax/cloudflared:2019.11.3 provider=docker
diun_1 | Sat, 14 Dec 2019 15:30:13 CET INF New image found id=mydocker image=docker.io/crazymax/cloudflared:2019.11.2 provider=docker
diun_1 | Sat, 14 Dec 2019 15:30:13 CET INF Cron initialized with schedule */30 * * * *
diun_1 | Sat, 14 Dec 2019 15:30:13 CET INF Next run in 29 minutes (2019-12-14 16:00:00 +0100 CET)
diun_1 | Sat, 14 Dec 2019 15:30:13 CET INF Cron initialized with schedule 0 */6 * * *
diun_1 | Sat, 14 Dec 2019 15:30:13 CET INF Next run in 2 hours 29 minutes (2019-12-14 16:00:00 +0100 CET)
```
## Configuration

View file

@ -79,7 +79,7 @@ spec:
- name: DIUN_WATCH_WORKERS
value: "20"
- name: DIUN_WATCH_SCHEDULE
value: "*/30 * * * *"
value: "0 */6 * * *"
- name: DIUN_PROVIDERS_KUBERNETES
value: "true"
volumeMounts:

View file

@ -26,7 +26,7 @@ services:
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_PROVIDERS_SWARM=true"
deploy:
mode: replicated

View file

@ -20,7 +20,7 @@ services:
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_PROVIDERS_DOCKER=true"
- "DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true"
restart: always
@ -58,7 +58,7 @@ services:
watch:
workers: 20
schedule: "*/30 * * * *"
schedule: "0 */6 * * *"
firstCheckNotif: false
providers: