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
# It locates on /etc/systemd/system/ | |
[Unit] | |
Description=Cleaning unnecessary cadvisor system resources. See issue https://github.com/kubernetes/kubernetes/issues/64137. | |
[Service] | |
Slice=cadvisor-gc.slice | |
ExecStart=/opt/cadvisor-gc/cadvisor-gc.sh | |
[Install] |
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
// It's test code. Not working yet. | |
@Component | |
class CORSFilter : Filter { | |
@Value("${cmdb.cors.allowedDomainPattern}") | |
lateinit var allowedDomainPattern: String | |
override fun doFilter(request: ServletRequest, response: ServletResponse, chain: FilterChain) { | |
val res = response as HttpServletResponse | |
if (!request.serverName.matches(allowedDomainPattern.toRegex())) { | |
res.addHeader(HttpHeaders.VARY, "Origin") |
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
AUTH=$(echo -n 'username:password' | base64) | |
echo $(cat /root/.docker/config.json | jq '. += { | |
"auths": { | |
"my.registry.com/v1/": { | |
"auth": "'"$AUTH"'", | |
"email": "[email protected]" | |
} | |
} | |
}') > /root/.docker/config.json |
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: hello-world | |
spec: | |
containers: | |
- name: hello | |
image: "alpine:3" | |
command: ["/bin/echo", "hello, world"] |
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
kind create cluster --name cluster --image kindest/node:v1.18.4 | |
# k8s cluster does not located on 127.0.0.1 | |
sed -i s/127.0.0.1/host.docker.internal/g ~/.kube/config | |
# certificated does not work for host.docker.internal | |
sed -i 's/certificate-authority-data:.*$/insecure-skip-tls-verify: true/g' ~/.kube/config | |
kubectl get pod |
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
# https://hub.docker.com/r/kindest/node/tags?page=1&ordering=last_updated | |
# TAG=v1.16.4 | |
kind create cluster --image --image kindest/node:$TAG |
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
# ref: https://github.com/newrelic/k8s-webhook-cert-manager | |
openssl req -new -x509 -subj "/CN=${service}.${namespace}.svc" -nodes -newkey rsa:4096 -keyout tls.key -out tls.crt -days 9999 |
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 | |
CONFIG=~/.knd.yaml | |
NAME=$(sed -rn 's/name:[[:space:]]*(.*)/\1/gp' $CONFIG) | |
KUBECONFIG=~/.kube/kind | |
up() { | |
local ver=$1 | |
local image="" |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
"classpath"(group = "org.yaml", name = "snakeyaml", version = "1.28") | |
} | |
} | |
flyway { |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Effect": "Allow", | |
"Action": [ |
OlderNewer