Closed TitanRob16 closed 12 months ago
π€
Hello,
Based on the error message you're seeing, it seems like the KSOPS plugin is not being correctly located by Argo CD. This could be due to a misconfiguration in your values.yaml
file or an issue with the Argo CD environment.
From the issues I found in the KSOPS repository, there are a few things you could try:
Change the location of sops-age
volume mount in the deployment manifest. The current configuration might be overriding the KSOPS mount and deleting the KSOPS plugin. You can find more details in this issue.
Correct the environment variables in Argo CD. XDG_CONFIG_HOME
should be set to /.config
not ~/.config
. You can find more details in this issue.
Use the correct patch for KSOPS v4.2.4
. The patch should look like:
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-repo-server
spec:
template:
spec:
volumes:
- name: custom-tools
emptyDir: {}
initContainers:
- name: install-ksops
image: viaductoss/ksops:v4.2.4
command: ["/bin/sh", "-c"]
args:
- echo "Installing KSOPS...";
mv ksops /custom-tools/;
mv kustomize /custom-tools/;
echo "Done.";
volumeMounts:
- mountPath: /custom-tools
name: custom-tools
containers:
- name: argocd-repo-server
volumeMounts:
- mountPath: /usr/local/bin/kustomize
name: custom-tools
subPath: kustomize
- mountPath: /usr/local/bin/ksops
name: custom-tools
subPath: ksops
You can apply this patch to your Argo CD deployment with the following command:
kubectl patch deployment argocd-repo-server -n argocd -p "$(cat argo-cd-repo-server-ksops-patch.yaml)"
Alternatively, you can create a custom Argo CD Docker image with KSOPS. You can find the steps to do this in the KSOPS README.
Lastly, remember to enable Kustomize Alpha Plugins via Argo CD ConfigMap, which is required for KSOPS:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
kustomize.buildOptions: "--enable-alpha-plugins --enable-exec"
I hope this helps! If you have any other questions or if the issue persists, please let me know.
kustomize build .deploy --enable-alpha-plugins
failed exit status 1: Error: loading generator plugins: unable to find plugin rootThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a π if this is helpful and π if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Hey @TitanRob16 sorry that you are running into issues. Can you share your generator manifest?
Given the error it looks like you're using the legacy style exec plugins, which like the blog suggests, requires XDG_CONFIG_HOME
to be set. It'll look something like this (notice no .so
after ksops
)
containers:
- name: argocd-repo-server
volumeMounts:
- mountPath: /usr/local/bin/kustomize
name: custom-tools
subPath: kustomize
# Verify this matches a XDG_CONFIG_HOME=/.config env variable
- mountPath: /.config/kustomize/plugin/viaduct.ai/v1/ksops/ksops
name: custom-tools
subPath: ksops
# 4. Set the XDG_CONFIG_HOME env variable to allow kustomize to detect the plugin
env:
- name: XDG_CONFIG_HOME
value: /.config
Thanks, @devstein - setting those values got me over that initial error. You mention I'm using the legacy style exec plugins; is there a better, non-legacy method available? Much of what I've read is from 3/4 years ago.
@TitanRob16 Glad to hear.
The kustomize ecosystem is migrating to "KRM-style" plugins. The KSOPS resource looks like this.
With that said, they have been "migrating" for several years now and it's unclear what the timeline is to actually dropping support for the old exec plugins. I'd say use whatever work π
Thanks very much, @devstein!
Thanks very much, @devstein!
Hey, did you finally resolve the issue? I'm stuck on the same error you were having :(
Using helm values + and ksops config as you showed on the first message, but still the error
There seems to be some info missing from the README regarding the ksops installation via the values.yaml file.
I have the following in my values.yaml file:
However, when I try to create an application via Argo CD's GUI, I get the error:
Unable to create application: application spec for gitops-argocd-sops is invalid: InvalidSpecError: Unable to generate manifests in base: rpc error: code = Unknown desc = `kustomize build <path to cached source>/base --enable-alpha-plugins --enable-exec` failed exit status 1: Error: loading generator plugins: failed to load generator: unable to find plugin root - tried: ('<no value>'; homed in $KUSTOMIZE_PLUGIN_HOME), ('/usr/local/bin/kustomize/plugin'; homed in $XDG_CONFIG_HOME), ('/home/argocd/.config/kustomize/plugin'; homed in default value of $XDG_CONFIG_HOME), ('/home/argocd/kustomize/plugin'; homed in home directory)
Some older blogs say to use a config like this instead:
But this also doesn't work.
There's very clearly a problem with the plugin location; how should the values.yaml be configured?