SlideShare a Scribd company logo
KUBERNETES +
DOCKER +
ELIXIR =
KUBERNETES CAN'T TERMINATE POD
FOR 22 DAYS
sudo systemctl restart docker
did nothing
ktl delete pod ... --force --grace-period=0
kept containers running behind the scenes
docker stop COINTAINER_ID
docker kill COINTAINER_ID
did not stop containers either. (Docker bug?)
NOT ENOUGH
RESOURCES?
TOP
CPU UTILIZATION IS LOW TOO
2019-08-19T01:27:19.462500954Z [ERROR] Failed to restore
container ... with containerd: error getting containerd
task for container: OCI runtime state failed: runc did not
terminate sucessfully: runtime/cgo: pthread_create
failed: Resource temporarily unavailablenSIGABRT: abort
MEASURE YOUR PIDS
# This probe is used once a while to check that container is ready to join the cluster
readinessProbe:
initialDelaySeconds: 40
periodSeconds: 15
timeoutSeconds: 30
failureThreshold: 6
exec:
command:
- /opt/talkinto_domain/bin/talkinto_domain
- ping
# This probe is used once a while to check that container is healthy
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 30
failureThreshold: 2
exec:
command:
- /opt/talkinto_domain/bin/talkinto_domain
- ping
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
$ ps -ef | awk '{ print $8 $9 $10; }' | sort | uniq -c
...
4845 [epmd]<defunct>
4840 [erl_child_setup]<defunct>
3 [ext4-rsv-conver]
7200 [inet_gethost]<defunct>
...
PID 1
USER PID PPID STAT COMMAND COMMAND
default 1 0 S beam.smp {beam.smp} /opt/imaginator/releases/0.4.13/imaginator.sh -Bd -SDio 100 -- ...
default 137 1 Z bash [bash]
default 144 1 Z epmd [epmd]
default 145 1 S epmd /usr/local/lib/erlang/erts-10.4.4/bin/epmd -daemon
default 149 1 S erl_child_setup erl_child_setup 1048576
default 268 0 S bash bash
default 273 268 R ps ps -o user,pid,ppid,stat,comm,args
@@ -70,6 +70,10 @@ ENV REPLACE_OS_VARS=true 
# Bash is required by Distillery
RUN apk add --update --no-cache bash
+ # Tini is used as the entrypoint to reap zombie processes.
+ # This is the same as using `docker run --init`.
+ RUN apk add --no-cache tini
+
@@ -85,6 +89,8 @@ WORKDIR /opt/${APPLICATION_NAME}
# Change user to "default" to limit runtime privileges
USER default
+ ENTRYPOINT ["/sbin/tini", "--"]
USER PID PPID STAT COMMAND
default 1 0 S /sbin/tini -- /bin/sh -c bin/${APPLICATION_NAME} foreground
default 6 1 S {beam.smp} /opt/talkinto_domain/releases/0.8.173/talkinto_domain.sh -Bd -SDio 100 -- ...
default 146 1 S /usr/local/lib/erlang/erts-10.4.4/bin/epmd -daemon
default 150 6 S erl_child_setup 1048576
default 259 150 S inet_gethost 4
default 260 259 S inet_gethost 4
default 261 259 S inet_gethost 4
default 262 259 S inet_gethost 4
default 10802 0 R ps -o user,pid,ppid,stat,args
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine
THANK YOU!
QUESTIONS?
ALEXEI SHOLIK
ANDREW DRYGA

More Related Content

PDF
37562259 top-consuming-process
PDF
nouka inventry manager
PDF
Docker 基本概念與指令操作
PDF
使用 CLI 管理 OpenStack 平台
PDF
Build your own private openstack cloud
PPTX
agri inventory - nouka data collector / yaoya data convertor
PDF
Docker tips & tricks
PDF
Docker command
37562259 top-consuming-process
nouka inventry manager
Docker 基本概念與指令操作
使用 CLI 管理 OpenStack 平台
Build your own private openstack cloud
agri inventory - nouka data collector / yaoya data convertor
Docker tips & tricks
Docker command

What's hot (20)

