Background
DKP's Kommander deploys Gitea, which is where the various Kommander apps artifacts are hosted. FluxCD's GitRepository
is then pointed to this instance of Gitea, as a source.
There could be scenarios where there is a need to interact with the Git repo hosted inside Gitea. For example, the dkp upgrade kommander
command can exit with the following error:
✗ Ensuring application definitions are updated
failed to ensure "Ensuring application definitions are updated": failed to update app definitions: failed to clone repository https://localhost:42377/kommander/kommander.git: could not clone repo: repository not found
or you might see a kustomize
error like:
kustomization path not found: stat /tmp/kustomization-52138408/services/gatekeeper/3.8.1: no such file or directory
Therefore it would be helpful in troubleshooting, if we are able to clone the git repo and check if the artifacts exist or not.
Solution
A quick way to clone the git repo is via the dkp cli
./dkp experimental gitea clone
This would clone the repo into a 'kommander' directory in your machine.
Another way would be to port forward into the gitea instance and then perform your git operations.
kubectl port-forward gitea-0 -n kommander 9100:3000
While port-forward is active, on another terminal
git clone -c http.sslVerify=false https://$(kubectl -n kommander-flux get secret kommander-git-credentials -o go-template='{{.data.username|base64decode}}'):$(kubectl -n kommander-flux get secret kommander-git-credentials -o go-template='{{.data.password|base64decode}}')@localhost:9100/kommander/kommander.git
cd kommander/
From here you can do various git operations.
Please note that the Gitea instance is only supported for use by Kommander, it is not supported for use with your applications or projects. Also, take caution when interacting with the repo. Any changes pushed to the git repo will be reflected onto your Kommander cluster. Any changes to this repo should only be made with guidance from D2iQ support.