-
Notifications
You must be signed in to change notification settings - Fork 68
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
chore: Update to Kustomize v5 syntax #149
Merged
rafvasq
merged 3 commits into
kserve:main
from
KillianGolds:upstream-modelmesh-kustomize-manifests
Aug 16, 2024
Merged
chore: Update to Kustomize v5 syntax #149
rafvasq
merged 3 commits into
kserve:main
from
KillianGolds:upstream-modelmesh-kustomize-manifests
Aug 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Killian Golds <kgolds@redhat.com>
Signed-off-by: Killian Golds <kgolds@redhat.com>
…luded in build to ensure its targeting the correct field. Signed-off-by: Killian Golds <kgolds@redhat.com>
KillianGolds
force-pushed
the
upstream-modelmesh-kustomize-manifests
branch
from
July 25, 2024 15:55
c9acc6b
to
d8e0e2e
Compare
KillianGolds
changed the title
Updated deprecated manifest labels for kustomize v5 upgrade.
Updating outdated Kustomize syntax to be in line with Kustomize v5 syntax
Aug 13, 2024
terrytangyuan
approved these changes
Aug 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
spolti
approved these changes
Aug 14, 2024
/lgtm |
rafvasq
approved these changes
Aug 16, 2024
rafvasq
changed the title
Updating outdated Kustomize syntax to be in line with Kustomize v5 syntax
chore: Update to Kustomize v5 syntax
Aug 16, 2024
openshift-merge-bot bot
pushed a commit
to opendatahub-io/modelmesh
that referenced
this pull request
Aug 22, 2024
### Motivation The main motivation for this update is to keep our manifests up to date with Kustomize v5. This ensures that we are using the latest syntax, which improves the compatibility and maintainability of our Kubernetes configurations. ### Modifications #### 1. Replacements Section: - Added a replacements section to dynamically change values in the deployment configuration. - Corrected the field path to ensure the replacement does not break when patches are used. - Specifically, it replaces the environment variable value in the model-mesh deployment with the service name. **Old Syntax:** ``` vars: - name: MM_SERVICE_NAME objref: kind: Service name: model-mesh apiVersion: v1 fieldref: fieldpath: metadata.name ``` **New Syntax:** ``` replacements: - source: kind: Service name: model-mesh fieldPath: metadata.name targets: - select: kind: Deployment name: model-mesh fieldPaths: - spec.template.spec.containers.0.env.[name=MM_SERVICE_NAME].value ``` #### 2. Patch Paths: - I updated the commented-out patches section to use the correct path syntax when they are needed. ``` # patches: # - path: patches/etcd.yaml # - path: patches/logger.yaml # - path: patches/tls.yaml # - path: patches/uds.yaml # - path: patches/max_msg_size.yaml # - path: patches/prometheus_metrics.yaml ``` ### How I Tested To ensure the correctness of these changes, the following steps were taken: 1. Ran the kustomize build command on the original manifests to produce the current state of the resources. 2. Updated to Kustomize v5 labels. 3. Ran the kustomize build command again on the updated manifests. 4. Compared the output of the kustomize build command from both the original and updated manifests. 5. Verified that there was no difference between the outputs. Gist of all kustomize build pre-changes and post-changes: https://gist.github.com/KillianGolds/522e22734d547a90e69a619498ab71ca ### Result These changes ensure that our Kustomize configuration is up to date with version 5. Everything works as it should, with no changes to functionality other than updated syntax and corrected field paths for replacements and patches. --------- Signed-off-by: Killian Golds <kgolds@redhat.com> Co-authored-by: Killian Golds <91667190+KillianGolds@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The main motivation for this update is to keep our manifests up to date with Kustomize v5. This ensures that we are using the latest syntax, which improves the compatibility and maintainability of our Kubernetes configurations.
Modifications
1. Replacements Section:
Old Syntax:
New Syntax:
2. Patch Paths:
How I Tested
To ensure the correctness of these changes, the following steps were taken:
Gist of all kustomize build pre-changes and post-changes: https://gist.github.com/KillianGolds/522e22734d547a90e69a619498ab71ca
Result
These changes ensure that our Kustomize configuration is up to date with version 5. Everything works as it should, with no changes to functionality other than updated syntax and corrected field paths for replacements and patches.