简体   繁体   中英

See docker containers that are not in k8s

docker ps command give's a list of all containers running on machine.

Containers started by kubernetes, docker-compose or using docker commands.

docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS               NAMES
4522aaa65d4b        gcr.io/kube-addon-manager:v6.4-beta.1      "/opt/kube-addons.sh"    39 hours ago        Up 39 hours                             k8s_kube-addon-manager.....
88b141f545d3        gcr.io/pause-amd64:3.0                     "/pause"                 39 hours ago        Up 39 hours                             k8s_POD.....
fe39bcdf10c0        celery                                     "/usr/local/bin/celer"   39 hours ago        Up 39 hours                             celery_worker

I would like to see all containers that are not started by kubernetes.

docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS               NAMES
fe39bcdf10c0        celery                                     "/usr/local/bin/celer"   39 hours ago        Up 39 hours                             celery_worker

it's about as simple as docker ps | grep -v 'k8s_' docker ps | grep -v 'k8s_'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM