Compare commits
3 Commits
5b47122672
...
25760ea373
| Author | SHA1 | Date | |
|---|---|---|---|
|
25760ea373
|
|||
|
ff1db9b17d
|
|||
|
172805a81a
|
@@ -0,0 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: blog-nginx-config
|
||||
namespace: blog
|
||||
data:
|
||||
default.conf: |
|
||||
server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
root /git/current;
|
||||
index index.html;
|
||||
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 "OK";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
location ~ /\.git {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: blog
|
||||
namespace: blog
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: blog
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
# git-sync (uid 65533) writes files; fsGroup makes the emptyDir group-writable by that uid
|
||||
fsGroup: 65533
|
||||
initContainers:
|
||||
- name: git-sync-init
|
||||
image: registry.k8s.io/git-sync/git-sync:v4.5.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: GITSYNC_REPO
|
||||
value: "https://${GITEA_HOST}/oleksandr/blog.git"
|
||||
- name: GITSYNC_ROOT
|
||||
value: "/git"
|
||||
- name: GITSYNC_REF
|
||||
value: "gh-pages"
|
||||
- name: GITSYNC_LINK
|
||||
value: "current"
|
||||
- name: GITSYNC_DEPTH
|
||||
value: "1"
|
||||
- name: GITSYNC_ONE_TIME
|
||||
value: "true"
|
||||
- name: GITSYNC_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-git-credentials
|
||||
key: GITSYNC_USERNAME
|
||||
- name: GITSYNC_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-git-credentials
|
||||
key: GITSYNC_PASSWORD
|
||||
securityContext:
|
||||
runAsUser: 65533
|
||||
runAsGroup: 65533
|
||||
volumeMounts:
|
||||
- name: git-content
|
||||
mountPath: /git
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
memory: 128Mi
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginxinc/nginx-unprivileged:1.28.3-alpine3.23
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
protocol: TCP
|
||||
securityContext:
|
||||
runAsUser: 101
|
||||
runAsGroup: 101
|
||||
volumeMounts:
|
||||
- name: git-content
|
||||
mountPath: /git
|
||||
- name: nginx-config
|
||||
mountPath: /etc/nginx/conf.d/default.conf
|
||||
subPath: default.conf
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
port: 8080
|
||||
path: /health
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
port: 8080
|
||||
path: /health
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 32Mi
|
||||
limits:
|
||||
memory: 64Mi
|
||||
- name: git-sync
|
||||
image: registry.k8s.io/git-sync/git-sync:v4.5.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: GITSYNC_REPO
|
||||
value: "https://${GITEA_HOST}/oleksandr/blog.git"
|
||||
- name: GITSYNC_ROOT
|
||||
value: "/git"
|
||||
- name: GITSYNC_REF
|
||||
value: "gh-pages"
|
||||
- name: GITSYNC_LINK
|
||||
value: "current"
|
||||
- name: GITSYNC_DEPTH
|
||||
value: "1"
|
||||
- name: GITSYNC_PERIOD
|
||||
value: "30s"
|
||||
- name: GITSYNC_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-git-credentials
|
||||
key: GITSYNC_USERNAME
|
||||
- name: GITSYNC_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-git-credentials
|
||||
key: GITSYNC_PASSWORD
|
||||
securityContext:
|
||||
runAsUser: 65533
|
||||
runAsGroup: 65533
|
||||
volumeMounts:
|
||||
- name: git-content
|
||||
mountPath: /git
|
||||
resources:
|
||||
requests:
|
||||
cpu: 5m
|
||||
memory: 32Mi
|
||||
limits:
|
||||
memory: 64Mi
|
||||
volumes:
|
||||
- name: git-content
|
||||
emptyDir: {}
|
||||
- name: nginx-config
|
||||
configMap:
|
||||
name: blog-nginx-config
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: blog
|
||||
namespace: blog
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- ${BLOG_HOST}
|
||||
secretName: blog-tls
|
||||
rules:
|
||||
- host: ${BLOG_HOST}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: blog
|
||||
port:
|
||||
number: 8080
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: blog
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: default-deny-ingress
|
||||
namespace: blog
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-controller
|
||||
namespace: blog
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: blog
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: traefik
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: blog-git-credentials
|
||||
namespace: blog
|
||||
stringData:
|
||||
GITSYNC_USERNAME: ENC[AES256_GCM,data:6cZnsgZ53xsU,iv:j2qvZr+odimHPnlMKz9xTe8q+zXvyRDF9spH8TkcmBw=,tag:ik6DJ4cMfcNc5UHY5vRy3A==,type:str]
|
||||
GITSYNC_PASSWORD: ENC[AES256_GCM,data:mjQJuOuH2YQ1i1JVO+lFZ7WYLmy4RjCi2xZRErU5hRNi2SdgRo0fwg==,iv:9pl3nVmlnynJ4jMke1Hy4ACBuMyM+65vmGR2kS705I0=,tag:K1dQ9YwVN0sZjieAOU3KWw==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYR3FFRWdPajVzbjZGem1N
|
||||
OXA2aVhtSWRxQUpGcDFxLzBFQWkyMlh5L2pvCkgvM25IVTBqSFZ3QmJDaGxqSTJ2
|
||||
blQyOTQwaThRbkhzZ01uUmVoaXg5VHMKLS0tIHJJWlJoSmRXRi90M2VHSTlvdnBH
|
||||
VjRWTHRSWUE0VFpqakwxUmx3aENqYUUK21JXxrt792sHoI2TCYU3aIQKKLL9f8oq
|
||||
1o+qkueVYSYmVetrqcjSWqfGE496BYi+pd4a0mmRwaLpLCZIIgtlvA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1zffnskvuezntkk703a0pyxsd5m8vx2hm33dr47wdfy8mn4fdw4sqgw0jgc
|
||||
encrypted_regex: ^(data|stringData|email)$
|
||||
lastmodified: "2026-05-11T19:21:18Z"
|
||||
mac: ENC[AES256_GCM,data:/G7ttapGuQ942iVOeUGqIlCUm+yCFmmxbD4AWRJW/TCJkXI/krkGrDGPX8eQ2BLO9yWga93Ni+fm5tTwGd9mhg9+JkiMMrIoQHb8hm+HqZwFoW3KtxrcLPg0Gi973ecbXkrKszLWqBlBJPU8iuHg+6uicDsrE9TDKOUswc0HdQw=,iv:MISyqpFmGkVqldK1deix2auDXt6PPFXY+Z0A4q4iJwU=,tag:tn0XgaX9+/I89MRUqqcxDw==,type:str]
|
||||
version: 3.13.0
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: blog
|
||||
namespace: blog
|
||||
spec:
|
||||
selector:
|
||||
app: blog
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: 8080
|
||||
name: http
|
||||
@@ -2,3 +2,6 @@ apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: gitea
|
||||
labels:
|
||||
# act_runner DinD sidecar requires privileged; relax PSA enforce for this ns
|
||||
pod-security.kubernetes.io/enforce: privileged
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: gitea-actions
|
||||
namespace: flux-system
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: actions
|
||||
version: 0.1.0
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: gitea
|
||||
namespace: flux-system
|
||||
targetNamespace: gitea
|
||||
interval: 1m0s
|
||||
install:
|
||||
remediation:
|
||||
retries: 3
|
||||
upgrade:
|
||||
remediation:
|
||||
retries: 3
|
||||
dependsOn:
|
||||
- name: gitea
|
||||
# chart 0.1.0 has a broken `global.storageClass` helper (extra newline breaks YAML),
|
||||
# so we set storageClassName via a kustomize patch instead.
|
||||
postRenderers:
|
||||
- kustomize:
|
||||
patches:
|
||||
- target:
|
||||
kind: StatefulSet
|
||||
name: gitea-gitea-actions-act-runner
|
||||
patch: |
|
||||
- op: add
|
||||
path: /spec/volumeClaimTemplates/0/spec/storageClassName
|
||||
value: nfs-synology-ssd
|
||||
values:
|
||||
enabled: true
|
||||
giteaRootURL: http://gitea-gitea-http.gitea.svc.cluster.local:3000
|
||||
existingSecret: gitea-runner-token
|
||||
existingSecretKey: token
|
||||
statefulset:
|
||||
replicas: 1
|
||||
timezone: Europe/Kyiv
|
||||
persistence:
|
||||
size: 10Gi
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
memory: 2Gi
|
||||
actRunner:
|
||||
config: |
|
||||
log:
|
||||
level: info
|
||||
cache:
|
||||
enabled: true
|
||||
container:
|
||||
require_docker: true
|
||||
docker_timeout: 300s
|
||||
runner:
|
||||
labels:
|
||||
- "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
|
||||
- "ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04"
|
||||
- "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
|
||||
dind:
|
||||
rootless: false
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: gitea-runner-token
|
||||
namespace: gitea
|
||||
stringData:
|
||||
token: ENC[AES256_GCM,data:FyNROq6IY5SYfhiFTV5FoXcFrhyYaDh7x5alZw+J7KRNw4sUQEni2g==,iv:aEFhinL9lsD/Cja3ZIa70AguBtba1qUXC2JOGsSU+Nc=,tag:6Z6HPZQAUgVa6+bQ3weM/g==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJaXZiU2RRZU9XbjY3S3Mz
|
||||
anpQV1c4SDJuUEUyYjJldEE1RG9YdTMyMlg4CkFuU3NtMk9nbDEvWWlhUWtzNklI
|
||||
bjBBMjdlQlNqK0dpeU9VdTkvZ3lCdFUKLS0tIE4yWWpsM3B3MSsxdjd0V3hoeUgy
|
||||
UW5pcm01ZXk5cE8rZzR4K1RzcUdxYVEKWxiIA3KFYxXAx803x9GayNi3Sv9DkeC0
|
||||
zbedDZCevB5xiQ5tFekmgu8A6FIMB/lF1IqSqYcUVa6YYcUVfIZmaw==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1zffnskvuezntkk703a0pyxsd5m8vx2hm33dr47wdfy8mn4fdw4sqgw0jgc
|
||||
encrypted_regex: ^(data|stringData|email)$
|
||||
lastmodified: "2026-05-11T18:04:32Z"
|
||||
mac: ENC[AES256_GCM,data:a2l+uFG4HRJRqk7Gj0UsAzexaLwwv5ffNMjs6Oz7esCcAZf/941Yn13evk3hWOsqMTO3AWj5B9blgtakYYO5y5dmI8mD8GdoXiCZF69NCLSGvGuLL6HH3mvp/ZjQQypHQF0W1O4vntdbra4FJp1Nm9iulWeFG/DAO5F8eiv87tU=,iv:Z47KwItcBzBDA1lTZNB9UUGlFUV3jHDrrGyF6AaH+9Q=,tag:0h1dB/WL2MRThvnuj4VT+w==,type:str]
|
||||
version: 3.13.0
|
||||
@@ -35,11 +35,11 @@ stringData:
|
||||
SEERR_HOST: ENC[AES256_GCM,data:l64ttp+rLNU8GfwIE4fhJROSMDEb,iv:1vHOw0LyGN9OMhYemhtRq9GE2fc4J2EprZU3bp/h4kk=,tag:WNV0Jh7816ra7IIOBMspBg==,type:str]
|
||||
FIREFLY_HOST: ENC[AES256_GCM,data:EQdrW33PVlD/brZCqh/sTkqLdPWW/bo=,iv:zbNnjsT1J6lpCEWtvNyL4A3bjWsusCjI5goWcZ8hajk=,tag:VwA6YA056bsyYIKB+X59bw==,type:str]
|
||||
GITEA_HOST: ENC[AES256_GCM,data:Ky3tXS9E9iadabpVzoK5zEbigmtn,iv:t6OdQeQ7Kxzb7qbi+KeoOkJd0XE2Dse5P1fFyiHM6tg=,tag:GpmHtVDr0IQVbpbALVx40g==,type:str]
|
||||
BLOG_HOST: ENC[AES256_GCM,data:eADRFTla/PPFLVCoP9uKvPZ1YhY=,iv://xbCGLkZ6guGMDU0MnVtGR0adgMqNbe0zrCerj7w8k=,tag:HHXvN6y3YvJ4U4TkENkYVA==,type:str]
|
||||
BACKUP_LOCAL_HOST: ENC[AES256_GCM,data:ABaTI3NKkhF7K2FpPwvvrHA0l/tCxAi4Qek=,iv:34ixxSpKU1c12uoMdk4nz2Vo/+5A/npB7NWMsWFytIM=,tag:qjw2fQBebCKnqCnAPiBHaw==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- recipient: age1zffnskvuezntkk703a0pyxsd5m8vx2hm33dr47wdfy8mn4fdw4sqgw0jgc
|
||||
enc: |
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXekorS3lvckhHelE0NGVP
|
||||
Z0JSSmtTRk1yZEoxTVU4MnhaN2VjajU2cmhnCkEyWU0yandxUnZGZm5yWXJmQlM4
|
||||
@@ -47,7 +47,8 @@ sops:
|
||||
MGJ6TFpwR0diNjlEN2syZkhNMFNwRDQK9pzmQGB0GQu6ogMIJW+kugvBNj3w+dxW
|
||||
bfEF9GAznIM/N5rPytF4wNgqwfoAF7GwumgA+iD43wprKtUJn+6dqw==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2026-04-29T19:47:22Z"
|
||||
mac: ENC[AES256_GCM,data:WgVeGY1tGl3Y97FRGNVEkM2J4WKeHil6ki2Jsww1QOsAdGyL7QaL0vPpfRfDc8FRHhyeahS7ShacUvBKnL5Lihxnrqhkd8wA0BgxONk0k/W8/WtU/tvhXpTwxTWgQ5VyPtX3QwwkAcGTARBu+Xrp2y9QGXU8NPO56eH6cUGPEW4=,iv:KjZbbRfhy4ZHtv38MHlX8jxK+9pp/U2aGaX+d8HRK3E=,tag:wcdQVdpYR9czzeYMi554oQ==,type:str]
|
||||
recipient: age1zffnskvuezntkk703a0pyxsd5m8vx2hm33dr47wdfy8mn4fdw4sqgw0jgc
|
||||
encrypted_regex: ^(data|stringData|email)$
|
||||
version: 3.12.2
|
||||
lastmodified: "2026-05-11T19:20:10Z"
|
||||
mac: ENC[AES256_GCM,data:eA4MCmIA7iuC6gelQqWfIWPBb5w+93BLfU2ZhqLMbIna+OIk0tOjogcVz89H+x72ryMB+39a1vD+cYzLcF16Zl0uVHB5UiK9UDssJ26nbt8SK18F9Ew0a0WLp+gCj2qNAB2Od8+rLOKccfmHm1x+C5RuvYnRE4A1U1VNu6sPx3Q=,iv:epN8ZWNF0taoWm94eR+Unx9TUvjSIlKMgacLfbyj94w=,tag:a9f+8K7SOQmFJaZZ2PjnMQ==,type:str]
|
||||
version: 3.13.0
|
||||
|
||||
Reference in New Issue
Block a user