Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers...

27
Container tracing: challenges and mechanisms Progress Report Meeting December 7, 2017 Lo¨ ıc Gelle Michel Dagenais DORSAL Lab ´ Ecole polytechnique de Montr´ eal

Transcript of Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers...

Page 1: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

Container tracing:

challenges and mechanisms

Progress Report MeetingDecember 7, 2017

Loıc Gelle Michel Dagenais

DORSAL LabEcole polytechnique de Montreal

Page 2: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Context

• Containers tend to partially replace virtualmachines

• Runtime level: Docker, LXC

• Orchestration level: Kubernetes, AmazonECS, Docker Swarm

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 2/10

Page 3: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Context

• Containers tend to partially replace virtualmachines

• Runtime level: Docker, LXC

• Orchestration level: Kubernetes, AmazonECS, Docker Swarm

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 2/10

Page 4: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Context

• Containers tend to partially replace virtualmachines

• Runtime level: Docker, LXC

• Orchestration level: Kubernetes, AmazonECS, Docker Swarm

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 2/10

Page 5: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Container analysis landscape

Monitoring at the cluster level by querying

Kubernetes cluster monitoring with Grafana and Prometheus

Source: blog.lwolf.org

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 3/10

Page 6: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Container analysis landscape

Monitoring at the cluster level by querying

Kubernetes node monitoring with Grafana and Prometheus

Source: blog.lwolf.org

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 4/10

Page 7: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Container analysis landscape

Monitoring at the host level by sampling

System containers monitoring with Sysdig and its UI Csysdig

Source: sysdig.org

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 5/10

Page 8: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 9: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 10: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 11: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 12: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 13: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 14: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Containers are not lightweight virtual machines

Handy shortcut to view containers as lightweight virtualmachines...

• Similar isolation features from a user level

• Can be easily deployed, backed up, frozen or migrated

...yet their architecture is very different:

• A container shares the same OS kernel as the rest of thesystem

• A process running in a container is handled just as any otherprocess in the system

• Containers are basically a combination of two Linux kernelfeatures: control groups and namespaces

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 6/10

Page 15: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Linux cgroups and namespaces

• cgroups: Allows to account for or limit resources (cpu,memory, ...) usage for user-defined sets of processes→ how much I can use

• namespaces: Allows to isolate resources (PIDs, filesystems,...) for user-defined sets of processes→ what I can use / see

Running a container is about running normal processes thatbelong to given cgroups and namespaces...

... which has the ability to isolate these processes and limittheir resource consumption.

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 7/10

Page 16: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Linux cgroups and namespaces

• cgroups: Allows to account for or limit resources (cpu,memory, ...) usage for user-defined sets of processes→ how much I can use

• namespaces: Allows to isolate resources (PIDs, filesystems,...) for user-defined sets of processes→ what I can use / see

Running a container is about running normal processes thatbelong to given cgroups and namespaces...

... which has the ability to isolate these processes and limittheir resource consumption.

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 7/10

Page 17: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Linux cgroups and namespaces

• cgroups: Allows to account for or limit resources (cpu,memory, ...) usage for user-defined sets of processes→ how much I can use

• namespaces: Allows to isolate resources (PIDs, filesystems,...) for user-defined sets of processes→ what I can use / see

Running a container is about running normal processes thatbelong to given cgroups and namespaces...

... which has the ability to isolate these processes and limittheir resource consumption.

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 7/10

Page 18: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Linux cgroups and namespaces

• cgroups: Allows to account for or limit resources (cpu,memory, ...) usage for user-defined sets of processes→ how much I can use

• namespaces: Allows to isolate resources (PIDs, filesystems,...) for user-defined sets of processes→ what I can use / see

Running a container is about running normal processes thatbelong to given cgroups and namespaces...

... which has the ability to isolate these processes and limittheir resource consumption.

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 7/10

Page 19: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Project roadmap

• Instrument the kernel to get cgroups andnamespaces trace information (ongoing!)

• Use this information to buildcontainer-specific views of a system

• Design useful analyses for containers atthe runtime level

• Scale up to the orchestration level

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 8/10

Page 20: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Project roadmap

• Instrument the kernel to get cgroups andnamespaces trace information (ongoing!)

• Use this information to buildcontainer-specific views of a system

• Design useful analyses for containers atthe runtime level

• Scale up to the orchestration level

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 8/10

Page 21: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Project roadmap

• Instrument the kernel to get cgroups andnamespaces trace information (ongoing!)

• Use this information to buildcontainer-specific views of a system

• Design useful analyses for containers atthe runtime level

• Scale up to the orchestration level

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 8/10

Page 22: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Project roadmap

• Instrument the kernel to get cgroups andnamespaces trace information (ongoing!)

• Use this information to buildcontainer-specific views of a system

• Design useful analyses for containers atthe runtime level

• Scale up to the orchestration level

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 8/10

Page 23: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Analyses ideas

• Understand why a process in a container is being throttledback (cgroup limitations or system overload?)

• Understand why access to some resources from a containerfail (namespace isolation?)

• ”What if”-like analysis: what if I change my containerresources? What impact on the critical path length?

Suggestions and use cases are welcome throughout the project!

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 9/10

Page 24: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Analyses ideas

• Understand why a process in a container is being throttledback (cgroup limitations or system overload?)

• Understand why access to some resources from a containerfail (namespace isolation?)

• ”What if”-like analysis: what if I change my containerresources? What impact on the critical path length?

Suggestions and use cases are welcome throughout the project!

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 9/10

Page 25: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Analyses ideas

• Understand why a process in a container is being throttledback (cgroup limitations or system overload?)

• Understand why access to some resources from a containerfail (namespace isolation?)

• ”What if”-like analysis: what if I change my containerresources? What impact on the critical path length?

Suggestions and use cases are welcome throughout the project!

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 9/10

Page 26: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Analyses ideas

• Understand why a process in a container is being throttledback (cgroup limitations or system overload?)

• Understand why access to some resources from a containerfail (namespace isolation?)

• ”What if”-like analysis: what if I change my containerresources? What impact on the critical path length?

Suggestions and use cases are welcome throughout the project!

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 9/10

Page 27: Container tracing: challenges and mechanisms · DORSAL - Container tracing IntroductionContainers mechanismFuture work Container analysis landscape Monitoring at the host level by

DORSAL - Container tracing Introduction Containers mechanism Future work

Thank you!

Questions?

[email protected]

Progress Report Meeting – December 2017 – Loıc Gelle, Michel Dagenais 10/10