-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add ability to add annotations and labels to JobManager service #320
Add ability to add annotations and labels to JobManager service #320
Conversation
8e140a0
to
9dd6364
Compare
@regadas Hi, I know it's open-source project and I really appreciate your & team works on this project |
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.
Sorry for the late reply and Thanks for doing this!
9dd6364
to
7aa04ba
Compare
@@ -292,6 +292,7 @@ func newJobManagerService(flinkCluster *v1beta1.FlinkCluster) *corev1.Service { | |||
switch jobManagerSpec.AccessScope { | |||
case v1beta1.AccessScopeCluster: | |||
jobManagerService.Spec.Type = corev1.ServiceTypeClusterIP | |||
jobManagerService.Annotations = jobManagerSpec.ServiceAnnotations |
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.
We could set the annotations earlier right in L#276
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.
Done
@@ -195,6 +195,9 @@ type JobManagerSpec struct { | |||
// Currently `VPC, External` are only available for GKE. | |||
AccessScope string `json:"accessScope,omitempty"` | |||
|
|||
// _(Optional)_ Define JobManager Service annotations for configuration. | |||
ServiceAnnotations map[string]string `json:"ServiceAnnotations,omitempty"` |
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.
Could you add ServiceLabels
as well?
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.
Re this change, should I merge labels in this way:
var serviceLabels = mergeLabels(podLabels, jobManagerSpec.ServiceLabels, getRevisionHashLabels(&flinkCluster.Status.Revision))
Or should I exclusively define var.serviceLabels
to jobManagerSpec.ServiceLabels
?
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.
Or should I exclusively define var.serviceLabels to jobManagerSpec.ServiceLabels ?
Yeah, I think we should go with that and not inherit the pod labels
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.
We should still set the revision hash
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.
Done in 1bfa0f9
Had to remove few pre-defined lines from tests though
…efined & pre-defined for accessScope VPC
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 @Sudokamikaze for pushing this.
Issue ref: #319
Result of patch:
Image I built to test feature: https://hub.docker.com/repository/docker/sudokamikaze/flinktests built on latest master HEAD + my changes