Renovate Open Source CLI
GitHub.com
➜ local kubectl logs renovate-vnccd
[dumb-init] renovate: No such file or directory
I'm deploying renovate via Kubernetes, initially in my local env (minikube).
but when I run the Kubernetes CronJob, it fails due to not able to find a "renovate" file or dir.
I'm wondering what is this renovate file/dir, and where can be configured; any hint is greatly appreciated.
Thanks!
Here is the yaml:
apiVersion: v1
kind: ConfigMap
metadata:
name: renovate-config
data:
config.json: |-
{
"logLevel" : "debug",
"dryRun" : "true"
}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: renovate-bot
spec:
schedule: '@hourly'
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- image: renovate/renovate:23.22.1
name: renovate-bot
# command: [ "/bin/sh", "-c", "ls -l /tmp/renovate/" ]
env:
- name: RENOVATE_PLATFORM
value: 'github'
- name: GITHUB_COM_TOKEN
value: 'xxxxx'
- name: RENOVATE_TOKEN
value: 'xxxxx'
- name: RENOVATE_AUTODISCOVER
value: 'true'
- name: RENOVATE_BASE_DIR
value: '/tmp/renovate/'
volumeMounts:
- name: config-volume
mountPath: /usr/src/app/
- name: work-volume
mountPath: /tmp/renovate/
restartPolicy: Never
volumes:
- name: config-volume
configMap:
name: renovate-config
- name: work-volume
emptyDir: {}
This should be where the renovate binary is located: https://github.com/renovatebot/docker-renovate/blob/3b5bb2aa26abadaf2c44488b1ca4f4ce1f96d0b1/Dockerfile#L74
@billyto I think it can be caused by the volume mount. can you check /usr/src/app/ dir withcommand like command: [ "/bin/sh", "-c", "ls -l /usr/src/app/" ]
@viceice seems like the dir is present and has the config file, see command result
total 0
lrwxrwxrwx 1 root root 18 Oct 9 12:47 config.json -> ..data/config.json
@billyto Your problem is, that kubernets is hiding our required renovate files in /usr/src/app/. So your solution is to mount the volume to another folder and set RENOVATE_CONFIG_FILE env
---
apiVersion: v1
kind: ConfigMap
metadata:
name: renovate-config
data:
config.json: |-
{
"logLevel" : "debug",
"dryRun" : "true"
}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: renovate-bot
spec:
schedule: '@hourly'
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- image: renovate/renovate:23.22.1
name: renovate-bot
# command: [ "/bin/sh", "-c", "ls -l /tmp/renovate/" ]
env:
- name: RENOVATE_PLATFORM
value: 'github'
- name: GITHUB_COM_TOKEN
value: 'xxxxx'
- name: RENOVATE_TOKEN
value: 'xxxxx'
- name: RENOVATE_AUTODISCOVER
value: 'true'
- name: RENOVATE_BASE_DIR
value: '/tmp/renovate/'
- name: RENOVATE_CONFIG_FILE
value: /opt/renovate/config.json
volumeMounts:
- name: config-volume
mountPath: /opt/renovate/
- name: work-volume
mountPath: /tmp/renovate/
restartPolicy: Never
volumes:
- name: config-volume
configMap:
name: renovate-config
- name: work-volume
emptyDir: {}
Alternatively you can use subPath mount options, see https://dev.to/joshduffney/kubernetes-using-configmap-subpaths-to-mount-files-3a1i for sample
@viceice I just saw your comments, let me check them... we were writing at the same time!
Thanks for the quick response @rarkins & @viceice. digging on those routes
command: [ "/bin/sh", "-c", "ls -l /usr/local/bin/" ]
will show that the mappings are there:
total 61672
-rwxr-xr-x 1 root root 1994202 Oct 7 14:38 composer
-rwxr-xr-x 1 ubuntu ubuntu 61125298 Sep 16 17:05 docker
-rwxr-xr-x 1 root root 268 Oct 7 10:38 docker-entrypoint.sh
-rwxr-xr-x 1 root root 186 Sep 26 02:04 install-apt
-rwxr-xr-x 1 root root 479 Sep 26 02:04 install-gem
-rwxr-xr-x 1 root root 394 Sep 26 02:04 install-pip
-rwxr-xr-x 1 root root 480 Sep 26 02:04 install-tool
-rwxr-xr-x 1 root root 69 Sep 26 04:01 node
lrwxrwxrwx 1 root root 29 Oct 7 12:18 renovate -> /usr/src/app/dist/renovate.js
lrwxrwxrwx 1 root root 37 Oct 7 12:18 renovate-config-validator -> /usr/src/app/dist/config-validator.js
checking the Docker file fore the renovate library there is a CMD just calling 'renovate', this might be the one that is missing some how.
Permissions seems fine, are we in the right dir to make this call, or this call correct?
Thanks!
see my last link. there is a good explanation what happend to you and how you can fix that. 🙃
It's working now! Thanks again for the help. Do you want me to send a PR to update the docs for K8s?
It's working now! Thanks again for the help. Do you want me to send a PR to update the docs for K8s?
Yes, that would be awesome.