-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Provide detailed pod status when listing services #1380
Conversation
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.
I like this approach of just looking at the conditions on the controller -- thank you for taking my comments on the prior PR into account.
Three requested changes:
- please either explain, or revise, the code that compiles errors from the conditions (I've expended on this in the comments)
- the errors, or their replacement, need to be represented in the API response
- daemonsets etc., should get the same treatment as deployments.
api/v6/api.go
Outdated
@@ -34,6 +35,7 @@ type ControllerStatus struct { | |||
Containers []Container | |||
ReadOnly ReadOnlyReason | |||
Status string | |||
Pods cluster.Pods |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -120,27 +122,50 @@ func (dk *deploymentKind) getPodControllers(c *Cluster, namespace string) ([]pod | |||
return podControllers, nil | |||
} | |||
|
|||
func deploymentErrors(d *apiapps.Deployment) []string { | |||
var errs []string | |||
for _, cond := range d.Status.Conditions { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
cluster/kubernetes/resourcekinds.go
Outdated
} | ||
|
||
return podController{ | ||
apiVersion: "apps/v1", | ||
kind: "DaemonSet", | ||
name: daemonSet.ObjectMeta.Name, | ||
status: status, | ||
pods: pods, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
StatefulSet Status is missing UpdatedReplicas field: kubernetes/kubernetes#52653 |
5eb5a34
to
c375d49
Compare
added comment
moved
I wasn't able to find a way to get errors from |
558a66a
to
858efbb
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.
The additional code looks good to me ✔️ Thanks Elena 🔆
Before you merge it, I would appreciate an explanation (as comments in the code) of why the interpretation for Deployments is correct, and why conditions aren't used elsewhere; and, documentation on how to use the RolloutStatus value in the API (including what to do if it's empty).
Available int32 | ||
// Outdated number of pods that are on a different pod spec. | ||
Outdated int32 | ||
// Messages about unexpected rollout progress |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
cluster/cluster.go
Outdated
@@ -21,6 +21,23 @@ type Cluster interface { | |||
PublicSSHKey(regenerate bool) (ssh.PublicKey, error) | |||
} | |||
|
|||
// RolloutStatus describes numbers of pods in a different states and |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
cluster/kubernetes/resourcekinds.go
Outdated
updated, wanted := daemonSetStatus.UpdatedNumberScheduled, daemonSetStatus.DesiredNumberScheduled | ||
if updated == wanted { | ||
status = StatusUpdating | ||
if rollout.Ready == rollout.Desired && rollout.Available == rollout.Desired && rollout.Outdated == 0 { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
14440db
to
c40b751
Compare
// - in progress: Updated, Ready or Available numbers are not equal to Desired, or Outdated not equal to 0 | ||
// - stuck: Messages contains info if deploynemt unavailable or exceeded its progress deadline | ||
// - complete: Updated, Ready and Available numbers are equal to Desired and Outdateds equal to 0 | ||
// See https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#deployment-status |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
// Deployment may get stuck trying to deploy its newest ReplicaSet without ever completing. | ||
// One way to detect this condition is to specify a deadline parameter in Deployment spec: | ||
// .spec.progressDeadlineSeconds | ||
// See https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#failed-deployment |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
For deployments, daemonSet, statefulSet provide: - status of rollout - numbers of desired, updated, ready, available, outdated pods - slice of errors for controller (for now only for deployment) Fixes #1303
c40b751
to
df28361
Compare
For deployments, daemonSet, statefulSet provide:
Fixes #1303