-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
kubectl apply -k
vs kustomize build
"env" and "envs" error
#2205
Comments
/help |
@tamipangadil: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
/bug |
Seems like this may be a backwards compatibility issue with the 2 version of kubectl |
The same thing happens with other commands such base.. How can we find documentation in regards to compatibility between |
I didn’t rely on kubectl anymore to have a fix the differences. I just run
‘kustomize build . | kubectl apply -f -‘ whenever I want to deploy.
…On Sat, 28 Mar 2020 at 21:57, Marián Hlaváč ***@***.***> wrote:
Had similar error message, it seems that there might be some kind of issue
with YAML parsing.
I had this in my kustomization.yaml:
secretGenerator:
- name: platform
env: secrets/platform.env
- name: database
env: secrets/database.env
Which resulted in correctly processed through kubectl apply -k ..., but
failed when ran kustomize build ... on
Error: accumulating resources: couldn't make target for path
'.../platform/spec/base': json: unknown field "env".
After changing the contents of the file to (notice the indentation):
secretGenerator:
- name: platform
env: secrets/platform.env
- name: database
env: secrets/database.env
it goes through without a problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ727EJJF6YRILBBDTBZXLRJZXC7ANCNFSM4KWUIOBA>
.
|
So, what is the proposed solution here?
I think it makes sense to fix |
To the maintainers... I really don't know what the desired state is, but kubectl and kustomize differ:
Can we easily see which kustomize module is part of kubectl? Why don't we finalize v1 of the kustomize spec (still v1beta1) if we are already advertising the use of kustomize in normal Kubernetes kubectl operations? I can find this: https://github.com/kubernetes/kubectl/blob/master/go.mod#L46 which shows that kubectl is still using 2.0.3 of kustomize. Seems very old! |
The latest kustomize version that understands "env" in configMapGenerator is 3.2.3 |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Please take a look at this issue for the reason that latest kustomize cannot be shipped with kubectl. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
this is still broken... |
@zoltantarcsay: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
@zoltantarcsay Please see #1500 and #2506 |
thanks! |
Still an issue. Looks like ppl keep creating issue after issue but the issue never gets addressed.
|
It's interesting that kustomize v3.0.0 and v3.5.4 seem to autocorrect the |
I'm just gonna revert my kustomize version and pretend this never happened. |
I still have problem on kubectl # check kubectl version
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.16", GitCommit:"e37e4ab4cc8dcda84f1344dda47a97bb1927d074", GitTreeState:"clean", BuildDate:"2021-10-27T16:25:59Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0", GitCommit:"e19964183377d0ec2052d1f1fa930c4d7575bd50", GitTreeState:"clean", BuildDate:"2020-08-26T14:23:04Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
# use kubectl kustomize will get error
$ kubectl kustomize .
Error: json: unknown field "envs"
# use kubectl apply -k will get error, too.
$ kubectl apply -k .
error: json: unknown field "envs"
# install kustomize
$ curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
$ sudo mv kustomize /usr/local/bin
# check kustomize version
$ kustomize version
{Version:kustomize/v4.5.7 GitCommit:56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 BuildDate:2022-08-02T16:35:54Z GoOs:linux GoArch:amd64}
# use kustomize build to know envs and use kubectl apply to execute (apply)
$ kustomize build . | kubectl apply -f -
# use kustomize build to know envs and use kubectl delete to execute (delete)
$ kustomize build . | kubectl delete --ignore-not-found=true -f -
|
Hi,
I'm trying to simplify the structures of my yaml files. I segregated the common configs and secrets so I can re-use it into my deployment manifests.
I used:
Then I ran:
After changing it from
envs
toenv
then ran:The text was updated successfully, but these errors were encountered: