Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localize Command Feedback #4996

Open
annasong20 opened this issue Jan 25, 2023 · 8 comments
Open

localize Command Feedback #4996

annasong20 opened this issue Jan 25, 2023 · 8 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@annasong20
Copy link
Contributor

This umbrella issue tracks user feedback for the new alpha command kustomize localize.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 25, 2023
@KnVerey KnVerey added kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Feb 2, 2023
@k8s-ci-robot k8s-ci-robot removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 2, 2023
@Jell
Copy link

Jell commented Mar 8, 2023

Great feature! <3 I noticed one thing though: it seems to be broken for remote transformers? I don't know if that's a bug or a feature :p I have a repository here reproducing the error I'm seeing: https://github.com/Jell/kustomize-localize-remote-transformers-issue

To me this looks like a similar error to: #4958

(not sure if I should open a separate ticket or not, but I saw on the release note I should give feedback on the feature in this issue, so I thought I would start here)

@jleonar
Copy link

jleonar commented Mar 9, 2023

I think having an --overwrite flag is really needed. We use localize because our git repo is not especially fast. Combined with localize doing everything sequentially, that means pulling resources in our CI pipelines is a no-go as it is too expensive.

So we use localize. However, every change requires us to "relocalize" before commits. Which in turns requires us to have a process to remove all our localized folders since we can't just pass a flag --overwrite.

@annasong20
Copy link
Contributor Author

@Jell Thank you for uploading the exact setup!

Yes, this behavior is intentional. However, the feature that the alpha version of localize intentionally excluded was not remote transformers, but transformers resulting from a kustomization. The Fields section of the documentation reads "In addition to localizing files" and the plugin footnote both allude to this.

We will add this feature in beta if it has enough popularity.

@NissesSenap
Copy link

Don't know if you want this in a separate feature request or not, but I will start here.

So I might be misunderstanding how to localize cmd works, but my understanding is that I can download remote resources from remote repositories like github.

It would be nice to add the possibility of downloading OCI manifests as well.
This is a feature that the flux community have implemented https://fluxcd.io/flux/installation, https://fluxcd.io/flux/cmd/flux_pull_artifact/

So a simple example, you can write the following and it will donwload the OCI artifact an unpack it.

flux pull artifact oci://ghcr.io/grafana-operator/kustomize/grafana-operator:v5.0.0-rc1 --output ./grafana-operator/

For those of us that uses flux it's nothing strange but for none flux users it would be nice to be able to do the same using Kustomize.

So adding oci support to localize to be able to do something like this would be nice:

kustomize localize oci://ghcr.io/grafana-operator/kustomize/grafana-operator:v5.0.0-rc1

@natasha41575
Copy link
Contributor

@NissesSenap Thanks for the comment! I agree that we should try to support oci as a remote format - it seems to be becoming a more and more popular way to store kubernetes manifests.

If we do support oci, we should support it both with kustomize build and kustomize localize.

@NissesSenap
Copy link

@natasha41575 , I didn't know that kustomize build supported remote repositories until today. But since it does, it feels natural to add OCI support to the build sub command as well.

@Striar-Yunis
Copy link

Is there any documentation on how to update custom generators to give them support for localize? For instance ksops. It provides sops secret encryption but its referenced encrypted manifest files are missed. Is there an interface for generators communicating back to localize?

In the following example secrets/example.yaml is not localized.

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generators:
- secret-generator.yaml
apiVersion: viaduct.ai/v1
kind: ksops
metadata:
  name: secret-generator
files:
  - secrets/example.yaml

@annasong20
Copy link
Contributor Author

Hi @Striar-Yunis, thank you for the link and exact setup!

Unfortunately, in alpha, localize only knows how to download/copy file references in the built-in plugins listed here: https://kubectl.docs.kubernetes.io/references/kustomize/cmd/localize/#fields. I think the ability to specify file references for custom generators/transformers will be great to discuss for beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

8 participants