Commit 9850674b authored by Jens Langhammer's avatar Jens Langhammer

t1 -> tier0

parent 30cf0610
Pipeline #3857 failed with stage
in 1 minute and 27 seconds
FROM golang:latest AS builder
WORKDIR /go/src/git.beryju.org/BeryJu.org/t1
WORKDIR /go/src/git.beryju.org/BeryJu.org/p2/tier0
ENV GO111MODULE=on
......@@ -8,7 +8,7 @@ COPY go.mod .
COPY go.sum .
RUN go mod download && \
go build -v -o /go/bin/t1
go build -v -o /go/bin/tier0
FROM alpine:latest
......@@ -16,6 +16,6 @@ RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/bin/t1 /t1
COPY --from=builder /go/bin/tier0 /tier0
CMD "/t1"
CMD "/tier0"
module git.beryju.org/BeryJu.org/t1
module git.beryju.org/BeryJu.org/p2/tier0
go 1.12
......
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: p2-t1
name: p2-tier0
labels:
app.kubernetes.io/name: p2-t1
app.kubernetes.io/managed-by: p2-t1
app.kubernetes.io/name: p2-tier0
app.kubernetes.io/managed-by: p2-tier0
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: p2-t1
app.kubernetes.io/name: p2-tier0
template:
metadata:
labels:
app.kubernetes.io/name: p2-t1
app.kubernetes.io/name: p2-tier0
k8s.p2.io/component: cache
spec:
containers:
- name: p2-t1
image: "t1:test"
- name: p2-tier0
image: "tier0:test"
imagePullPolicy: Never
ports:
- name: http
......@@ -29,9 +29,9 @@ spec:
protocol: TCP
livenessProbe:
httpGet:
path: /_/t1/health
path: /_/tier0/health
port: http
readinessProbe:
httpGet:
path: /_/t1/health
path: /_/tier0/health
port: http
apiVersion: v1
kind: Service
metadata:
name: p2-t1-http
name: p2-tier0-http
labels:
app.kubernetes.io/name: p2-t1
app.kubernetes.io/name: p2-tier0
spec:
type: ClusterIP
ports:
......@@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
app.kubernetes.io/name: p2-t1
app.kubernetes.io/name: p2-tier0
......@@ -8,17 +8,14 @@ import (
"os"
"time"
"git.beryju.org/BeryJu.org/t1/pkg/constants"
"git.beryju.org/BeryJu.org/t1/pkg/k8s"
"git.beryju.org/BeryJu.org/t1/pkg/cache"
v1 "k8s.io/api/core/v1"
"git.beryju.org/BeryJu.org/t1/pkg/p2"
"git.beryju.org/BeryJu.org/tier0/pkg/cache"
"git.beryju.org/BeryJu.org/tier0/pkg/constants"
"git.beryju.org/BeryJu.org/tier0/pkg/k8s"
"git.beryju.org/BeryJu.org/tier0/pkg/p2"
"github.com/gorilla/handlers"
"github.com/qbig/groupcache"
log "github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
)
func main() {
......@@ -46,7 +43,7 @@ func main() {
log.Warning(err)
})
log.Printf("Running on %s...", constants.Listen)
http.HandleFunc("/_/t1/health", func(w http.ResponseWriter, r *http.Request) {
http.HandleFunc("/_/tier0/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
})
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
......
......@@ -8,9 +8,9 @@ import (
"github.com/gorilla/handlers"
"git.beryju.org/BeryJu.org/t1/pkg/constants"
"git.beryju.org/BeryJu.org/t1/pkg/k8s"
"git.beryju.org/BeryJu.org/t1/pkg/p2"
"git.beryju.org/BeryJu.org/tier0/pkg/constants"
"git.beryju.org/BeryJu.org/tier0/pkg/k8s"
"git.beryju.org/BeryJu.org/tier0/pkg/p2"
"github.com/qbig/groupcache"
log "github.com/sirupsen/logrus"
)
......@@ -27,7 +27,7 @@ func NewCache(upstream p2.Upstream) Cache {
logger := log.WithFields(log.Fields{
"component": "cache",
})
cache := groupcache.NewGroup("t1", constants.CacheSize, groupcache.GetterFunc(
cache := groupcache.NewGroup("tier0", constants.CacheSize, groupcache.GetterFunc(
func(ctx groupcache.Context, key string, dest groupcache.Sink) error {
logger.Debug("Fetching key from upstream...")
blob, err := upstream.Fetch(key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment