Skip to content

Commit

Permalink
fix: Fixing favicon path and adding infra (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViBiOh authored Apr 15, 2020
1 parent 3cfe3a2 commit 71b1cae
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 1 deletion.
50 changes: 50 additions & 0 deletions infra/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ketchup
data:
KETCHUP_MAILER_URL: http://mailer

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ketchup
spec:
selector:
matchLabels:
name: ketchup
template:
metadata:
labels:
name: ketchup
annotations:
prometheus.io/scrape: "true"
prometheus.io/scheme: http
prometheus.io/port: "1080"
spec:
containers:
- name: ketchup
image: vibioh/ketchup
envFrom:
- configMapRef:
name: ketchup
- secretRef:
name: ketchup
ports:
- name: http
containerPort: 1080
readinessProbe:
httpGet:
path: /health
port: http
livenessProbe:
httpGet:
path: /health
port: http
resources:
requests:
memory: 24M
limits:
memory: 64M
47 changes: 47 additions & 0 deletions infra/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: ketchup-auth
spec:
basicAuth:
secret: ketchup-auth
removeHeader: true

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ketchup-http
spec:
entryPoints:
- http
routes:
- match: Host(`ketchup.vibioh.fr`)
kind: Rule
middlewares:
- name: redirect
services:
- name: ketchup
port: 80

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ketchup-https
spec:
entryPoints:
- https
routes:
- match: Host(`ketchup.vibioh.fr`)
kind: Rule
middlewares:
- name: ketchup-auth
- name: compress
- name: ratelimit
services:
- name: ketchup
port: 80
tls:
certResolver: default
12 changes: 12 additions & 0 deletions infra/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: ketchup
spec:
selector:
name: ketchup
ports:
- name: http
port: 80
targetPort: http
7 changes: 6 additions & 1 deletion pkg/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"html/template"
"net/http"
"os"

"github.com/ViBiOh/httputils/v3/pkg/httperror"
"github.com/ViBiOh/httputils/v3/pkg/templates"
Expand Down Expand Up @@ -37,8 +38,12 @@ func New(targetApp target.App) (App, error) {

// Handler for request. Should be use with net/http
func (a app) Handler() http.Handler {
version := os.Getenv("VERSION")

return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
content := make(map[string]interface{}, 0)
content := map[string]interface{}{
"Version": version,
}
status := http.StatusOK

targets, _, err := a.targetApp.List(r.Context(), 1, 100, "", false, nil)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit 71b1cae

Please sign in to comment.