-
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
How to override images stanza from base in any overlay? #4581
Comments
@pentago: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The 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. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
I'm not quite sure what your setup is and how you want kustomize to behave differently. To the best of my understanding, your setup is:
apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
spec:
template:
spec:
containers:
- name: backend
image: BACKEND_IMAGE:8
- name: frontend
image: FRONTEND_IMAGE:1.7.9
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
images:
- name: BACKEND_IMAGE
newName: ghcr.io/user/backend
newTag: wwwwwww
- name: FRONTEND_IMAGE
newName: ghcr.io/user/frontend
newTag: xxxxxxx
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
images:
- name: BACKEND_IMAGE
newName: ghcr.io/user/backend
newTag: yyyyyyy
- name: FRONTEND_IMAGE
newName: ghcr.io/user/frontend
newTag: zzzzzzz for which I get the following output using kustomize v4.5.7 apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
spec:
template:
spec:
containers:
- image: ghcr.io/user/backend:wwwwwww
name: backend
- image: ghcr.io/user/frontend:xxxxxxx
name: frontend I believe this is the expected output because by the time you reference |
If you want kustomize to further modify the tags in
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
images:
- name: ghcr.io/user/backend
newTag: yyyyyyy
- name: ghcr.io/user/frontend
newTag: zzzzzzz and your output will be apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
spec:
template:
spec:
containers:
- image: ghcr.io/user/backend:yyyyyyy
name: backend
- image: ghcr.io/user/frontend:zzzzzzz
name: frontend If I'm misinterpreting your question, please provide more information including all inputs, expected output, and actual output. |
/kind support If @annasong20's response doesn't resolve your issue, please reopen with more details. |
/reopen |
@argarinpauljohn: 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. |
I've encountered the same problem. This time, the scenario is I'm creating an overlay for an overlay. Image stanza cannot be replaced unless it's not specified in the base overlay. |
@argarinpauljohn The behavior you're describing sounds identical to that seen in this issue, just 1 layer above. If so, I believe this is intended behavior rather than a bug. If my responses above don't help, I'd recommend asking in the Slack channel. If you believe the observed behavior wrong, please file a new bug with a comprehensive description and example. |
I'm figuring out a gitops workflow and want to know if it's possible to define a set of
images
in thebase
but to be able to override those images in any or all overlays, like this:base:
dev overlay:
Currently, it's possible to have different
images
stanzas in each overlay but it must not be present already in the base.Not sure why is that but wouldn’t it be useful to be able to override
images
stanza from the base in any overlay too?The text was updated successfully, but these errors were encountered: