Skip to content

Instantly share code, notes, and snippets.

View bronger's full-sized avatar

Torsten Bronger bronger

  • Research Centre Jülich
  • Aachen
View GitHub Profile
#!/usr/bin/env python3
import subprocess, json, argparse
parser = argparse.ArgumentParser(description="Show all Kubernetes objects without limits.")
parser.add_argument("--namespace", metavar="NAMESPACE", help="namespace to look at (default: all namespaces)")
parser.add_argument("--context", help="context to use (default: current context)")
args = parser.parse_args()
extra_options = []
@bronger
bronger / signal_propagation.sh
Last active September 4, 2024 21:40
Propagate signals to shell scripts to their child processes.
# Inspired by <https://unix.stackexchange.com/a/444676/78728>.
#
# Current revision can be found at
# https://gist.github.com/bronger/acce7736141b3fa118b0d47f1a2035ac
#
# Makes a my_long_running_process interruptable by a SIGINT or SIGTERM which
# the shell receive. In this case, TERM is sent to the child process. (This
# can be changed, see below.)
#
# Note that this only works for child processes which never return exit codes
FROM ubuntu
LABEL maintainer="Torsten Bronger <[email protected]>"
ARG TERM=linux
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
apache2 \
build-essential \
/var/lib/kubelet/
/var/lib/kubelet/pods
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/volumes
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/volumes/kubernetes.io~secret
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/volumes/kubernetes.io~secret/clusterinfo
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/volumes/kubernetes.io~secret/default-token-kep48
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/plugins
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/plugins/kubernetes.io~empty-dir
/var/lib/kubelet/pods/7b76d0ef-afbb-11e6-b2e7-005056be54be/plugins/kubernetes.io~empty-dir/wrapped_clusterinfo
$ DEBUG=1 kubectl exec -ti single-container-pod bash
2015/10/15 18:22:38 (0xc208199680) (0xc208199720) Create stream
2015/10/15 18:22:38 (0xc208199680) (0xc208199720) Stream added, broadcasting: 1
2015/10/15 18:22:38 (0xc208199680) Reply frame received for 1
2015/10/15 18:22:38 (0xc208199680) (0xc208198dc0) Create stream
2015/10/15 18:22:38 (0xc208199680) (0xc208198dc0) Stream added, broadcasting: 3
2015/10/15 18:22:38 (0xc208199680) Reply frame received for 3
2015/10/15 18:22:38 (0xc208199680) (0xc20807bc20) Create stream
2015/10/15 18:22:38 (0xc208199680) (0xc20807bc20) Stream added, broadcasting: 5
2015/10/15 18:22:38 (0xc208199680) Reply frame received for 5
#!/bin/bash
export MEMCACHED_SERVERS=`host memcached | awk '/has address/ { print $NF":11211" }'`
. /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND
## -*- docker-image-name: "Dockerfile" -*-
FROM debian:jessie
MAINTAINER Torsten Bronger <bronger@xxx>
RUN apt-get update && apt-get install -y \
apache2-mpm-prefork \
fonts-dejavu-extra \
ghostscript \
Name: jb-plus--prod--d9e7f3ff-dtdft
Namespace: default
Image(s): us.gcr.io/xxx/jb-plus:d9e7f3ff
Node: gke-cluster-1-xxx-node-4kow/10.240.0.4
Start Time: Thu, 15 Oct 2015 17:58:04 +0200
Labels: app=jb-plus,build-id=d9e7f3ff,deployment=6b50a554f342fbc3efe431957ac632d4,environment=prod
Status: Running
Reason:
Message:
IP: 10.112.2.15
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.16.0-0.bpo.4-amd64 ([email protected]) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.16.7-ckt11-1+deb8u2~bpo70+1 (2015-07-
22)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-0.bpo.4-amd64 root=UUID=3e07d02c-c373-4daf-ac26-d29550f95545 ro console=ttyS0,38400n8 cgroup_enable=memory console
=ttyS0
[ 0.000000] Disabled fast string operations
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
torsten_bronger@gke-cluster-1-ca9b7482-node-z2o3:~$ cat /proc/`pidof docker`/status
Name: docker
State: S (sleeping)
Tgid: 4045
Ngid: 0
Pid: 4045
PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0