From a3b2a4dede058b56a678ff2ff6607934b5712b24 Mon Sep 17 00:00:00 2001 From: Daniel Svitan Date: Mon, 9 Jun 2025 09:34:23 +0200 Subject: [PATCH] :sparkles: Adds caddy depl --- caddy/.gitignore | 6 ++++ caddy/config/.gitkeep | 0 caddy/data/.gitkeep | 0 caddy/depl.yaml | 72 +++++++++++++++++++++++++++++++++++++++++++ caddy/file/.gitkeep | 0 caddy/logs/.gitkeep | 0 caddy/serv.yaml | 18 +++++++++++ k3s-depl.yaml | 39 ----------------------- k3s-pod.yaml | 27 ---------------- k3s-serv.yaml | 12 -------- porty/depl.yaml | 39 +++++++++++++++++++++++ porty/pod.yaml | 27 ++++++++++++++++ porty/serv.yaml | 12 ++++++++ 13 files changed, 174 insertions(+), 78 deletions(-) create mode 100644 caddy/.gitignore create mode 100644 caddy/config/.gitkeep create mode 100644 caddy/data/.gitkeep create mode 100644 caddy/depl.yaml create mode 100644 caddy/file/.gitkeep create mode 100644 caddy/logs/.gitkeep create mode 100644 caddy/serv.yaml delete mode 100644 k3s-depl.yaml delete mode 100644 k3s-pod.yaml delete mode 100644 k3s-serv.yaml create mode 100644 porty/depl.yaml create mode 100644 porty/pod.yaml create mode 100644 porty/serv.yaml diff --git a/caddy/.gitignore b/caddy/.gitignore new file mode 100644 index 0000000..90aeca9 --- /dev/null +++ b/caddy/.gitignore @@ -0,0 +1,6 @@ +config/* +data/* +file/* +logs/* + +!**/.gitkeep diff --git a/caddy/config/.gitkeep b/caddy/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/caddy/data/.gitkeep b/caddy/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/caddy/depl.yaml b/caddy/depl.yaml new file mode 100644 index 0000000..a369bfe --- /dev/null +++ b/caddy/depl.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: caddy + labels: + app: caddy +spec: + replicas: 1 + selector: + matchLabels: + app: caddy + template: + metadata: + name: caddy + labels: + app: caddy + spec: + hostNetwork: true + restartPolicy: Always + containers: + - name: caddy + image: caddy:latest + imagePullPolicy: Always + resources: + requests: + cpu: 500m + memory: 32Mi + limits: + cpu: 2000m + memory: 512Mi + livenessProbe: + httpGet: + port: 5001 + path: / + initialDelaySeconds: 5 + timeoutSeconds: 1 + periodSeconds: 10 + failureThreshold: 3 + volumeMounts: + - name: caddy-file + mountPath: /etc/caddy + readOnly: true + - name: caddy-logs + mountPath: /var/log/caddy + - name: caddy-data + mountPath: /data + - name: caddy-config + mountPath: /config + securityContext: + runAsUser: 1000 + privileged: true + capabilities: + add: + - NET_ADMIN + volumes: + - name: caddy-file + hostPath: + path: /mnt/Projects/k3s-testing/caddy/file + - name: caddy-logs + hostPath: + path: /mnt/Projects/k3s-testing/caddy/logs + - name: caddy-data + hostPath: + path: /mnt/Projects/k3s-testing/caddy/data + - name: caddy-config + hostPath: + path: /mnt/Projects/k3s-testing/caddy/config + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0% + maxSurge: 10% diff --git a/caddy/file/.gitkeep b/caddy/file/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/caddy/logs/.gitkeep b/caddy/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/caddy/serv.yaml b/caddy/serv.yaml new file mode 100644 index 0000000..c0d9582 --- /dev/null +++ b/caddy/serv.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Service +metadata: + name: caddy +spec: + selector: + app: caddy + ports: + - protocol: TCP + port: 5001 + targetPort: 5001 + - protocol: TCP + port: 5002 + targetPort: 5002 + - protocol: TCP + port: 5033 + targetPort: 5033 + type: LoadBalancer diff --git a/k3s-depl.yaml b/k3s-depl.yaml deleted file mode 100644 index a1c9571..0000000 --- a/k3s-depl.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: porty - labels: - app: porty -spec: - replicas: 3 - selector: - matchLabels: - app: porty - template: - metadata: - name: porty - labels: - app: porty - spec: - containers: - - name: porty - image: gitea.svitan.dev/streamer272/svitan.dev:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 3000 - protocol: TCP - resources: - requests: - cpu: "500m" - memory: "32Mi" - limits: - cpu: "2000m" - memory: "256Mi" - livenessProbe: # if liveness fails, container is restarted - httpGet: - port: 3000 - path: / - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - failureThreshold: 3 diff --git a/k3s-pod.yaml b/k3s-pod.yaml deleted file mode 100644 index c2d2c5c..0000000 --- a/k3s-pod.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: portfolio -spec: - containers: - - image: gitea.svitan.dev/streamer272/svitan.dev:latest - name: portfolio - ports: - - containerPort: 3000 - name: http - protocol: TCP - resources: - requests: - cpu: "500m" - memory: "32Mi" - limits: - cpu: "2000m" - memory: "256Mi" - livenessProbe: - httpGet: - path: / - port: 3000 - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 10 - failureThreshold: 3 diff --git a/k3s-serv.yaml b/k3s-serv.yaml deleted file mode 100644 index 2739252..0000000 --- a/k3s-serv.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: porty -spec: - selector: - app: porty - ports: - - protocol: TCP - port: 3000 # this is the port the users will access, so probably should be 80 - targetPort: 3000 - type: LoadBalancer diff --git a/porty/depl.yaml b/porty/depl.yaml new file mode 100644 index 0000000..520842d --- /dev/null +++ b/porty/depl.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: porty + labels: + app: porty +spec: + replicas: 3 + selector: + matchLabels: + app: porty + template: + metadata: + name: porty + labels: + app: porty + spec: + containers: + - name: porty + image: gitea.svitan.dev/streamer272/svitan.dev:latest + imagePullPolicy: Always + ports: + - containerPort: 3000 + protocol: TCP + resources: + requests: + cpu: "500m" + memory: "32Mi" + limits: + cpu: "2000m" + memory: "256Mi" + livenessProbe: # if liveness fails, container is restarted + httpGet: + port: 3000 + path: / + initialDelaySeconds: 5 + timeoutSeconds: 1 + periodSeconds: 10 + failureThreshold: 3 diff --git a/porty/pod.yaml b/porty/pod.yaml new file mode 100644 index 0000000..93b8f70 --- /dev/null +++ b/porty/pod.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Pod +metadata: + name: portfolio +spec: + containers: + - image: gitea.svitan.dev/streamer272/svitan.dev:latest + name: portfolio + ports: + - containerPort: 3000 + name: http + protocol: TCP + resources: + requests: + cpu: "500m" + memory: "32Mi" + limits: + cpu: "2000m" + memory: "256Mi" + livenessProbe: + httpGet: + path: / + port: 3000 + initialDelaySeconds: 5 + timeoutSeconds: 1 + periodSeconds: 10 + failureThreshold: 3 diff --git a/porty/serv.yaml b/porty/serv.yaml new file mode 100644 index 0000000..c0d4015 --- /dev/null +++ b/porty/serv.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: porty +spec: + selector: + app: porty + ports: + - protocol: TCP + port: 3333 # this is the port the users will access, so probably should be 80 + targetPort: 3000 + type: LoadBalancer