-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter pods where the Akka container has 'waiting' status (#891)
* Filter pods where the Akka container has 'waiting' status We wait until pods become 'Running', but when using pods with multiple containers, the pod becomes 'Running' as soon as the first primary container starts. https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ In that case, when the Akka container fails to start, it also prevents other pods (where the issue might be resolved) from starting. For that reason, allow configuring which container is the Akka container, so we can ignore it from discovery when it is 'waiting'. Refs #890 * scalafmt * mima exclusions
- Loading branch information
Showing
9 changed files
with
361 additions
and
24 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ry-kubernetes-api/src/main/mima-filters/1.0.10.backwards.excludes/ignore-waiting.excludes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# private[kubernetes] | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.discovery.kubernetes.KubernetesApiServiceDiscovery.targets") | ||
ProblemFilters.exclude[Problem]("akka.discovery.kubernetes.PodList#*") | ||
ProblemFilters.exclude[Problem]("akka.discovery.kubernetes.PodList$*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
266 changes: 266 additions & 0 deletions
266
discovery-kubernetes-api/src/test/resources/multi-container-pod.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,266 @@ | ||
{ | ||
"kind": "PodList", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"selfLink": "/api/v1/namespaces/default/pods", | ||
"resourceVersion": "16042" | ||
}, | ||
"items": [ | ||
{ | ||
"metadata": { | ||
"annotations": { | ||
"cloudstate.io/enabled": "true", | ||
"cloudstate.io/stateful-service-config": "ss-cfg-mesh", | ||
"cloudstate.io/stateful-store": "default-spanner-store", | ||
"cluster-autoscaler.kubernetes.io/safe-to-evict": "true" | ||
}, | ||
"creationTimestamp": "2021-04-23T08:45:58Z", | ||
"generateName": "mesh-b4b946946-", | ||
"labels": { | ||
"app.kubernetes.io/component": "user-function", | ||
"app.kubernetes.io/managed-by": "cloudstate-operator", | ||
"app.kubernetes.io/name": "mesh", | ||
"cloudstate.io/stateful-service": "mesh", | ||
"pod-template-hash": "b4b946946" | ||
}, | ||
"name": "mesh-b4b946946-g8vfj", | ||
"namespace": "b58dbc88-3651-4fb4-8408-60c375592d1d", | ||
"ownerReferences": [ | ||
{ | ||
"apiVersion": "apps/v1", | ||
"blockOwnerDeletion": true, | ||
"controller": true, | ||
"kind": "ReplicaSet", | ||
"name": "mesh-b4b946946", | ||
"uid": "3bb114e8-8a07-449f-818b-d0fa959a8681" | ||
} | ||
], | ||
"resourceVersion": "68638988", | ||
"selfLink": "/api/v1/namespaces/b58dbc88-3651-4fb4-8408-60c375592d1d/pods/mesh-b4b946946-g8vfj", | ||
"uid": "2ecb33a7-bac6-4a0f-8717-c3ffde85ddd9" | ||
}, | ||
"spec": { | ||
"containers": [ | ||
{ | ||
"env": [ | ||
{ | ||
"name": "PORT", | ||
"value": "8080" | ||
} | ||
], | ||
"image": "docker.io/raboof/akkaserverless-wirelessmesh-java:349b1b7", | ||
"imagePullPolicy": "IfNotPresent", | ||
"name": "user-function", | ||
"ports": [ | ||
{ | ||
"containerPort": 8080, | ||
"name": "user-port", | ||
"protocol": "TCP" | ||
} | ||
], | ||
"resources": { | ||
"limits": { | ||
"memory": "512Mi" | ||
}, | ||
"requests": { | ||
"cpu": "400m", | ||
"memory": "512Mi" | ||
} | ||
}, | ||
"terminationMessagePath": "/dev/termination-log", | ||
"terminationMessagePolicy": "File" | ||
}, | ||
{ | ||
"imagePullPolicy": "IfNotPresent", | ||
"livenessProbe": { | ||
"failureThreshold": 5, | ||
"httpGet": { | ||
"path": "/alive", | ||
"port": 8558, | ||
"scheme": "HTTP" | ||
}, | ||
"periodSeconds": 10, | ||
"successThreshold": 1, | ||
"timeoutSeconds": 1 | ||
}, | ||
"name": "cloudstate-sidecar", | ||
"ports": [ | ||
{ | ||
"containerPort": 8013, | ||
"name": "grpc-http-proxy", | ||
"protocol": "TCP" | ||
}, | ||
{ | ||
"containerPort": 9090, | ||
"name": "cs-metrics", | ||
"protocol": "TCP" | ||
} | ||
], | ||
"readinessProbe": { | ||
"failureThreshold": 5, | ||
"httpGet": { | ||
"path": "/ready", | ||
"port": 8558, | ||
"scheme": "HTTP" | ||
}, | ||
"periodSeconds": 10, | ||
"successThreshold": 1, | ||
"timeoutSeconds": 1 | ||
}, | ||
"resources": { | ||
"limits": { | ||
"memory": "512Mi" | ||
}, | ||
"requests": { | ||
"cpu": "400m", | ||
"memory": "512Mi" | ||
} | ||
}, | ||
"terminationMessagePath": "/dev/termination-log", | ||
"terminationMessagePolicy": "File" | ||
}, | ||
{ | ||
"args": [ | ||
"proxy", | ||
"sidecar" | ||
], | ||
"name": "ppp-proxy", | ||
"readinessProbe": { | ||
"failureThreshold": 30, | ||
"httpGet": { | ||
"path": "/healthz/ready", | ||
"port": 15020, | ||
"scheme": "HTTP" | ||
}, | ||
"initialDelaySeconds": 1, | ||
"periodSeconds": 2, | ||
"successThreshold": 1, | ||
"timeoutSeconds": 1 | ||
}, | ||
"resources": { | ||
"limits": { | ||
"cpu": "2", | ||
"memory": "1Gi" | ||
}, | ||
"requests": { | ||
"cpu": "100m", | ||
"memory": "128Mi" | ||
} | ||
}, | ||
"securityContext": { | ||
"allowPrivilegeEscalation": false, | ||
"capabilities": { | ||
"drop": [ | ||
"ALL" | ||
] | ||
}, | ||
"privileged": false, | ||
"readOnlyRootFilesystem": true, | ||
"runAsNonRoot": true | ||
}, | ||
"terminationMessagePath": "/dev/termination-log", | ||
"terminationMessagePolicy": "File" | ||
} | ||
], | ||
"dnsPolicy": "ClusterFirst", | ||
"enableServiceLinks": true, | ||
"nodeName": "gke-dev-us-east-executio-default-pool-4678c5fa-mhx9", | ||
"priority": 0, | ||
"restartPolicy": "Always", | ||
"schedulerName": "default-scheduler", | ||
"securityContext": {}, | ||
"serviceAccount": "cloudstate-pod-service-account", | ||
"serviceAccountName": "cloudstate-pod-service-account", | ||
"terminationGracePeriodSeconds": 30 | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"lastProbeTime": null, | ||
"lastTransitionTime": "2021-04-23T08:46:00Z", | ||
"status": "True", | ||
"type": "Initialized" | ||
}, | ||
{ | ||
"lastProbeTime": null, | ||
"lastTransitionTime": "2021-04-23T08:45:58Z", | ||
"message": "containers with unready status: [cloudstate-sidecar]", | ||
"reason": "ContainersNotReady", | ||
"status": "False", | ||
"type": "Ready" | ||
}, | ||
{ | ||
"lastProbeTime": null, | ||
"lastTransitionTime": "2021-04-23T08:45:58Z", | ||
"message": "containers with unready status: [cloudstate-sidecar]", | ||
"reason": "ContainersNotReady", | ||
"status": "False", | ||
"type": "ContainersReady" | ||
}, | ||
{ | ||
"lastProbeTime": null, | ||
"lastTransitionTime": "2021-04-23T08:45:58Z", | ||
"status": "True", | ||
"type": "PodScheduled" | ||
} | ||
], | ||
"containerStatuses": [ | ||
{ | ||
"lastState": { | ||
"terminated": { | ||
"exitCode": 0, | ||
"finishedAt": "2021-04-23T12:41:11Z", | ||
"reason": "Completed", | ||
"startedAt": "2021-04-23T12:41:04Z" | ||
} | ||
}, | ||
"name": "cloudstate-sidecar", | ||
"ready": false, | ||
"restartCount": 50, | ||
"started": false, | ||
"state": { | ||
"waiting": { | ||
"message": "back-off 5m0s restarting failed container=cloudstate-sidecar pod=mesh-b4b946946-g8vfj_b58dbc88-3651-4fb4-8408-60c375592d1d(2ecb33a7-bac6-4a0f-8717-c3ffde85ddd9)", | ||
"reason": "CrashLoopBackOff" | ||
} | ||
} | ||
}, | ||
{ | ||
"lastState": {}, | ||
"name": "ppp-proxy", | ||
"ready": true, | ||
"restartCount": 0, | ||
"started": true, | ||
"state": { | ||
"running": { | ||
"startedAt": "2021-04-23T08:46:01Z" | ||
} | ||
} | ||
}, | ||
{ | ||
"lastState": {}, | ||
"name": "user-function", | ||
"ready": true, | ||
"restartCount": 0, | ||
"started": true, | ||
"state": { | ||
"running": { | ||
"startedAt": "2021-04-23T08:46:01Z" | ||
} | ||
} | ||
} | ||
], | ||
"hostIP": "10.14.0.85", | ||
"phase": "Running", | ||
"podIP": "10.8.7.9", | ||
"podIPs": [ | ||
{ | ||
"ip": "10.8.7.9" | ||
} | ||
], | ||
"qosClass": "Burstable", | ||
"startTime": "2021-04-23T08:45:58Z" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.