-
Notifications
You must be signed in to change notification settings - Fork 160
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: Write pod cost to CRD #1134
Conversation
f5316fe
to
8702984
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 good so far
rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesApiImpl.scala
Outdated
Show resolved
Hide resolved
rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesApiImpl.scala
Show resolved
Hide resolved
rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesApiImpl.scala
Show resolved
Hide resolved
rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesApiImpl.scala
Outdated
Show resolved
Hide resolved
|
||
log.debug("kubernetes access namespace: {}. Secure: {}", namespace, settings.secure) | ||
|
||
override def updatePodDeletionCostAnnotation(podName: String, cost: Int): Future[Done] = { |
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 was "moved" from previous ApiRequests and PodDeletionCostAnnotator actor
|
||
201 Created if it works | ||
*/ | ||
override def readOrCreatePodCostResource(crName: String): Future[PodCostResource] = { |
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.
These methods for reading and updating the CR are based on the corresponding in the lease module.
rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesApiImpl.scala
Outdated
Show resolved
Hide resolved
2cb3d9b
to
5984b10
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.
LGTM (but CI unhappy about some formatting and rolling upgrade integration test is failing)
if (normalized.length > 63) | ||
throw new IllegalArgumentException(s"Too long resource name [$normalized]. At most 63 characters is accepted. " + | ||
"A custom resource name can be defined in configuration `akka.rollingupdate.kubernetes.custom-resource.cr-name`.") | ||
trim(normalized, List('-')) |
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.
👍
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
ab6a742
to
ca164ed
Compare
* alternative to adding the Kubernetes annotation directly to the pod resource in case allowing PATCH verb is a security concern * a separate Kubernetes operator with more privilages would watch the CR and update the pod resource with the annotation
8656cb7
to
7800157
Compare
TODO: