From 2379497cb7af8088766339c569bd16efafb1ee11 Mon Sep 17 00:00:00 2001 From: Milas Holsting Date: Tue, 12 May 2026 21:44:34 +0200 Subject: [PATCH] init --- Caddyfile | 6 ++++++ Containerfile | 5 +++++ deploy/cert.yaml | 12 ++++++++++++ deploy/deployment.yaml | 41 +++++++++++++++++++++++++++++++++++++++ deploy/ingress.yaml | 20 +++++++++++++++++++ deploy/kustomization.yaml | 7 +++++++ deploy/service.yaml | 16 +++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 Caddyfile create mode 100644 Containerfile create mode 100644 deploy/cert.yaml create mode 100644 deploy/deployment.yaml create mode 100644 deploy/ingress.yaml create mode 100644 deploy/kustomization.yaml create mode 100644 deploy/service.yaml diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..4639e33 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,6 @@ +git.melosh.tech { + reverse_proxy https://pokerogue.net/ { + header_up Host {upstream_hostport} + header_up X-Real-IP {remote_host} + } +} diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..c797879 --- /dev/null +++ b/Containerfile @@ -0,0 +1,5 @@ +FROM docker.io/caddy:2-alpine + +COPY ./Caddyfile /etc/caddy/Caddyfile + +CMD [ "caddy", "run" ] diff --git a/deploy/cert.yaml b/deploy/cert.yaml new file mode 100644 index 0000000..c767a92 --- /dev/null +++ b/deploy/cert.yaml @@ -0,0 +1,12 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: douwsky-proxy +spec: + secretName: douwsky-proxy + issuerRef: + name: letsencrypt-prod # This must match your ClusterIssuer name + kind: ClusterIssuer + dnsNames: + - git.melosh.tech + diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 0000000..8612097 --- /dev/null +++ b/deploy/deployment.yaml @@ -0,0 +1,41 @@ +# https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: douwsky-proxy + labels: + app: douwsky-proxy +spec: + selector: + matchLabels: + app: douwsky-proxy + replicas: 1 + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: douwsky-proxy + labels: + app: douwsky-proxy + spec: + containers: + - name: douwsky-proxy + image: registry.milasholsting.dk/douwsky/proxy + imagePullPolicy: always + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: 100m + memory: 100Mi + ports: + - containerPort: 80 + name: myjob + restartPolicy: Always +--- + diff --git a/deploy/ingress.yaml b/deploy/ingress.yaml new file mode 100644 index 0000000..f630b0b --- /dev/null +++ b/deploy/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: douwsky-proxy +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`git.melosh.tech`) + priority: 10 + services: + - name: douwsky-proxy + port: 80 + tls: + secretName: douwsky-proxy + domains: + - main: git.melosh.tech + + diff --git a/deploy/kustomization.yaml b/deploy/kustomization.yaml new file mode 100644 index 0000000..4c46903 --- /dev/null +++ b/deploy/kustomization.yaml @@ -0,0 +1,7 @@ +namespace: douwsky + +resources: + - ./cert.yaml + - ./deployment.yaml + - ./ingress.yaml + - ./service.yaml diff --git a/deploy/service.yaml b/deploy/service.yaml new file mode 100644 index 0000000..e8275c0 --- /dev/null +++ b/deploy/service.yaml @@ -0,0 +1,16 @@ +# https://kubernetes.io/docs/concepts/services-networking/service/ +apiVersion: v1 +kind: Service +metadata: + name: douwsky-proxy +spec: + selector: + app: douwsky-proxy + type: clusterIP + ports: + - name: douwsky-proxy + protocol: + port: 80 + targetPort: 80 +--- +