stakater / Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!

Home Page:https://docs.stakater.com/reloader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest commit 29310fe3ae211341c739eb4e750deafc7d7a134a fails in kustomization

pscadiz opened this issue · comments

Reloader's latest commit 29310fe3ae211341c739eb4e750deafc7d7a134a caused failures in kustomizations, managed by flux.
Error is as follows:

kustomize build failed: accumulating resources: accumulation err='accumulating resources from '../base': read /tmp/kustomization-598831381/stakater-reloader/base: is a directory': recursed accumulation of path '/tmp/kustomization-598831381/stakater-reloader/base': accumulating resources: accumulation err='accumulating resources from 'https://github.com/stakater/Reloader/deployments/kubernetes': URL is a git repository': git cmd = '/usr/bin/git submodule update --init --recursive': exit status 1

Some additioal information:

  • Flux version 0.39.0
  • We are using Kustomize deloyments
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: reloader
bases:
  - https://github.com/stakater/Reloader/deployments/kubernetes

Use releases instead of commits, can you replicate with latest version?

Same problem with latest release:

Error: accumulating resources: accumulation err='accumulating resources from 'https://github.com/stakater/Reloader/tree/v1.0.29/deployments/kubernetes': yaml: line 177: mapping values are not allowed in this context': git cmd = '/usr/bin/git submodule update --init --recursive': exit status 1

And tried earlier also, but same issue.

Btw, is there way to get latest release url without spesific tag?

Do not work https://github.com/stakater/Reloader/tree/latest/deployments/kubernetes
Working https://github.com/stakater/Reloader/tree/v1.0.29/deployments/kubernetes

@karl-johan-grahn
#480 this broke the submodule dependency from public users.

I can fetch this repo via https, but not via ssh.

git submodule update --init --recursive
Submodule 'vocabulary' (git@github.com:stakater/vocabulary.git) registered for path 'vocabulary'
Cloning into '/home/user/reloader/Reloader/vocabulary'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:stakater/vocabulary.git' into submodule path '/home/user/reloader/Reloader/vocabulary' failed
Failed to clone 'vocabulary'. Retry scheduled
Cloning into '/home/user/reloader/Reloader/vocabulary'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:stakater/vocabulary.git' into submodule path '/home/user/reloader/Reloader/vocabulary' failed
Failed to clone 'vocabulary' a second time, aborting

And yes I also cannot run kustomize because of this with the following yaml.

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: reloader

resources:
  # reloader
  - github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.29

Have also switched to using @outductor 's implementation, with minor differences.
The following kustomization worked:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: reloader
bases:
  - git::https://github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.27

@pscadiz I think bases is deprecated now.

git:: did not work for me.

error: accumulating resources: accumulation err='accumulating resources from 'git::https://github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.30': evalsymlink failure on '/home/user/reloader/git::https:/github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.30' : lstat /home/user/reloader/git::https:: no such file or directory': failed to run '/usr/bin/git submodule update --init --recursive': Submodule 'vocabulary' (git@github.com:stakater/vocabulary.git) registered for path 'vocabulary'
Cloning into '/tmp/kustomize-2610169588/vocabulary'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.```
commented

Remove this submodule from the repository, it broke everything.!!!

Kustomize doesn't work well with git submodules.

commented

Same for us.

The mentioned git:: prefix is deprecated by kustomize:

2023/07/27 11:53:12 Warning: Forcing the git protocol using the 'git::' URL prefix is not supported. Kustomize currently strips this invalid prefix, but will stop doing so in a future release. Please remove the 'git::' prefix from your configuration.

We cannot install/upgrade reloader any more with ArgoCD&kustomize at the moment, due to the existence of the submodule.

commented

OK, so the thing is, when the submodule was added, it was added by using ssh instead of https as protocol. This breaks every public user pulling the repo, as usually as a public user you use https without a ssh key.

The elegant solution would be to add the submodule as https to also allow public users to pull the entire repo, however this can only be done by a maintainer, i.e. change git@github.com to https://github.com in .git/config and .submodules.

However, currently the submodule seems not to be required for the actual reloader installation to succeed. So what you can do is have kustomize ignore submodules entirely by adding submodules=false as a parameter to the resource.

kind: Kustomization
resources:
  - github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.32&submodules=false

As long as the submodule is not required at runtime by reloader in a cluster, this workaround/fix/addition should work. It looks like the module is just for spell checking in a documentation.

it was added by using ssh instead of https as protocol. This breaks every public user pulling the repo, as usually as a public user you use https without a ssh key.

yep that's what i said here #482 (comment)

OK, so the thing is, when the submodule was added, it was added by using ssh instead of https as protocol. This breaks every public user pulling the repo, as usually as a public user you use https without a ssh key.

The elegant solution would be to add the submodule as https to also allow public users to pull the entire repo, however this can only be done by a maintainer, i.e. change git@github.com to https://github.com in .git/config and .submodules.

However, currently the submodule seems not to be required for the actual reloader installation to succeed. So what you can do is have kustomize ignore submodules entirely by adding submodules=false as a parameter to the resource.

kind: Kustomization
resources:
  - github.com/stakater/Reloader/deployments/kubernetes?ref=v1.0.32&submodules=false

As long as the submodule is not required at runtime by reloader in a cluster, this workaround/fix/addition should work. It looks like the module is just for spell checking in a documentation.

Thank you for sharing an available workaround! The submodules=false argument works perfectly