- Envoy はデフォルトでは接続済みコネクションを無制限に保持するため、Envoy Deployment の更新などでコネクション数が一度偏ると長時間それが維持される
- Envoy
max-connection-duration
を用いて定期的にコネクションをクローズすることでコネクション数が分散する- gRPC クライアントはコネクションがクローズされると自動的に再接続する(Go クライアントの場合)
- アクティブなコネクションのクローズを避けたい場合は
idle-timeout
も使用できる
This file contains 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 -e | |
# https://gist.github.com/superbrothers/23e159f722eebe2627a7d9ea34447457 | |
#Set Variables | |
BTPATH=/boot/firmware | |
CKPATH="$BTPATH/vmlinuz" | |
DKPATH="$BTPATH/vmlinux" | |
#Check if compression needs to be done. |
This file contains 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
{ | |
"metadata": { | |
"name": "event-exporter.162d26137f11b560", | |
"namespace": "monitoring", | |
"selfLink": "/api/v1/namespaces/monitoring/events/event-exporter.162d26137f11b560", | |
"uid": "47d47d0a-719a-4629-82d9-36599a9ff17b", | |
"resourceVersion": "2475", | |
"creationTimestamp": "2020-08-21T02:01:47Z", | |
"managedFields": [ | |
{ |
This file contains 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
# HELP fluentbit_input_bytes_total Number of input bytes. | |
# TYPE fluentbit_input_bytes_total counter | |
fluentbit_input_bytes_total{name="systemd.0"} 572360 1597101884056 | |
# HELP fluentbit_input_records_total Number of input records. | |
# TYPE fluentbit_input_records_total counter | |
fluentbit_input_records_total{name="systemd.0"} 510 1597101884056 | |
# HELP fluentbit_output_errors_total Number of output errors. | |
# TYPE fluentbit_output_errors_total counter | |
fluentbit_output_errors_total{name="stdout.0"} 0 1597101884056 | |
# HELP fluentbit_output_proc_bytes_total Number of processed output bytes. |
This file contains 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
# Create a minikube cluster | |
minikube start | |
# Install kubectl-debug_ns plugin | |
TMPDIR="$(mktemp -d)" | |
curl -L -o "${TMPDIR}/kubectl-debug_node" https://raw.githubusercontent.com/superbrothers/kubectl-plugins/master/kubectl-debug_node | |
chmod +x "${TMPDIR}/kubectl-debug_node" | |
export PATH="$TMPDIR:$PATH" | |
# Create a debugging pod for node/minikube |
This file contains 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
# This issues was fixed on v1.18.3 and later. | |
$ kind create cluster --image kindest/node:v1.18.2 | |
$ kubectl version | |
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.4", GitCommit:"c96aede7b5205121079932896c4ad89bb93260af", GitTreeState:"clean", BuildDate:"2020-06-17T11:41:22Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"} | |
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-30T20:19:45Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"} | |
$ cat <<EOL | kubectl apply -f- | |
apiVersion: apps/v1 |
This file contains 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
name: Release | |
on: | |
push: | |
tags: ["v*"] | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: |
This file contains 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
$ kubectl version | |
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"} | |
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-02-07T01:05:17Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"} | |
$ kubectl create configmap env-config --from-literal=log_level=INFO | |
configmap/env-config created | |
$ cat <<EOL | kubectl create -f - | |
apiVersion: apps/v1 | |
kind: Deployment |
This file contains 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
#!/usr/bin/env bash | |
set -e -o pipefail; [[ -n "$DEBUG" ]] && set -x | |
CERT_DIR="${CERT_DIR:-"/usr/local/share/ca-certificates"}" | |
function usage() { | |
echo "Usage: $(basename "$0") [-n name] certflie ..." >&2 | |
} |
This file contains 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: debugtest | |
spec: | |
shareProcessNamespace: true | |
containers: | |
- name: myapp | |
image: docker.io/superbrothers/distroless-examples-nodejs-hello-http | |
--- |