REFACTOR(apps): migrate to app-template

- docusaurus: Replace with app-template, configmap in manifests/
- homer: Replace with app-template, configMapGenerator for config.yml
- crafty: Replace with app-template, pvc/ingress/service in manifests/
- mas: Replace with app-template, rbac/external-secret in manifests/
- All apps use app-template chart v3.6.1
This commit is contained in:
2026-01-06 15:42:07 +09:00
parent 753543648b
commit be6723cc55
29 changed files with 453 additions and 532 deletions

View File

@@ -8,6 +8,15 @@ metadata:
spec:
project: default
sources:
- repoURL: https://bjw-s.github.io/helm-charts
chart: app-template
targetRevision: 3.6.1
helm:
valueFiles:
- $values/docusaurus/helm-values.yaml
- repoURL: https://github.com/K3S-HOME/applications.git
targetRevision: main
ref: values
- repoURL: https://github.com/K3S-HOME/applications.git
targetRevision: main
path: docusaurus
@@ -18,11 +27,8 @@ spec:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
backoff:
@@ -32,15 +38,3 @@ spec:
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10
ignoreDifferences:
- group: apps
kind: Deployment
jqPathExpressions:
- .metadata.annotations
- group: ''
kind: Service
name: docusaurus
namespace: docusaurus
jsonPointers:
- /spec/clusterIP

View File

@@ -1,118 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: docusaurus
namespace: docusaurus
labels:
app: docusaurus
spec:
replicas: 1
selector:
matchLabels:
app: docusaurus
template:
metadata:
labels:
app: docusaurus
annotations:
docusaurus/source-hash: "2024-12-30-v1"
spec:
initContainers:
- name: build-docusaurus
image: node:18-alpine
workingDir: /workspace
command:
- sh
- -c
- |
apk add --no-cache git
echo "Cloning repository..."
git clone https://github.com/K3S-HOME/applications.git /tmp/repo
cd /tmp/repo/docusaurus/asset
echo "Installing dependencies..."
npm install --legacy-peer-deps
echo "Building Docusaurus site..."
npm run build
echo "Copying build output..."
cp -r build/. /build/
echo "Build complete!"
volumeMounts:
- name: build-output
mountPath: /build
containers:
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
name: http
volumeMounts:
- name: build-output
mountPath: /usr/share/nginx/html
- name: nginx-config
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 128Mi
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: build-output
emptyDir: {}
- name: nginx-config
configMap:
name: nginx-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: docusaurus
data:
default.conf: |
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Enable gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json;
# Redirect root to intro page
location = / {
return 301 /intro/;
}
# SPA fallback
location / {
try_files $uri $uri/ /intro/index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}

104
docusaurus/helm-values.yaml Normal file
View File

@@ -0,0 +1,104 @@
# docusaurus - bjw-s/app-template values
# Documentation site with build-time static generation
controllers:
main:
annotations:
docusaurus/source-hash: "2024-12-30-v1"
initContainers:
build-docusaurus:
image:
repository: node
tag: 18-alpine
command:
- sh
- -c
- |
apk add --no-cache git
echo "Cloning repository..."
git clone https://github.com/K3S-HOME/applications.git /tmp/repo
cd /tmp/repo/docusaurus/asset
echo "Installing dependencies..."
npm install --legacy-peer-deps
echo "Building Docusaurus site..."
npm run build
echo "Copying build output..."
cp -r build/. /build/
echo "Build complete!"
containers:
main:
image:
repository: nginx
tag: alpine
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 128Mi
probes:
liveness:
enabled: true
custom: true
spec:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 10
readiness:
enabled: true
custom: true
spec:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 5
service:
main:
controller: main
ports:
http:
port: 80
ingress:
main:
enabled: true
className: traefik
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: docusaurus0213.kro.kr
paths:
- path: /
service:
identifier: main
port: http
tls:
- secretName: docusaurus-tls
hosts:
- docusaurus0213.kro.kr
persistence:
build-output:
enabled: true
type: emptyDir
globalMounts:
- path: /build
advancedMounts:
main:
build-docusaurus:
- path: /build
main:
- path: /usr/share/nginx/html
nginx-config:
enabled: true
type: configMap
name: nginx-config
advancedMounts:
main:
main:
- path: /etc/nginx/conf.d/default.conf
subPath: default.conf

View File

@@ -1,27 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: docusaurus-ingress
namespace: docusaurus
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
spec:
ingressClassName: traefik
tls:
- hosts:
- docusaurus0213.kro.kr
secretName: docusaurus-tls
rules:
- host: docusaurus0213.kro.kr
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: docusaurus
port:
number: 80

View File

@@ -1,7 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml
namespace: docusaurus
resources:
- manifests/configmap.yaml

View File

@@ -0,0 +1,40 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: docusaurus
data:
default.conf: |
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Enable gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json;
# Redirect root to intro page
location = / {
return 301 /intro/;
}
# SPA fallback
location / {
try_files $uri $uri/ /intro/index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}

View File

@@ -1,16 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: docusaurus
namespace: docusaurus
labels:
app: docusaurus
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
selector:
app: docusaurus