docker - create a "Best-effort" pod and its oom score not 1000 but -999 -
create deployment below:
apiversion: extensions/v1beta1 kind: deployment metadata: labels: owt: hello pdl: com app: world idc: xg add: parameters-48 name: parameters-48 spec: replicas: 2 template: metadata: labels: name: parameters-48 spec: containers: - name: mofang-web image: registry.cc.com/online/mofang:stable nodeselector: node:cc
login node found container's pid, check oom score:
cat /proc/21606/oom_adj -16 cat /proc/21606/oom_score 0 cat /proc/21606/oom_score_adj -999
according user guide page: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-qos.md, pod should "best-effort" pod, oom_score_adj not 1000 -999. way -999 means won't oom killed.
following issue, it's maybe worth summarize how find correct container pid / proc pod:
run application:
$ kubectl run bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1
find containerid:
$ kubectl pods --output=jsonpath='{.items[*].status.containerstatuses[*].containerid}' docker://59f127d641cef9475309cbf4b5fc2e4a65f3e52a0e08112dccbc2c144a0e366f
find related host / node:
$ kubectl pods --output=jsonpath='{.items[*].status.hostip}' 192.168.99.100
both found with:
$ kubectl describe pod <podid>
connect node via ssh, run:
$ docker inspect 59f127d641cef9475309cbf4b5fc2e4a65f3e52a0e08112dccbc2c144a0e366f | grep pid\": "pid": 18052, $ cat /proc/18052/oom_* 15 1000 1000
hope helps else @ point
Comments
Post a Comment