PDF
Gitosis on Mac OS X Server
PDF
Kubernetes Tutorial
PDF
PDF
Ansible, Simplicity, and the Zen of Python
PPTX
Comets notes
PDF
Docker導入手順
PDF
Ceph issue 해결 사례
PDF
ByPat博客出品Lvs+keepalived
PDF
R-House (LSRC)
PDF
Docker remote-api
PDF
Building and Testing Puppet with Docker
PDF
Odoo Online platform: architecture and challenges
PDF
Puppet User Group Presentation - 15 March 2012
PPTX
Awk primer and Bioawk
DOCX
Setup and run hadoop distrubution file system example 2.2
PDF
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
PPTX
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
PDF
Steam Learn: Composer
ODP
NUMOSS 4th Week - Commandline Tutorial
PDF
Puppet and Openshift
Gitosis on Mac OS X Server
Kubernetes Tutorial
Ansible, Simplicity, and the Zen of Python
Comets notes
Docker導入手順
Ceph issue 해결 사례
ByPat博客出品Lvs+keepalived
R-House (LSRC)
Docker remote-api
Building and Testing Puppet with Docker
Odoo Online platform: architecture and challenges
Puppet User Group Presentation - 15 March 2012
Awk primer and Bioawk
Setup and run hadoop distrubution file system example 2.2
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
Steam Learn: Composer
NUMOSS 4th Week - Commandline Tutorial
Puppet and Openshift
Ad

Similar to Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine (20)

PDF
From Monolith to Docker Distributed Applications
PDF
DeveloperWeek 2015: A Practical Introduction to Docker
PDF
Docker security
PDF
Containers for sysadmins
PDF
CoreOSによるDockerコンテナのクラスタリング
PDF
DCA. certificate slide Session 2
PPTX
PPTX
Docker Starter Pack
PDF
Использование Docker в CI / Александр Акбашев (HERE Technologies)
PDF
AtlasCamp 2015 Docker continuous integration training
PDF
PFIセミナー資料 H27.10.22
PDF
Docker Tutorial.pdf
PDF
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PDF
Challenges of container configuration
PDF
Docker for Deep Learning (Andrea Panizza)
PDF
Shifter: Containers in HPC Environments
PPTX
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
PDF
Docker Demo @ IuK Seminar
PDF
DCEU 18: Tips and Tricks of the Docker Captains
PDF
Kubernetes at Datadog the very hard way
From Monolith to Docker Distributed Applications
DeveloperWeek 2015: A Practical Introduction to Docker
Docker security
Containers for sysadmins
CoreOSによるDockerコンテナのクラスタリング
DCA. certificate slide Session 2
Docker Starter Pack
Использование Docker в CI / Александр Акбашев (HERE Technologies)
AtlasCamp 2015 Docker continuous integration training
PFIセミナー資料 H27.10.22
Docker Tutorial.pdf
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
Challenges of container configuration
Docker for Deep Learning (Andrea Panizza)
Shifter: Containers in HPC Environments
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Docker Demo @ IuK Seminar
DCEU 18: Tips and Tricks of the Docker Captains
Kubernetes at Datadog the very hard way
Ad

More from Elixir Club (20)

