Skip to content

Instantly share code, notes, and snippets.

FROM golang:1.12-stretch AS builder
WORKDIR $GOPATH/pinger
COPY . .
RUN go build -o app .
FROM ubuntu:bionic
COPY --from=builder /go/pinger/app /
ENV PORT=8000
EXPOSE $PORT
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: pinger-monitor
labels:
app: pinger
prometheus: prom-op
spec:
selector:
matchLabels:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
namespace: kube-system
labels:
app: fluentd-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-logging
namespace: kube-system
labels:
app: fluentd-logging
data:
fluent.conf: |
<source>
package main
import (
"fmt"
"io"
"log"
"math"
"math/rand"
"net/http"
"os"
package main
import (
"fmt"
"io"
"log"
"math"
"math/rand"
"net/http"
"os"
package main
import (
"fmt"
"io"
"log"
"math"
"math/rand"
"net/http"
"os"
@0sc
0sc / Dockerfile
Created August 6, 2019 00:11
Sample Dockerfile using image from a docker registry running locally
FROM localhost:5000/mybusybox
CMD ["echo", "Hello from busybox"]
@0sc
0sc / pod.yaml
Last active August 6, 2019 19:45
helm pod template
apiVersion: v1
kind: Pod
metadata:
name: {{ template "simple-pod.fullname" . }}
labels:
{{ include "simple-pod.labels" . | indent 4 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image }}
@0sc
0sc / .env.sample
Created January 4, 2022 19:03
Code snippets for using Imgproxy with Minio.
IMGPROXY_KEY=$(xxd -g 2 -l 64 -p /dev/random | tr -d '\n')
IMGPROXY_SALT=$(xxd -g 2 -l 64 -p /dev/random | tr -d '\n')
ACCESS_SECRET=$(xxd -g 2 -l 5 -p /dev/random | tr -d '\n')
ACCESS_KEY=$(xxd -g 2 -l 5 -p /dev/random | tr -d '\n')
REGION=us-east-1
DEFAULT_BUCKET=sample