prole/docs/k3d.md

28 lines
950 B
Markdown

# k3d notes
## ArgoCD repo-server: `copyutil ... Permission denied`
If ArgoCD deploy appears to stall on `argocd-repo-server` and logs show:
```
copyutil /bin/cp: cannot create regular file '/var/run/argocd/argocd': Permission denied
```
This is usually a hostPath permission issue.
### Why it happens
In k3d, `hostPath` volumes refer to paths on the k3d node containers' filesystems.
When a manifest uses `hostPath.type: DirectoryOrCreate`, Kubernetes creates the
directory on the node as `root:root` with restrictive permissions.
ArgoCD runs `argocd-repo-server` and its init containers as a non-root user by
default, so an init container like `copyutil` cannot write to `/var/run/argocd`
unless the volume path is writable.
### How Knoe avoids the stall
The Knoe ArgoCD manifest includes an `init-permissions` initContainer (running
as root) which prepares/chowns the hostPath-backed mount points before the
non-root init containers run.