mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[Feature] Pod Scheduled condition (#1152)
This commit is contained in:
parent
7e9b97d460
commit
1adbf38965
5 changed files with 19 additions and 6 deletions
|
@ -14,6 +14,7 @@
|
|||
- (Bugfix) Fix Go routine leak
|
||||
- (Feature) Extend Pod Security context
|
||||
- (Improvement) Update DeploymentReplicationStatus on configuration error
|
||||
- (Feature) Pod Scheduled condition
|
||||
|
||||
## [1.2.19](https://github.com/arangodb/kube-arangodb/tree/1.2.19) (2022-10-05)
|
||||
- (Bugfix) Prevent changes when UID is wrong
|
||||
|
|
|
@ -41,6 +41,8 @@ const (
|
|||
ConditionTypeStarted ConditionType = "Started"
|
||||
// ConditionTypeReachable indicates that the member is reachable.
|
||||
ConditionTypeReachable ConditionType = "Reachable"
|
||||
// ConditionTypeScheduled indicates that the member primary pod is scheduled.
|
||||
ConditionTypeScheduled ConditionType = "Scheduled"
|
||||
// ConditionTypeServing indicates that the member core services are running.
|
||||
ConditionTypeServing ConditionType = "Serving"
|
||||
// ConditionTypeActive indicates that the member server container started.
|
||||
|
|
|
@ -41,6 +41,8 @@ const (
|
|||
ConditionTypeStarted ConditionType = "Started"
|
||||
// ConditionTypeReachable indicates that the member is reachable.
|
||||
ConditionTypeReachable ConditionType = "Reachable"
|
||||
// ConditionTypeScheduled indicates that the member primary pod is scheduled.
|
||||
ConditionTypeScheduled ConditionType = "Scheduled"
|
||||
// ConditionTypeServing indicates that the member core services are running.
|
||||
ConditionTypeServing ConditionType = "Serving"
|
||||
// ConditionTypeActive indicates that the member server container started.
|
||||
|
|
|
@ -84,6 +84,7 @@ func removeMemberConditionsMapFunc(m *api.MemberStatus) {
|
|||
m.Conditions.Remove(api.ConditionTypeReady)
|
||||
m.Conditions.Remove(api.ConditionTypeActive)
|
||||
m.Conditions.Remove(api.ConditionTypeStarted)
|
||||
m.Conditions.Remove(api.ConditionTypeScheduled)
|
||||
m.Conditions.Remove(api.ConditionTypeReachable)
|
||||
m.Conditions.Remove(api.ConditionTypeServing)
|
||||
m.Conditions.Remove(api.ConditionTypeTerminated)
|
||||
|
|
|
@ -360,12 +360,19 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter
|
|||
}
|
||||
}
|
||||
|
||||
if k8sutil.IsPodNotScheduledFor(pod, podScheduleTimeout) {
|
||||
// Pod cannot be scheduled for to long
|
||||
log.Str("pod-name", pod.GetName()).Debug("Pod scheduling timeout")
|
||||
podNamesWithScheduleTimeout = append(podNamesWithScheduleTimeout, pod.GetName())
|
||||
} else if !k8sutil.IsPodScheduled(pod) {
|
||||
unscheduledPodNames = append(unscheduledPodNames, pod.GetName())
|
||||
if k8sutil.IsPodScheduled(pod) {
|
||||
if memberStatus.Conditions.Update(api.ConditionTypeScheduled, true, "Pod is scheduled", "") {
|
||||
updateMemberStatusNeeded = true
|
||||
nextInterval = nextInterval.ReduceTo(recheckSoonPodInspectorInterval)
|
||||
}
|
||||
} else {
|
||||
if k8sutil.IsPodNotScheduledFor(pod, podScheduleTimeout) {
|
||||
// Pod cannot be scheduled for to long
|
||||
log.Str("pod-name", pod.GetName()).Debug("Pod scheduling timeout")
|
||||
podNamesWithScheduleTimeout = append(podNamesWithScheduleTimeout, pod.GetName())
|
||||
} else {
|
||||
unscheduledPodNames = append(unscheduledPodNames, pod.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
if k8sutil.IsPodMarkedForDeletion(pod) {
|
||||
|
|
Loading…
Reference in a new issue