-
Notifications
You must be signed in to change notification settings - Fork 327
plugin/k8s: Add StatusFunc to Deploy and Release #1547
Conversation
This commit implements reporting on a deploy status, and leaves the release implementation to a future commit. Some refactoring needs to be put in place to reduce code duplication across the Platform and Releaser components. This will be handled in the next commit
This commit moves some of the basic status report building funcs into a utils file so that they can be used by both the Platform and Releaser status funcs
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 looks good but I wonder if we might have a more release-oriented status in the future. Atm because a release uses a deployment, we're showing the same status twice. Not an issue for now, but we should dig into K8 more and figure out if there is some release/service specific status we could be showing.
@evanphx Agreed...was thinking the same thing after finishing this up! I thought about reporting on the Service itself that we release to, but it doesn't look like there's much the k8s api tells us about it compared to the pods themselves. |
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.
Looks good, one easy comment.
This commit adds some extra checks on the Pods condition when its phase is running to give us some extra detail about if the pod is actually ready, or just running and alive
result.Health = sdk.StatusReport_ALIVE | ||
result.HealthMessage = "all pods are reporting alive" | ||
} else { | ||
result.Health = sdk.StatusReport_PARTIAL |
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.
Question here: "PARTIAL" implies to me "Partially Ready". With this logic, if 4/5 are down and 1/5 is unknown, we'll get PARTIAL.
Just double-checking that we really want PARTIAL to mean any non-homogeneous set of underlying statuses.
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.
Ah, also just found this in the RFC: PARTIAL = 4; // Some resources in deployment are OK, others are not OK
This pull request introduces a status report forwarder for the k8s platform. It inspects the deployed Pods and its containers to determine the overall health of a deployment or release.
Relies on hashicorp/waypoint-plugin-sdk#32