-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat: hgctl install profile support resource configuration #823
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #823 +/- ##
==========================================
+ Coverage 38.04% 38.10% +0.06%
==========================================
Files 61 61
Lines 10428 10428
==========================================
+ Hits 3967 3974 +7
+ Misses 6161 6154 -7
Partials 300 300 |
pkg/cmd/hgctl/helm/profile.go
Outdated
return "", err | ||
} | ||
|
||
err = yaml.Unmarshal(resourceYAML, &p.Values) |
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.
这里有些问题:这里会覆盖 Values 相关Resource设置, 要保证相同设置 Values里值高优先。用util.OverlayYAML 合并。
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.
这里外层的配置覆盖values里的值是否也合理?
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.
已修复,当在profile的value字段进行如下配置的时候,通过debug发现valueOverlayYAML结果符合预期。
- profile value配置:
values:
higress-core:
controller:
resources:
requests:
cpu: 1213m
memory: 2018Mi
limits:
cpu: 1213m
memory: 2018Mi
- valueOverlayYAML结果:
higress-console:
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 250m
memory: 512Mi
higress-core:
controller:
resources:
limits:
cpu: 1213m
memory: 2018Mi
requests:
cpu: 1213m
memory: 2018Mi
gateway:
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 2000m
memory: 2048Mi
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.
这里外层的配置覆盖values里的值是否也合理?
这里主要考虑到和helm 安装兼容,所以values 优先级高
LGTM |
Ⅰ. Describe what this PR did
支持resources配置
Ⅱ. Does this pull request fix one issue?
fixes: #571
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
运行hgctl install --set profile=k8s命令,可以看到deploy yaml文件多了resource配置
Ⅴ. Special notes for reviews