Skip to content

Instantly share code, notes, and snippets.

@wreulicke
wreulicke / liveness-probes-are-dangerous.md
Last active May 14, 2024 14:04
LIVENESS PROBES ARE DANGEROUSの和訳

https://srcco.de/posts/kubernetes-liveness-probes-are-dangerous.html の和訳

Liveness Probe は 危険

Kubernetesの livenessProbe は 危険な場合があります。 明確なユースケースを持っていてその結果を理解するまで使用を避けるのをお勧めします。 このポストは、Liveness および Readiness Probeに注目し いくつかの「Do」と「Don't」を説明します。

私の同僚である、Sandorは最近、彼が見た一般的なミスについてツイートしています。

@wreulicke
wreulicke / userdata
Last active March 6, 2020 00:52
負荷試験で使う感じのuserdata
#!/bin/bash
sudo yum update
sudo yum install unbound jq -y
sudo systemctl enable unbound.service
sudo sed -i 's/PEERDNS=yes/PEERDNS=no/g' /etc/sysconfig/network-scripts/ifcfg-eth0
sudo sed -i 's/nameserver .*/nameserver 127.0.0.1/g' /etc/resolv.conf
sudo systemctl start unbound.service
cat <<EOF | sudo tee -a /etc/security/limits.conf
@wreulicke
wreulicke / test.tf
Last active March 2, 2020 16:51
いい感じでauto_scaling_groupでec2を立ち上げつつ、ssm agentで接続できるようにするやつ
locals {
key_name = "saito-load-test"
user_data = ""
}
data "aws_availability_zones" "available" {
state = "available"
}
@wreulicke
wreulicke / config.go
Last active February 27, 2020 19:29
heetch/confitaのサンプル
package config
import (
"context"
"os"
"path/filepath"
"strings"
"github.com/heetch/confita"
"github.com/heetch/confita/backend"
To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have llvm first in your PATH run:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
@wreulicke
wreulicke / no-console-use-mylogger.js
Last active December 24, 2019 00:55
console statementをESLint Pluginでfixするやつ
module.exports = {
rules: {
"no-console-use-mylogger": ["error", { "loggerName": "logger", "logger": "winston" }]
}
}
version: '3.7'
services:
myapp:
image: myapp
ports:
- "3001:3001"
labels:
com.datadoghq.ad.check_names: '["prometheus"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.instances: '[{"prometheus_url": "http://%%host%%:3001/actuator/prometheus", "extra_headers": {"Accept": "text/plain"}, "namespace": "local.test","metrics": ["jvm*"]}]'
@wreulicke
wreulicke / RequestIdInterceptor.java
Created December 12, 2019 02:59
Add SQL Comment with RequestID to all sql.
package com.wreulicke.github.mybatis;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Invocation;
import org.slf4j.MDC;
import org.springframework.jdbc.core.SqlProvider;
@wreulicke
wreulicke / buildspec.yml
Last active December 11, 2019 11:28
S3からS3のpipeline
version: 0.2
phases:
install:
runtime-versions:
docker: 18
java: openjdk11
commands:
- echo Starting...
build: