./configure --prefix=/data/nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_stub_status_module \
--with-http_slice_module \
--with-compat \
--with-file-aio \
--with-threads \
--with-stream \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ii="kube-apiserver:v1.16.2 kube-controller-manager:v1.16.2 kube-scheduler:v1.16.2 kube-proxy:v1.16.2 pause:3.1 etcd:3.3.15-0 coredns:1.6.2 metrics-server-amd64:v0.3.3" | |
| for i in $ii; do | |
| echo $i | |
| docker image pull gcr.azk8s.cn/google_containers/$i; | |
| docker image tag gcr.azk8s.cn/google_containers/$i k8s.gcr.io/$i; | |
| docker image rmi gcr.azk8s.cn/google_containers/$i; | |
| done | |
| docker image list |grep gcr | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package router | |
| import ( | |
| "net/http" | |
| "github.com/julienschmidt/httprouter" | |
| ) | |
| type middleware func(httprouter.Handle) httprouter.Handle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pods=$(kubectl get pod -lapp=checknetwork -o jsonpath='{.items[*].metadata.name}') \ | |
| && podips=$(kubectl get pod -lapp=checknetwork -o jsonpath='{.items[*].status.podIP}') | |
| for pod in $pods; do | |
| ip=$(kubectl get pod $pod -o jsonpath='{.status.podIP}') | |
| for podip in $podips; do | |
| if [ "$ip" == "$podip" ]; | |
| then | |
| continue; | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export COREDNS_PODIP=$(kubectl get pod -o jsonpath={.items[0].status.podIP} -l k8s-app=kube-dns -n kube-system) \ | |
| && kubectl run -it --rm --restart=Never --generator=run-pod/v1 \ | |
| --image=amouat/network-utils pod-$RANDOM \ | |
| --env="COREDNS_PODIP=$COREDNS_PODIP" \ | |
| -- /bin/sh -c 'sleep 3s; \ | |
| echo "################################################################" \ | |
| && cat /etc/resolv.conf \ | |
| && echo "################################################################" \ | |
| && ip a \ | |
| && echo "################################################################" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Caddy HTTP/2 web server | |
| Documentation=https://caddyserver.com/docs | |
| After=network-online.target | |
| Wants=network-online.target systemd-networkd-wait-online.service | |
| [Service] | |
| Restart=on-abnormal | |
| ; User and group the process will run as. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Criado em:Qua 02/Jun/2010 hs 09:18 | |
| # Last Change: Qua 02/Jun/2010 hs 09:18 | |
| # vim:ft=sh:fdm=syntax:nu: | |
| # Instituicao: none | |
| # Proposito do script: agilizar configurações de rede | |
| # Autor: Sérgio Luiz Araújo Silva | |
| # site: http://vivaotux.blogspot.com | |
| #net.core.rmem_max=8388608 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kernel.printk = 3 4 1 3 | |
| net.ipv4.tcp_syncookies = 1 | |
| net.ipv4.ip_forward = 1 | |
| net.ipv4.conf.all.arp_filter = 1 | |
| net.ipv4.conf.all.arp_ignore = 1 | |
| net.ipv4.ip_nonlocal_bind = 1 | |
| net.netfilter.nf_conntrack_max = 262144 | |
| net.netfilter.nf_conntrack_generic_timeout = 120 | |
| net.netfilter.nf_conntrack_tcp_timeout_close = 10 | |
| net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| NGINX_VERSION="1.6.0" | |
| NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz" | |
| PCRE_VERSION="8.34" | |
| PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz" | |
| OPENSSL_VERSION="1.0.1g" | |
| OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Rotate the Nginx logs to prevent a single logfile from consuming too much disk space. | |
| LOGS_PATH=/data/nginx/logs | |
| YESTERDAY=$(date -d "yesterday" +%Y-%m-%d) | |
| mv ${LOGS_PATH}/access.log ${LOGS_PATH}/access_${YESTERDAY}.log | |
| mv ${LOGS_PATH}/error.log ${LOGS_PATH}/error_${YESTERDAY}.log | |
| kill -USR1 `cat /data/nginx/logs/nginx.pid |