Skip to content

Instantly share code, notes, and snippets.

@rothgar
rothgar / gist:5bbebfbd4b9f8e56f72bb991eae2f093
Last active June 13, 2017 17:47
nginx ingress differences
docker run --rm -it gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.7 nginx -V
nginx version: nginx/1.13.0
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run
/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-p
ath=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_mod
ule --with-http_geoip_module --with-http_gzip_static_module --with-http_sub_module --with-http_v2_module --with-stream --with-stream_ssl_mo
@rothgar
rothgar / Dockerfile.caddy
Created February 10, 2017 05:55
debugging go containers
FROM scratch
ADD caddy /
EXPOSE 2015
CMD ['/caddy']
I have run an nginx container...
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg
I want to use strace for debug:
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin --cap-add sys_ptrace bash
I can see the nginx process:
@rothgar
rothgar / get-book.sh
Created February 3, 2017 17:40
Download Google SRE book for offline reading
#!/bin/bash
wget -r -nc -p --html-extension -k -D google.com -np https://landing.google.com/sre/book/
@rothgar
rothgar / coredns.yaml
Last active October 28, 2019 22:08
CoreDNS for Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
data:
Corefile: |
.:53 {
log stdout
health
@rothgar
rothgar / tmate-compile.sh
Created January 19, 2017 07:03
Compile tmate on centos 7
#!/bin/bash
set -e
yum install -y epel-release
yum makecache
yum install -y @development git cmake ruby zlib-devel openssl-devel libevent-devel ncurses-devel libssh-devel msgpack-devel
git clone https://github.com/nviennot/tmate.git
@rothgar
rothgar / kubeadm.sh
Last active January 21, 2017 04:19
kubeadm
#!/bin/bash
#from a fresh install of centos 7 (after running yum update and rebooting)
#run as root
set -e
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
systemctl disable --now firewalld
@rothgar
rothgar / microbot.ing.yaml
Created January 4, 2017 06:06
microbot ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: microbot-ingress
spec:
rules:
- host: microbot
http:
paths:
- path: /
@rothgar
rothgar / numa-maps-summary.pl
Created January 2, 2017 07:53
numa-maps-summary
#!/usr/bin/perl
# Copyright (c) 2010, Jeremy Cole <[email protected]>
# This program is free software; you can redistribute it and/or modify it
# under the terms of either: the GNU General Public License as published
# by the Free Software Foundation; or the Artistic License.
#
# See http://dev.perl.org/licenses/ for more information.
@rothgar
rothgar / Dockerfile
Created July 21, 2016 15:09
kubectl pod
FROM scratch
LABEL BUILD_CMD="docker build -t docker-registry:5000/kubernetes/kubectl:v1.3.0"
# Put your kubectl binary in the local folder
ADD kubectl /
ENTRYPOINT ["/kubectl"]