-
Notifications
You must be signed in to change notification settings - Fork 527
[GEP-28] Static Pod Translator #11349
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
[GEP-28] Static Pod Translator #11349
Conversation
e4f015b
to
3fa2fb8
Compare
/assign |
3fa2fb8
to
8eb0835
Compare
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.
Thanks a lot for implementing this useful tool for autonomous clusters.
I have some concerns regarding the default access mode of secrets, though.
func translateVolumes(ctx context.Context, c client.Client, pod *corev1.Pod) ([]extensionsv1alpha1.File, error) { | ||
var ( | ||
files []extensionsv1alpha1.File | ||
addFileWithHostPath = func(hostPath, fileName, content string, permissions *int32, desiredItems []corev1.KeyToPath) { |
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.
Why not use an ordinary function instead of specifying it here in line? There is no variance. Hence, a static function call could be sufficient.
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.
This adds directly to the files
list if certain conditions are met. Making this a "regular" function outside would result in more complexity IMO. While I'm generally a fan of "regular" functions when applicable, I think here it's a benefit to define it this way.
/cc @timebertt |
8eb0835
to
0de8ecd
Compare
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.
Very nice PR!
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.
Thanks for addressing my suggestions :)
We'll need this to serialize Kubernetes objects to YAML for static pod manifests.
c6ac4f5
to
a2794d2
Compare
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.
Looks great!
LGTM label has been added. Git tree hash: 1b5191ea6c0110fc9a440be9b0a2c6b1a7cd0279
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: timebertt 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 |
/retest |
@rfranzke: The following test failed, say
Full PR test history. Your PR dashboard. Command help for this repository. 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-sigs/prow repository. I understand the commands that are listed here. |
How to categorize this PR?
/area ipcei
/kind enhancement
What this PR does / why we need it:
This PR adds a starting point for the static pod translator that we used in the PoC work when playing with autonomous shoot clusters. For now, it only supports
Deployment
s, but perhaps we have to augment it with support forStatefulSet
s as well (depending on how ETCD will be managed, still under discussion).Which issue(s) this PR fixes:
Part of #2906
Special notes for your reviewer:
/cc @ScheererJ
Release note: