Skip to content

Instantly share code, notes, and snippets.

View bowei's full-sized avatar

Bowei Du bowei

  • Google
  • Mountain View
View GitHub Profile
@bowei
bowei / main.go
Created April 27, 2022 16:08
Simple file to HTTP healthcheck proxy
// Serves the resultFile as a response to queries. This is useful for
// assembling a custom healthcheck as a sidecar.
//
// resultFile is of format <status code> SPACE <response text>
//
// You should have a script that does the custom set of healthchecking
// on your apps and write a resulting status file.
//
// Example
//
@bowei
bowei / deploy.yaml
Created August 4, 2020 17:23
deploy.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: debug-vm
namespace: default
labels:
k8s-app: debug-vm
spec:
selector:
matchLabels:
FROM alpine
RUN apk update
RUN apk add unbound bind-tools
COPY unbound.conf /etc/unbound/unbound.conf
function foo() {
a=$1
shift
b=$1
shift
c=$1
shift
echo "a='${a}' b='${b}' c='${c}'"
}
# Replace dnsmasq spec in the kube-dns pod (see kubectl get -n kube-system kube-dns -o yaml)
# Make sure you replace cluster.local below.
name: dnsmasq
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.0
livenessProbe:
httpGet:
path: /healthcheck/dnsmasq
port: 10054
scheme: HTTP
initialDelaySeconds: 60