Skip to content

Commit

Permalink
kube/alrest: add static sites
Browse files Browse the repository at this point in the history
Signed-off-by: Xe Iaso <[email protected]>
  • Loading branch information
Xe committed Sep 8, 2024
1 parent 1390f43 commit d1f4cb4
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 16 deletions.
8 changes: 8 additions & 0 deletions kube/alrest/core/external-dns/1password.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ kind: OnePasswordItem
metadata:
name: aws-creds
namespace: external-dns
spec:
itemPath: "vaults/lc5zo4zjz3if3mkeuhufjmgmui/items/3xn7uf73xnzholrfk6tla5rhpa"
---
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: aws-creds
namespace: cert-manager
spec:
itemPath: "vaults/lc5zo4zjz3if3mkeuhufjmgmui/items/3xn7uf73xnzholrfk6tla5rhpa"
12 changes: 9 additions & 3 deletions kube/alrest/core/external-dns/prod-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ spec:
name: letsencrypt-prod
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
ingressClassName: nginx
- dns01:
route53:
region: ca-central-1
accessKeyIDSecretRef:
name: aws-creds
key: AWS_ACCESS_KEY_ID
secretAccessKeySecretRef:
name: aws-creds
key: AWS_SECRET_ACCESS_KEY
1 change: 1 addition & 0 deletions kube/alrest/gitea/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
- ReadWriteMany
storageClassName: longhorn
resources:
requests:
Expand Down
15 changes: 2 additions & 13 deletions kube/alrest/gitea/runner.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: act-runner-vol
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -31,7 +20,6 @@ spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: act-runner
spec:
Expand All @@ -41,7 +29,7 @@ spec:
emptyDir: {}
- name: runner-data
persistentVolumeClaim:
claimName: act-runner-vol
claimName: gitea
containers:
- name: runner
image: gitea/act_runner:nightly
Expand All @@ -65,6 +53,7 @@ spec:
mountPath: /certs
- name: runner-data
mountPath: /data
subPath: "actions"
- name: dockerd
image: docker:27.0.2-dind
env:
Expand Down
1 change: 1 addition & 0 deletions kube/alrest/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ resources:
- core
- ollama
- pvfm
- staticsites
- vms
- x
40 changes: 40 additions & 0 deletions kube/alrest/minio/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: minio
containers:
- name: minio
volumeMounts:
- name: data
mountPath: /data
image: minio/minio
args:
- server
- /data
- --console-address=:9001
env:
- name: MINIO_ROOT_USER
value: root
- name: MINIO_ROOT_PASSWORD
value: hunter22
ports:
- containerPort: 9000
hostPort: 9000
name: http
- containerPort: 9001
hostPort: 9001
name: webui
4 changes: 4 additions & 0 deletions kube/alrest/minio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ./deployment.yaml
- ./pvc.yaml
- ./service.yaml
11 changes: 11 additions & 0 deletions kube/alrest/minio/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio
spec:
accessModes:
- ReadWriteMany
storageClassName: itsuki
resources:
requests:
storage: 100Gi
17 changes: 17 additions & 0 deletions kube/alrest/minio/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: minio
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 9000
protocol: TCP
- name: webui
port: 8080
targetPort: 9001
protocol: TCP
selector:
app: minio
13 changes: 13 additions & 0 deletions kube/alrest/staticsites/caddy1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM debian:bookworm AS build

WORKDIR /app
RUN mkdir -p /app
ADD https://github.com/caddyserver/caddy/releases/download/v1.0.4/caddy_v1.0.4_linux_amd64.tar.gz /app/caddy1.tgz
RUN tar xf /app/caddy1.tgz

FROM debian:bookworm
LABEL org.opencontainers.image.source="https://github.com/Xe/x"
WORKDIR /app
RUN mkdir -p /app/bin
COPY --from=build /app/caddy /app/bin/caddy
CMD ["/app/bin/caddy", "-port", "8080", "-agree", "-conf", "/app/etc/Caddyfile"]
112 changes: 112 additions & 0 deletions kube/alrest/staticsites/caddy1/caddy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: caddy
data:
Caddyfile: |
lewa.within.website:8080 {
tls off
errors stdout
root /srv/http/lewa
}
xena.greedo.xeserv.us:8080 {
tls off
errors stdout
header / X-Clacks-Overhead "GNU Ashlynn"
root /srv/http/xena.greedo.xeserv.us
markdown / {
template blog templates/blog.html
template index templates/index.html
}
browse
}
xn--u7hz981o.ws:8080 {
tls off
errors stdout
header / X-Clacks-Overhead "GNU Ashlynn"
internal /templates
root /srv/http/xn--u7hz981o.ws
markdown / {
template index templates/index.html
template page templates/page.html
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: caddy
labels:
app: caddy
spec:
selector:
matchLabels:
app: caddy
template:
metadata:
labels:
app: caddy
spec:
volumes:
- name: config
configMap:
name: caddy
- name: lewa
persistentVolumeClaim:
claimName: lewa
- name: greedo
persistentVolumeClaim:
claimName: xena-greedo-xeserv-us
- name: xn--u7hz981o
persistentVolumeClaim:
claimName: xn--u7hz981o
containers:
- name: caddy
image: ghcr.io/xe/x/caddy1
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 8080
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: "/app/etc"
name: config
- mountPath: "/srv/http/lewa"
name: lewa
- mountPath: "/srv/http/xn--u7hz981o.ws"
name: xn--u7hz981o
- mountPath: "/srv/http/xena.greedo.xeserv.us"
name: greedo
---
apiVersion: v1
kind: Service
metadata:
name: caddy
spec:
selector:
app: caddy
ports:
- port: 80
targetPort: 8080
name: http
---
5 changes: 5 additions & 0 deletions kube/alrest/staticsites/caddy1/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- caddy.yaml
- lewa.yaml
- xena-greedo.yaml
- xn--u7hz981o.yaml
36 changes: 36 additions & 0 deletions kube/alrest/staticsites/caddy1/lewa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: lewa
spec:
storageClassName: "tigris"
resources:
requests:
storage: 512Mi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: lewa-within-website
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
tls:
- hosts:
- lewa.within.website
secretName: lewa-within-website-public-tls
rules:
- host: lewa.within.website
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: caddy
port:
name: http
36 changes: 36 additions & 0 deletions kube/alrest/staticsites/caddy1/xena-greedo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: xena-greedo-xeserv-us
spec:
storageClassName: "itsuki"
resources:
requests:
storage: 512Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: xena-greedo-xeserv-us
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
tls:
- hosts:
- xena.greedo.xeserv.us
secretName: xena-greedo-xeserv-us-public-tls
rules:
- host: xena.greedo.xeserv.us
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: caddy
port:
name: http
Loading

0 comments on commit d1f4cb4

Please sign in to comment.