Skip to content

Instantly share code, notes, and snippets.

@DazWilkin
DazWilkin / Dockerfile
Created July 3, 2018 17:21
Kubernetes Deployment Dependencies
FROM golang:1.10 as build
WORKDIR /go/src/app
COPY main.go .
RUN go get -d -v ./...
RUN go install -v ./...
FROM gcr.io/distroless/base
@DazWilkin
DazWilkin / second-second.yaml
Last active July 3, 2018 17:23
Kubernetes Deployment Dependencies
---
apiVersion: v1
kind: Pod
metadata:
name: second-second
labels:
app: simple-config
component: second
spec:
restartPolicy: Never
@DazWilkin
DazWilkin / main.go
Created July 3, 2018 16:59
Kubernetes Deployment Dependencies
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@DazWilkin
DazWilkin / deployment.yaml
Created July 2, 2018 22:14
Kubernetes Deployment Dependencies
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-config
labels:
app.kubernetes.io/name: simple-config
app.kubernetes.io/version: v1
app: simple-config
component: debug
@DazWilkin
DazWilkin / Dockerfile
Created July 2, 2018 22:13
Kubernetes Deployment Dependencies
FROM golang:1.10 as build
WORKDIR /go/src/app
COPY main.go .
RUN go get -d -v ./...
RUN go install -v ./...
FROM gcr.io/distroless/base
@DazWilkin
DazWilkin / main.go
Created July 2, 2018 22:12
Kubernetes Deployment Dependencies
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
@DazWilkin
DazWilkin / second.yaml
Last active July 3, 2018 14:13
Kubernetes Deployment Dependencies
---
apiVersion: v1
kind: Pod
metadata:
name: second
labels:
app: simple-config
component: second
spec:
restartPolicy: Never
@DazWilkin
DazWilkin / first.yaml
Created July 2, 2018 21:55
Kubernetes Deployment Dependencies
---
apiVersion: v1
kind: Pod
metadata:
name: first
labels:
app: simple-config
component: first
spec:
restartPolicy: Never
@DazWilkin
DazWilkin / main.go
Last active July 2, 2018 16:02
Attempt at mimicking Runtime Config using file-system
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
@DazWilkin
DazWilkin / main.go
Created June 26, 2018 01:36
Google Runtime Config Golang sample
package main
import (
"fmt"
"log"
"math/rand"
"os"
"sync"
"time"