feat: enable ingress

This commit is contained in:
Peter 2022-12-30 17:03:51 +01:00
parent 61e2a09dce
commit c6c321b726
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
3 changed files with 93 additions and 4 deletions

View file

@ -12,4 +12,5 @@ RUN hugo --minify --environment production --config config.toml
FROM code.icb4dc0.de/prskr/ci-images/caddy:latest as final FROM code.icb4dc0.de/prskr/ci-images/caddy:latest as final
COPY --from=builder /src/public /usr/share/caddy COPY --from=builder /src/public /usr/share/caddy/docs/
COPY deploy/caddy/caddy.json /etc/caddy/caddy.json

88
deploy/caddy/caddy.json Normal file
View file

@ -0,0 +1,88 @@
{
"apps": {
"http": {
"servers": {
"static": {
"listen": [
":3000"
],
"metrics": {},
"routes": [
{
"match": [
{
"path": [
"/inetmock/*"
]
}
],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "gitea-http.gitea.svc.cluster.local:3000"
}
],
"rewrite": {
"path_regexp": [
{
"find": "^\\/inetmock",
"replace": "/inetmock/inetmock"
}
]
}
}
]
},
{
"match": [
{
"path": [
"/"
]
}
],
"handle": [
{
"handler": "rewrite",
"path_regexp": [
{
"find": ".*",
"replace": "/docs/"
}
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"root": "/usr/share/caddy",
"index_names": [
"index.html"
]
}
]
}
]
},
"metrics": {
"listen": [
":9100"
],
"routes": [
{
"handle": [
{
"handler": "metrics"
}
]
}
]
}
}
}
}
}

View file

@ -41,13 +41,13 @@ service:
port: 3000 port: 3000
ingress: ingress:
enabled: false enabled: true
className: "" className: "traefik"
annotations: {} annotations: {}
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"
hosts: hosts:
- host: chart-example.local - host: inetmock.icb4dc0.de
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific pathType: ImplementationSpecific