-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Plumb revision annotations through to services and deployments #576
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,13 +50,16 @@ func MakeElaAutoscalerDeployment(u *v1alpha1.Revision) *v1beta1.Deployment { | |
|
|
||
| labels := MakeElaResourceLabels(u) | ||
| labels[ela.AutoscalerLabelKey] = controller.GetRevisionAutoscalerName(u) | ||
| annotations := MakeElaResourceAnnotations(u) | ||
| annotations[sidecarIstioInjectAnnotation] = "false" | ||
|
|
||
| replicas := int32(1) | ||
| return &v1beta1.Deployment{ | ||
| ObjectMeta: meta_v1.ObjectMeta{ | ||
| Name: controller.GetRevisionAutoscalerName(u), | ||
| Namespace: AutoscalerNamespace, | ||
| Labels: MakeElaResourceLabels(u), | ||
| Name: controller.GetRevisionAutoscalerName(u), | ||
| Namespace: AutoscalerNamespace, | ||
| Labels: MakeElaResourceLabels(u), | ||
| Annotations: MakeElaResourceAnnotations(u), | ||
| }, | ||
| Spec: v1beta1.DeploymentSpec{ | ||
| Replicas: &replicas, | ||
|
|
@@ -66,10 +69,8 @@ func MakeElaAutoscalerDeployment(u *v1alpha1.Revision) *v1beta1.Deployment { | |
| }, | ||
| Template: corev1.PodTemplateSpec{ | ||
| ObjectMeta: meta_v1.ObjectMeta{ | ||
| Labels: labels, | ||
| Annotations: map[string]string{ | ||
| "sidecar.istio.io/inject": "false", | ||
| }, | ||
| Labels: labels, | ||
| Annotations: annotations, | ||
| }, | ||
| Spec: corev1.PodSpec{ | ||
| Containers: []corev1.Container{ | ||
|
|
@@ -115,9 +116,10 @@ func MakeElaAutoscalerDeployment(u *v1alpha1.Revision) *v1beta1.Deployment { | |
| func MakeElaAutoscalerService(u *v1alpha1.Revision) *corev1.Service { | ||
| return &corev1.Service{ | ||
| ObjectMeta: meta_v1.ObjectMeta{ | ||
| Name: controller.GetRevisionAutoscalerName(u), | ||
| Namespace: AutoscalerNamespace, | ||
| Labels: MakeElaResourceLabels(u), | ||
| Name: controller.GetRevisionAutoscalerName(u), | ||
| Namespace: AutoscalerNamespace, | ||
| Labels: MakeElaResourceLabels(u), | ||
| Annotations: MakeElaResourceAnnotations(u), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pulls in the istio sidecar annotation as well, is that something that we want? Are there any side effects on this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Only if a RevisionTemplate's metadata has specified it. Is that your concern?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was just curious if this is what we want and if the istio sidecar goes in there, will it impact anything?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do some digging to confirm
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We confirmed that if the See the istio webhook config for evidence |
||
| }, | ||
| Spec: corev1.ServiceSpec{ | ||
| Ports: []corev1.ServicePort{ | ||
|
|
||
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.
Should we apply the custom annotations and labels to autoscaler pod or should we skip this part? autoscaler is a system component and it might be better to keep it hidden from the user and not copy labels and annotations that the user specified to it. What do you think?
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 chose to plumb the labels and annotations through to the autoscaler as well because we thought the intent was that the user can then target all services and pods that are created as part of creating a Configuration.