mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-09 04:15:52 +10:00
Update proxy to use caddy
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: home-proxy
|
||||
spec:
|
||||
revisionHistoryLimit: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: home-proxy
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: home-proxy
|
||||
spec:
|
||||
volumes:
|
||||
- name: caddy-config
|
||||
configMap:
|
||||
name: caddy-config
|
||||
items:
|
||||
- key: Caddyfile
|
||||
path: Caddyfile
|
||||
containers:
|
||||
- name: home-proxy
|
||||
image: caddy:2
|
||||
args:
|
||||
[
|
||||
"caddy",
|
||||
"run",
|
||||
"--config",
|
||||
"/etc/caddy/Caddyfile",
|
||||
"--adapter",
|
||||
"caddyfile",
|
||||
]
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: jellyfin-port
|
||||
protocol: TCP
|
||||
- containerPort: 8081
|
||||
name: nas-port
|
||||
protocol: TCP
|
||||
- containerPort: 8082
|
||||
name: plex-port
|
||||
protocol: TCP
|
||||
- containerPort: 8083
|
||||
name: vm-port
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: TZ
|
||||
value: Australia/Melbourne
|
||||
- name: CADDY_LOG_LEVEL
|
||||
value: INFO
|
||||
volumeMounts:
|
||||
- name: caddy-config
|
||||
mountPath: /etc/caddy
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 126Mi
|
||||
limits:
|
||||
cpu: 400m
|
||||
memory: 512Mi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: home-proxy
|
||||
labels:
|
||||
app: home-proxy
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: jellyfin-port
|
||||
protocol: TCP
|
||||
- port: 8081
|
||||
targetPort: nas-port
|
||||
protocol: TCP
|
||||
- port: 8082
|
||||
targetPort: plex-port
|
||||
protocol: TCP
|
||||
- port: 8083
|
||||
targetPort: vm-port
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: home-proxy
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: caddy-config
|
||||
namespace: home-apps
|
||||
data:
|
||||
Caddyfile: |
|
||||
# Jellyfin
|
||||
:8080 {
|
||||
log {
|
||||
level {env.CADDY_LOG_LEVEL}
|
||||
output stderr
|
||||
}
|
||||
|
||||
reverse_proxy 192.168.1.11:8096
|
||||
|
||||
route /ping {
|
||||
respond "Hi, I am running with version app version: {env.APP_VERSION}"
|
||||
}
|
||||
encode gzip zstd
|
||||
}
|
||||
# Nas
|
||||
:8081 {
|
||||
log {
|
||||
level {env.CADDY_LOG_LEVEL}
|
||||
output stderr
|
||||
}
|
||||
# nas
|
||||
reverse_proxy 192.168.1.4:8080
|
||||
|
||||
encode gzip zstd
|
||||
}
|
||||
|
||||
# Plex
|
||||
:8082 {
|
||||
log {
|
||||
level {env.CADDY_LOG_LEVEL}
|
||||
output stderr
|
||||
}
|
||||
|
||||
reverse_proxy 192.168.1.11:32400
|
||||
encode gzip zstd
|
||||
}
|
||||
# VMware
|
||||
:8083 {
|
||||
log {
|
||||
level {env.CADDY_LOG_LEVEL}
|
||||
output stderr
|
||||
}
|
||||
|
||||
reverse_proxy https://192.168.1.56 {
|
||||
transport http {
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
}
|
||||
encode gzip zstd
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: nas-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
kubernetes.io/tls-acme: "true"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: 1024000m
|
||||
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- nas.junv.me
|
||||
secretName: nas-tls
|
||||
rules:
|
||||
- host: nas.junv.me
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: home-proxy
|
||||
port:
|
||||
number: 8081
|
||||
path: /
|
||||
pathType: Prefix
|
||||
|
||||
---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: jellyfin-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
kubernetes.io/tls-acme: "true"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- jellyfin.junv.me
|
||||
secretName: jellyfin-tls
|
||||
rules:
|
||||
- host: jellyfin.junv.me
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: home-proxy
|
||||
port:
|
||||
number: 8000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
+69
-69
@@ -1,71 +1,71 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jellyfin
|
||||
namespace: home-apps
|
||||
spec:
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
selector:
|
||||
app: jellyfin
|
||||
---
|
||||
# apiVersion: v1
|
||||
# kind: Service
|
||||
# metadata:
|
||||
# name: jellyfin
|
||||
# namespace: home-apps
|
||||
# spec:
|
||||
# ports:
|
||||
# - port: 8000
|
||||
# targetPort: 8000
|
||||
# selector:
|
||||
# app: jellyfin
|
||||
# ---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: jellyfin
|
||||
spec:
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: jellyfin
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: jellyfin
|
||||
spec:
|
||||
containers:
|
||||
- name: jellyfin
|
||||
image: alpine/socat
|
||||
args:
|
||||
- "tcp-listen:8000,fork,reuseaddr"
|
||||
- "tcp-connect:192.168.1.11:8096"
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
resources:
|
||||
limits:
|
||||
cpu: "0.5"
|
||||
memory: "512Mi"
|
||||
requests:
|
||||
cpu: "0.1"
|
||||
memory: "256Mi"
|
||||
---
|
||||
# apiVersion: apps/v1
|
||||
# kind: Deployment
|
||||
# metadata:
|
||||
# name: jellyfin
|
||||
# spec:
|
||||
# revisionHistoryLimit: 2
|
||||
# selector:
|
||||
# matchLabels:
|
||||
# app: jellyfin
|
||||
# replicas: 1
|
||||
# template:
|
||||
# metadata:
|
||||
# labels:
|
||||
# app: jellyfin
|
||||
# spec:
|
||||
# containers:
|
||||
# - name: jellyfin
|
||||
# image: alpine/socat
|
||||
# args:
|
||||
# - "tcp-listen:8000,fork,reuseaddr"
|
||||
# - "tcp-connect:192.168.1.11:8096"
|
||||
# ports:
|
||||
# - containerPort: 8000
|
||||
# resources:
|
||||
# limits:
|
||||
# cpu: "0.5"
|
||||
# memory: "512Mi"
|
||||
# requests:
|
||||
# cpu: "0.1"
|
||||
# memory: "256Mi"
|
||||
# ---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: jellyfin-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
kubernetes.io/tls-acme: "true"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- jellyfin.junv.me
|
||||
secretName: jellyfin-tls
|
||||
rules:
|
||||
- host: jellyfin.junv.me
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: jellyfin
|
||||
port:
|
||||
number: 8000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
# apiVersion: networking.k8s.io/v1
|
||||
# kind: Ingress
|
||||
# metadata:
|
||||
# name: jellyfin-ingress
|
||||
# annotations:
|
||||
# kubernetes.io/ingress.class: "nginx"
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
# nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
# nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
# spec:
|
||||
# tls:
|
||||
# - hosts:
|
||||
# - jellyfin.junv.me
|
||||
# secretName: jellyfin-tls
|
||||
# rules:
|
||||
# - host: jellyfin.junv.me
|
||||
# http:
|
||||
# paths:
|
||||
# - backend:
|
||||
# service:
|
||||
# name: jellyfin
|
||||
# port:
|
||||
# number: 8000
|
||||
# path: /
|
||||
# pathType: Prefix
|
||||
|
||||
+70
-70
@@ -1,73 +1,73 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nas-proxy
|
||||
namespace: home-apps
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: nas-proxy
|
||||
---
|
||||
# apiVersion: v1
|
||||
# kind: Service
|
||||
# metadata:
|
||||
# name: nas-proxy
|
||||
# namespace: home-apps
|
||||
# spec:
|
||||
# ports:
|
||||
# - port: 80
|
||||
# targetPort: 80
|
||||
# selector:
|
||||
# app: nas-proxy
|
||||
# ---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nas-proxy
|
||||
spec:
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nas-proxy
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nas-proxy
|
||||
spec:
|
||||
containers:
|
||||
- name: nas-proxy
|
||||
image: alpine/socat
|
||||
args:
|
||||
- "tcp-listen:80,fork,reuseaddr"
|
||||
- "tcp-connect:192.168.1.4:8080"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "600Mi"
|
||||
requests:
|
||||
cpu: "0.2"
|
||||
memory: "300Mi"
|
||||
# apiVersion: apps/v1
|
||||
# kind: Deployment
|
||||
# metadata:
|
||||
# name: nas-proxy
|
||||
# spec:
|
||||
# revisionHistoryLimit: 2
|
||||
# selector:
|
||||
# matchLabels:
|
||||
# app: nas-proxy
|
||||
# replicas: 1
|
||||
# template:
|
||||
# metadata:
|
||||
# labels:
|
||||
# app: nas-proxy
|
||||
# spec:
|
||||
# containers:
|
||||
# - name: nas-proxy
|
||||
# image: alpine/socat
|
||||
# args:
|
||||
# - "tcp-listen:80,fork,reuseaddr"
|
||||
# - "tcp-connect:192.168.1.4:8080"
|
||||
# ports:
|
||||
# - containerPort: 80
|
||||
# resources:
|
||||
# limits:
|
||||
# cpu: "1"
|
||||
# memory: "600Mi"
|
||||
# requests:
|
||||
# cpu: "0.2"
|
||||
# memory: "300Mi"
|
||||
|
||||
---
|
||||
# ---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: nas-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
kubernetes.io/tls-acme: "true"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: 1024000m
|
||||
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- nas.junv.me
|
||||
secretName: nas-tls
|
||||
rules:
|
||||
- host: nas.junv.me
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: nas-proxy
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
# apiVersion: networking.k8s.io/v1
|
||||
# kind: Ingress
|
||||
# metadata:
|
||||
# name: nas-ingress
|
||||
# annotations:
|
||||
# kubernetes.io/ingress.class: "nginx"
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
# nginx.ingress.kubernetes.io/proxy-body-size: 1024000m
|
||||
# nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
||||
# nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
||||
# spec:
|
||||
# tls:
|
||||
# - hosts:
|
||||
# - nas.junv.me
|
||||
# secretName: nas-tls
|
||||
# rules:
|
||||
# - host: nas.junv.me
|
||||
# http:
|
||||
# paths:
|
||||
# - backend:
|
||||
# service:
|
||||
# name: nas-proxy
|
||||
# port:
|
||||
# number: 80
|
||||
# path: /
|
||||
# pathType: Prefix
|
||||
|
||||
Reference in New Issue
Block a user