PDF
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
PDF
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
PDF
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
PDF
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
PDF
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
PDF
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
PDF
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...
PDF
Promo Phx4RailsDevs - Volodya Sveredyuk
PDF
Web of today — Alexander Khokhlov
PDF
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
PDF
Implementing GraphQL API in Elixir – Victor Deryagin
PDF
WebPerformance: Why and How? – Stefan Wintermeyer
PDF
GenServer in Action – Yurii Bodarev
PDF
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
PDF
Practical Fault Tolerance in Elixir - Alexei Sholik
PDF
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
PDF
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
PDF
Craft effective API with GraphQL and Absinthe - Ihor Katkov
PDF
Elixir in a service of government - Alex Troush
PDF
Pattern matching in Elixir by example - Alexander Khokhlov
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club Ukraine
— An async template - Oleksandr Khokhlov | Elixir Club Ukraine
BEAM architecture handbook - Andrea Leopardi | Elixir Club Ukraine
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club Ukraine
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...
Promo Phx4RailsDevs - Volodya Sveredyuk
Web of today — Alexander Khokhlov
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
Implementing GraphQL API in Elixir – Victor Deryagin
WebPerformance: Why and How? – Stefan Wintermeyer
GenServer in Action – Yurii Bodarev
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Practical Fault Tolerance in Elixir - Alexei Sholik
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
Craft effective API with GraphQL and Absinthe - Ihor Katkov
Elixir in a service of government - Alex Troush
Pattern matching in Elixir by example - Alexander Khokhlov

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Spectroscopy.pptx food analysis technology
Spectral efficient network and resource selection model in 5G networks
cloud_computing_Infrastucture_as_cloud_p
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine Learning_overview_presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
SOPHOS-XG Firewall Administrator PPT.pptx
TLE Review Electricity (Electricity).pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Accuracy of neural networks in brain wave diagnosis of schizophrenia
1. Introduction to Computer Programming.pptx
Group 1 Presentation -Planning and Decision Making .pptx
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Spectroscopy.pptx food analysis technology

Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club Ukraine

  • 2. KUBERNETES CAN'T TERMINATE POD FOR 22 DAYS
  • 3. sudo systemctl restart docker did nothing
  • 4. ktl delete pod ... --force --grace-period=0 kept containers running behind the scenes
  • 5. docker stop COINTAINER_ID docker kill COINTAINER_ID did not stop containers either. (Docker bug?)
  • 7. TOP
  • 9. 2019-08-19T01:27:19.462500954Z [ERROR] Failed to restore container ... with containerd: error getting containerd task for container: OCI runtime state failed: runc did not terminate sucessfully: runtime/cgo: pthread_create failed: Resource temporarily unavailablenSIGABRT: abort
  • 11. # This probe is used once a while to check that container is ready to join the cluster readinessProbe: initialDelaySeconds: 40 periodSeconds: 15 timeoutSeconds: 30 failureThreshold: 6 exec: command: - /opt/talkinto_domain/bin/talkinto_domain - ping # This probe is used once a while to check that container is healthy livenessProbe: initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 30 failureThreshold: 2 exec: command: - /opt/talkinto_domain/bin/talkinto_domain - ping
  • 13. $ ps -ef | awk '{ print $8 $9 $10; }' | sort | uniq -c ... 4845 [epmd]<defunct> 4840 [erl_child_setup]<defunct> 3 [ext4-rsv-conver] 7200 [inet_gethost]<defunct> ...
  • 14. PID 1 USER PID PPID STAT COMMAND COMMAND default 1 0 S beam.smp {beam.smp} /opt/imaginator/releases/0.4.13/imaginator.sh -Bd -SDio 100 -- ... default 137 1 Z bash [bash] default 144 1 Z epmd [epmd] default 145 1 S epmd /usr/local/lib/erlang/erts-10.4.4/bin/epmd -daemon default 149 1 S erl_child_setup erl_child_setup 1048576 default 268 0 S bash bash default 273 268 R ps ps -o user,pid,ppid,stat,comm,args
  • 15. @@ -70,6 +70,10 @@ ENV REPLACE_OS_VARS=true # Bash is required by Distillery RUN apk add --update --no-cache bash + # Tini is used as the entrypoint to reap zombie processes. + # This is the same as using `docker run --init`. + RUN apk add --no-cache tini + @@ -85,6 +89,8 @@ WORKDIR /opt/${APPLICATION_NAME} # Change user to "default" to limit runtime privileges USER default + ENTRYPOINT ["/sbin/tini", "--"]
  • 16. USER PID PPID STAT COMMAND default 1 0 S /sbin/tini -- /bin/sh -c bin/${APPLICATION_NAME} foreground default 6 1 S {beam.smp} /opt/talkinto_domain/releases/0.8.173/talkinto_domain.sh -Bd -SDio 100 -- ... default 146 1 S /usr/local/lib/erlang/erts-10.4.4/bin/epmd -daemon default 150 6 S erl_child_setup 1048576 default 259 150 S inet_gethost 4 default 260 259 S inet_gethost 4 default 261 259 S inet_gethost 4 default 262 259 S inet_gethost 4 default 10802 0 R ps -o user,pid,ppid,stat,args