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

Updated README to use 'bases' instead of 'resources' in overlays examples #2255

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

mvbakker
Copy link
Contributor

@mvbakker mvbakker commented Mar 4, 2020

In kustomize v2 kustomization.yaml can only refer to files in the same directory as itself, or in subdirectories. Only bases can refer to outside paths.

Please refer to: #776

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 4, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @mvbakker!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @mvbakker. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 4, 2020
@mvbakker
Copy link
Contributor Author

mvbakker commented Mar 4, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 4, 2020
@k8s-ci-robot
Copy link
Contributor

@mvbakker: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mvbakker
Copy link
Contributor Author

mvbakker commented Mar 4, 2020

/assign @pwittrock

@chancez
Copy link
Contributor

chancez commented Mar 5, 2020

I thought bases was deprecated according to https://github.com/kubernetes-sigs/kustomize/blob/master/docs/fields.md#bases:

The bases field was deprecated in v2.1.0.
Move entries into the resources field. This allows bases - which are still a central concept - to be ordered relative to other input resources.

@mvbakker
Copy link
Contributor Author

mvbakker commented Mar 5, 2020

@chancez, thanks for the comment, that makes sense. Still when I run kubectl kustomize overlays/staging/ it with the resources right now it fails and I get the following error:

Error: rawResources failed to read Resources: Load from path ../../base failed: '../../base' must be a file (got d='/Users/local/path/to/kustomize_helloWorld/base')

Am I doing something wrong or should I propose a different solution in the PR?

@khrisrichardson
Copy link
Contributor

@mvbakker check out https://github.com/kubernetes-sigs/kustomize#kubectl-integration, which explains the version disparity. Clearly identified versioned docs would go a long way. Of course one could always browse the docs from a specific tag in github, but it's not obvious that one ought to do that.

Maybe creating a separate kubectl-vX.Y.Z tag would also help ever so slightly, albeit altogether no more obvious without something directing folks there. If only markdown supported drop-down lists, which would obviate the need for creating a large version matrix. And I have no idea where the source for the http://kustomize.io website resides.

@pwittrock
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 17, 2020
@pwittrock
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mvbakker, pwittrock

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit 0029933 into kubernetes-sigs:master Mar 25, 2020
@YiannisGkoufas
Copy link

Sorry to open this again, I am a bit confused.
The behaviour that I noticed. My structure is this:

image

And in my high-level kustomization I have this:

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

resources:
- crds
- apps
- rbac

When I issue kustomize build ./deploy-kustomize it doesn't complain and outputs the generated yaml.
When I issue kubectl apply -k ./deploy-kustomize it doesn't like it and complains about:

error: rawResources failed to read Resources: Load from path crds failed: 'crds' must be a file (got d='/deploy-kustomize/crds')

When I update the main kustomization.yaml to this:

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

bases:
- crds
- apps
- rbac

and execute kubectl apply -k ./deploy-kustomize it works without a problem, even though bases seems to be deprecated.

If there is any help, this is my kubectl version:

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-09T11:26:42Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:04:18Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

@Shell32-Natsu
Copy link
Contributor

@YiannisGkoufas kubectl is using a very old version of Kustomize. It's not strange that the behavior is different.

@YiannisGkoufas
Copy link

ahh thanks @Shell32-Natsu ! is there a way I can test (or check online) the version of kustomize?

@Shell32-Natsu
Copy link
Contributor

For standalone kustomize you can use kustomize version. Not sure how to get the kustomize version in kubectl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants