commit 9763b1e682eb663e572b79dc96ad6fdef4c98a02 Author: Mayne0213 Date: Wed Dec 17 15:11:34 2025 +0900 INIT(repo): apps setup with all user-facing servic diff --git a/code-server/argocd/code-server.yaml b/code-server/argocd/code-server.yaml new file mode 100644 index 0000000..45b8293 --- /dev/null +++ b/code-server/argocd/code-server.yaml @@ -0,0 +1,40 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: code-server + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + - repoURL: https://github.com/coder/code-server.git + targetRevision: main + path: ci/helm-chart + helm: + valueFiles: + - $values/code-server/helm-values/code-server.yaml + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + ref: values + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: code-server + + destination: + server: https://kubernetes.default.svc + namespace: dev-tools + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m diff --git a/code-server/helm-values/code-server.yaml b/code-server/helm-values/code-server.yaml new file mode 100644 index 0000000..9e39241 --- /dev/null +++ b/code-server/helm-values/code-server.yaml @@ -0,0 +1,69 @@ +fullnameOverride: code-server + +image: + repository: codercom/code-server + tag: 4.104.2 + pullPolicy: Always + +# Persistence configuration for workspace data +persistence: + enabled: true + accessMode: ReadWriteOnce + size: 20Gi + storageClassName: local-path + +# Use existing secret for password +existingSecret: code-server-password +existingSecretKey: password + +# Ingress configuration (will use main ingress) +ingress: + enabled: false + +# Service configuration +service: + type: ClusterIP + port: 8080 + +# Resource limits +resources: + requests: + cpu: 300m # Reduced to 30% of original (1000m -> 300m) + memory: 4Gi # 4GB (within available ~15GB) + +# Security context +securityContext: + enabled: true + fsGroup: 1000 + runAsUser: 1000 + +# Volume permissions +volumePermissions: + enabled: true + +# Extra arguments for code-server +extraArgs: + - --auth + - password + +# Extra environment variables +extraVars: + - name: TZ + value: "Asia/Seoul" + +# Health checks +livenessProbe: + enabled: true + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 10 + +readinessProbe: + enabled: true + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 diff --git a/code-server/kustomization.yaml b/code-server/kustomization.yaml new file mode 100644 index 0000000..f40f9eb --- /dev/null +++ b/code-server/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리 + # - argocd/code-server.yaml + - vault/code-server-password.yaml diff --git a/code-server/vault/code-server-password.yaml b/code-server/vault/code-server-password.yaml new file mode 100644 index 0000000..6c86e73 --- /dev/null +++ b/code-server/vault/code-server-password.yaml @@ -0,0 +1,18 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: code-server-password + namespace: dev-tools +spec: + refreshInterval: 1h + secretStoreRef: + kind: ClusterSecretStore + name: vault-backend + target: + name: code-server-password + creationPolicy: Owner + data: + - secretKey: password + remoteRef: + key: dev-tools/code-server + property: PASSWORD diff --git a/docusaurus/.gitignore b/docusaurus/.gitignore new file mode 100644 index 0000000..0e46c5c --- /dev/null +++ b/docusaurus/.gitignore @@ -0,0 +1,20 @@ +# Dependencies +node_modules/ +package-lock.json + +# Production +build/ +.docusaurus/ +.cache-loader/ + +# Generated files +.DS_Store +Thumbs.db + +# Misc +.env +.env.local +.env.*.local +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/docusaurus/argocd/docusaurus.yaml b/docusaurus/argocd/docusaurus.yaml new file mode 100644 index 0000000..0252438 --- /dev/null +++ b/docusaurus/argocd/docusaurus.yaml @@ -0,0 +1,53 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: docusaurus + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: docusaurus + + destination: + server: https://kubernetes.default.svc + namespace: docusaurus + + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + + syncOptions: + - CreateNamespace=true + - PrunePropagationPolicy=foreground + - PruneLast=true + + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m + + revisionHistoryLimit: 10 + + # Ignore differences in checksum annotations and manual restart annotations + ignoreDifferences: + - group: apps + kind: Deployment + jqPathExpressions: + - .spec.template.metadata.annotations + - .metadata.annotations + + - group: "" + kind: Service + name: docusaurus + namespace: docusaurus + jsonPointers: + - /spec/clusterIP diff --git a/docusaurus/blog/2025-12-17-welcome.md b/docusaurus/blog/2025-12-17-welcome.md new file mode 100644 index 0000000..109e891 --- /dev/null +++ b/docusaurus/blog/2025-12-17-welcome.md @@ -0,0 +1,25 @@ +--- +slug: welcome +title: Welcome to Infrastructure Docs +authors: + name: Bluemayne + title: Infrastructure Engineer +tags: [welcome, infrastructure] +--- + +# Welcome to Infrastructure Documentation + +Welcome to our infrastructure documentation site! This is where we'll document all our infrastructure setup, guides, and best practices. + + + +## What's New + +We've just launched this documentation site using Docusaurus. Here you'll find: + +- Complete infrastructure setup guides +- Service documentation +- Troubleshooting tips +- Best practices + +Stay tuned for more updates! diff --git a/docusaurus/deployment.yaml b/docusaurus/deployment.yaml new file mode 100644 index 0000000..40a0c63 --- /dev/null +++ b/docusaurus/deployment.yaml @@ -0,0 +1,117 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: docusaurus +--- +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 + 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://gitea0213.kro.kr/bluemayne/infrastructure.git /tmp/repo + cd /tmp/repo/docusaurus + 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: + cpu: 200m + 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; + + # SPA fallback + location / { + try_files $uri $uri/ /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; + } diff --git a/docusaurus/docs/getting-started/architecture.md b/docusaurus/docs/getting-started/architecture.md new file mode 100644 index 0000000..2e8e454 --- /dev/null +++ b/docusaurus/docs/getting-started/architecture.md @@ -0,0 +1,103 @@ +--- +sidebar_position: 2 +--- + +# Architecture + +## System Architecture + +Our infrastructure follows modern DevOps practices with GitOps at its core. + +### GitOps Workflow + +```mermaid +graph LR + A[Developer] -->|Git Push| B[Gitea] + B -->|Webhook| C[ArgoCD] + C -->|Deploy| D[Kubernetes] + D -->|Metrics| E[Prometheus] + E -->|Visualize| F[Grafana] +``` + +### Network Architecture + +#### Ingress Layer +- **nginx-ingress-controller**: Routes external traffic +- **cert-manager**: Manages SSL certificates via Let's Encrypt +- **DNS**: kro.kr domain with wildcard support + +#### Application Layer +- Each service runs in its own namespace +- Resource limits and requests defined +- Health checks and readiness probes + +#### Data Layer +- **PostgreSQL**: Primary database for Gitea, Grafana +- **Persistent Volumes**: Using local-path provisioner +- **Backup**: Automated backups to S3-compatible storage (MinIO) + +### Security Architecture + +```yaml +Security Layers: + 1. Network Level: + - Ingress with TLS termination + - Network policies between namespaces + + 2. Application Level: + - External Secrets for sensitive data + - HashiCorp Vault integration + - Secret rotation policies + + 3. Access Control: + - RBAC for Kubernetes + - SSO integration (future) + - Audit logging +``` + +## Design Principles + +### 1. Everything as Code +- Infrastructure: Kubernetes YAML +- Configuration: Kustomize +- Secrets: External Secrets Operator +- Monitoring: Prometheus rules as code + +### 2. GitOps First +- Single source of truth: Git repository +- Automatic synchronization via ArgoCD +- Rollback capability through Git history + +### 3. Observability +- Metrics: Prometheus +- Logs: Loki +- Traces: (Future: Jaeger/Tempo) +- Dashboards: Grafana + +### 4. High Availability +- Multi-node Kubernetes cluster +- Replicated stateful services +- Automated failover + +## Technology Stack + +| Layer | Technology | +|-------|-----------| +| Container Orchestration | Kubernetes (K3s) | +| GitOps | ArgoCD | +| Service Mesh | (Future: Istio/Linkerd) | +| Ingress | nginx-ingress | +| Certificate Management | cert-manager | +| Secrets Management | External Secrets + Vault | +| Monitoring | Prometheus + Grafana | +| Logging | Loki + Promtail | +| Storage | local-path, MinIO | +| Database | PostgreSQL | +| Git | Gitea | +| Documentation | Docusaurus | + +## Further Reading + +- [Kubernetes Setup Details](../services/kubernetes) +- [ArgoCD Configuration](../services/argocd) +- [Monitoring Stack](../services/monitoring) diff --git a/docusaurus/docs/getting-started/overview.md b/docusaurus/docs/getting-started/overview.md new file mode 100644 index 0000000..8a6c7be --- /dev/null +++ b/docusaurus/docs/getting-started/overview.md @@ -0,0 +1,67 @@ +--- +sidebar_position: 1 +--- + +# Overview + +## Infrastructure at a Glance + +Our infrastructure is designed for **high availability**, **automation**, and **easy management**. + +### Key Components + +#### 🎯 Kubernetes (K3s) +- Lightweight Kubernetes distribution +- Running on Oracle Cloud Infrastructure +- Multi-node cluster for redundancy + +#### 🔄 ArgoCD +- GitOps-based deployment +- Automatic synchronization from Git +- Declarative infrastructure management + +#### 🔐 Security +- **cert-manager**: Automatic SSL/TLS certificates +- **External Secrets**: Vault integration for secrets management +- **Network Policies**: Fine-grained network access control + +#### 📊 Monitoring +- **Prometheus**: Metrics collection +- **Grafana**: Visualization and dashboards +- **Loki**: Log aggregation +- **Alertmanager**: Alert management + +### Infrastructure Layout + +``` +┌─────────────────────────────────────────┐ +│ Load Balancer / Ingress │ +│ (nginx-ingress-controller) │ +└─────────────────┬───────────────────────┘ + │ + ┌──────────┴──────────┐ + │ │ +┌──────▼──────┐ ┌────────▼────────┐ +│ Master │ │ Worker Nodes │ +│ Node │ │ │ +│ │ │ - Applications │ +│ - Control │ │ - Services │ +│ Plane │ │ - Monitoring │ +│ - ArgoCD │ │ │ +└─────────────┘ └─────────────────┘ +``` + +### Services Running + +| Service | Purpose | URL | +|---------|---------|-----| +| Homer | Dashboard | https://homer0213.kro.kr | +| Gitea | Git Service | https://gitea0213.kro.kr | +| Grafana | Monitoring | https://grafana0213.kro.kr | +| Docusaurus | Documentation | https://docusaurus0213.kro.kr | + +## Next Steps + +- [Learn about the architecture](./architecture) +- [Explore Kubernetes setup](../services/kubernetes) +- [Set up monitoring](../services/monitoring) diff --git a/docusaurus/docs/intro.md b/docusaurus/docs/intro.md new file mode 100644 index 0000000..2634e13 --- /dev/null +++ b/docusaurus/docs/intro.md @@ -0,0 +1,40 @@ +--- +sidebar_position: 1 +--- + +# Introduction + +Welcome to the **Infrastructure Documentation**! + +This documentation site contains comprehensive guides and references for our entire infrastructure setup. + +## What's Inside? + +- **Getting Started**: Learn about our infrastructure architecture and how to get started +- **Services**: Detailed documentation for each service we run +- **Guides**: Step-by-step tutorials and best practices +- **Blog**: Updates, announcements, and technical insights + +## Infrastructure Overview + +Our infrastructure is built on: + +- **Kubernetes (K3s)**: Container orchestration platform +- **ArgoCD**: GitOps continuous delivery +- **Gitea**: Self-hosted Git service +- **Prometheus & Grafana**: Monitoring and observability +- **cert-manager**: Automatic SSL certificate management + +## Quick Links + +- [Architecture Overview](./getting-started/architecture) +- [Kubernetes Setup](./services/kubernetes) +- [Monitoring Stack](./services/monitoring) + +## Getting Help + +If you have questions or need assistance: + +1. Check the documentation sections +2. Search for specific topics +3. Visit our [Gitea repository](https://gitea0213.kro.kr/bluemayne/infrastructure) diff --git a/docusaurus/docs/services/argocd.md b/docusaurus/docs/services/argocd.md new file mode 100644 index 0000000..f78707b --- /dev/null +++ b/docusaurus/docs/services/argocd.md @@ -0,0 +1,169 @@ +--- +sidebar_position: 2 +--- + +# ArgoCD + +## Overview + +**ArgoCD** is our GitOps continuous delivery tool. It automatically synchronizes applications from our Git repository to Kubernetes. + +## How It Works + +```mermaid +graph LR + A[Git Repository] -->|Watch| B[ArgoCD] + B -->|Compare| C[Desired State] + B -->|Compare| D[Actual State in K8s] + B -->|Sync| E[Deploy Changes] +``` + +## Application Structure + +Each service has an ArgoCD Application definition: + +```yaml +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: example-service + namespace: argocd +spec: + project: default + source: + repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: example-service + destination: + server: https://kubernetes.default.svc + namespace: example-service + syncPolicy: + automated: + prune: true + selfHeal: true +``` + +## Key Features + +### Automated Sync + +- **prune: true**: Removes resources deleted from Git +- **selfHeal: true**: Reverts manual changes to match Git +- **allowEmpty: false**: Prevents accidental empty deployments + +### Manual Operations + +```bash +# List applications +sudo kubectl get applications -n argocd + +# View application status +sudo kubectl get application -n argocd -o yaml + +# Force refresh +argocd app get --refresh +``` + +## Deployment Workflow + +### 1. Make Changes + +Edit files in the infrastructure repository: + +```bash +cd /path/to/infrastructure +vim example-service/deployment.yaml +git add . +git commit -m "update deployment" +git push +``` + +### 2. ArgoCD Detects Changes + +- Polls Git repository every 3 minutes +- Or immediately via webhook (if configured) + +### 3. Automatic Sync + +- Compares desired state (Git) vs actual state (K8s) +- Applies changes automatically +- Reports status + +### 4. Monitor Deployment + +```bash +# Check application sync status +sudo kubectl get applications -n argocd + +# Watch pod rollout +sudo kubectl rollout status deployment/ -n +``` + +## Common Patterns + +### Adding a New Service + +1. Create service directory: `infrastructure/my-service/` +2. Add Kubernetes manifests +3. Create kustomization.yaml +4. Add ArgoCD Application: `infrastructure/my-service/argocd/my-service.yaml` +5. Reference in main kustomization.yaml +6. Git push → ArgoCD deploys automatically + +### Updating a Service + +1. Edit deployment.yaml or other files +2. Git commit & push +3. Wait for ArgoCD sync (or force refresh) +4. Verify deployment + +### Rolling Back + +```bash +# Method 1: Git revert +git revert +git push + +# Method 2: Sync to specific commit +argocd app sync --revision +``` + +## Troubleshooting + +### Sync Stuck + +```bash +# Force hard refresh +sudo kubectl patch application -n argocd \ + -p '{"metadata": {"annotations": {"argocd.argoproj.io/refresh": "hard"}}}' \ + --type merge +``` + +### Out of Sync + +Check what's different: + +```bash +argocd app diff +``` + +### Sync Failed + +View detailed error: + +```bash +sudo kubectl describe application -n argocd +``` + +## Best Practices + +1. **Always use Git**: Don't make manual kubectl changes +2. **Small commits**: Easier to review and rollback +3. **Test locally**: Use `kubectl apply --dry-run=client` +4. **Use pruning**: Keep cluster clean with `prune: true` +5. **Enable selfHeal**: Prevent configuration drift + +## Next Steps + +- [Monitoring with Prometheus](./monitoring) +- [Kubernetes Operations](./kubernetes) diff --git a/docusaurus/docs/services/kubernetes.md b/docusaurus/docs/services/kubernetes.md new file mode 100644 index 0000000..90e5e67 --- /dev/null +++ b/docusaurus/docs/services/kubernetes.md @@ -0,0 +1,174 @@ +--- +sidebar_position: 1 +--- + +# Kubernetes (K3s) + +## Overview + +We use **K3s**, a lightweight Kubernetes distribution, as our container orchestration platform. + +## Cluster Setup + +### Nodes + +- **Master Node**: `oracle-master` + - Control plane components + - etcd database + - ArgoCD installation + +- **Worker Nodes**: `mayne-worker-1`, `mayne-worker-2`, etc. + - Application workloads + - Monitoring stack + - Service deployments + +### Access + +```bash +# SSH to master node +ssh oracle-master + +# Use kubectl (requires sudo on master) +sudo kubectl get nodes +sudo kubectl get pods -A +``` + +## Common Operations + +### View All Resources + +```bash +# Get all namespaces +sudo kubectl get namespaces + +# Get all pods in all namespaces +sudo kubectl get pods -A + +# Get services +sudo kubectl get services -A +``` + +### Check Application Status + +```bash +# Check specific namespace +sudo kubectl get all -n + +# View pod logs +sudo kubectl logs -n + +# Describe pod for troubleshooting +sudo kubectl describe pod -n +``` + +### Managing Applications + +Most applications are managed by ArgoCD, so manual kubectl operations are rarely needed. + +```bash +# Check ArgoCD applications +sudo kubectl get applications -n argocd + +# Force sync an application (if needed) +sudo kubectl patch application -n argocd \ + -p '{"metadata": {"annotations": {"argocd.argoproj.io/refresh": "hard"}}}' \ + --type merge +``` + +## Namespaces + +Each service runs in its own namespace for isolation: + +| Namespace | Purpose | +|-----------|---------| +| `argocd` | ArgoCD deployment | +| `cert-manager` | Certificate management | +| `ingress-nginx` | Ingress controller | +| `monitoring` | Prometheus, Grafana | +| `gitea` | Git service | +| `vault` | Secrets management | + +## Storage + +### Storage Classes + +- **local-path**: Default storage class + - Uses local disk on worker nodes + - Good for development and non-critical data + +### Persistent Volumes + +```bash +# View PVCs +sudo kubectl get pvc -A + +# View PVs +sudo kubectl get pv +``` + +## Networking + +### Ingress + +External traffic flows through nginx-ingress-controller: + +``` +Internet → nginx-ingress → Service → Pod +``` + +### Services + +- **ClusterIP**: Internal only (default) +- **LoadBalancer**: External access (rarely used) +- **Ingress**: HTTPS with custom domains + +## Troubleshooting + +### Pod Not Starting + +```bash +# Check pod events +sudo kubectl describe pod -n + +# Check logs +sudo kubectl logs -n + +# Check previous container logs (if crashed) +sudo kubectl logs -n --previous +``` + +### Resource Issues + +```bash +# Check node resources +sudo kubectl top nodes + +# Check pod resources +sudo kubectl top pods -A +``` + +### Network Issues + +```bash +# Check services +sudo kubectl get svc -A + +# Check ingress +sudo kubectl get ingress -A + +# Test connectivity from a pod +sudo kubectl run -it --rm debug --image=nicolaka/netshoot --restart=Never -- /bin/bash +``` + +## Best Practices + +1. **Use namespaces** for logical separation +2. **Set resource limits** on all containers +3. **Use health checks** (readiness and liveness probes) +4. **Label everything** for better organization +5. **Don't run as root** (use securityContext) + +## Next Steps + +- [ArgoCD Setup](./argocd) +- [Monitoring Stack](./monitoring) diff --git a/docusaurus/docs/services/monitoring.md b/docusaurus/docs/services/monitoring.md new file mode 100644 index 0000000..c94726b --- /dev/null +++ b/docusaurus/docs/services/monitoring.md @@ -0,0 +1,225 @@ +--- +sidebar_position: 3 +--- + +# Monitoring Stack + +## Overview + +Our monitoring stack provides complete observability with metrics, logs, and visualization. + +## Components + +### Prometheus + +**Metrics collection and storage** + +- Scrapes metrics from all services +- Stores time-series data +- Powers alerting rules + +Access: Internal only (no direct UI exposure) + +### Grafana + +**Visualization and dashboards** + +- Beautiful dashboards +- Query Prometheus data +- Alert management UI + +Access: https://grafana0213.kro.kr + +### Loki + +**Log aggregation** + +- Collects logs from all pods +- Indexed for fast searching +- Integrated with Grafana + +### Promtail + +**Log shipping agent** + +- Runs on each node +- Forwards logs to Loki +- Adds metadata labels + +### Alertmanager + +**Alert routing and notification** + +- Receives alerts from Prometheus +- Routes to correct channels +- Deduplication and grouping + +## Dashboards + +### Pre-built Dashboards + +1. **Cluster Overview** + - Node health + - Resource usage + - Pod status + +2. **Application Metrics** + - Request rate + - Error rate + - Response time + +3. **Infrastructure** + - CPU, Memory, Disk + - Network traffic + - Storage usage + +### Creating Custom Dashboards + +```bash +# Export existing dashboard +curl -s http://grafana:3000/api/dashboards/uid/ > dashboard.json + +# Import via UI +Grafana → Dashboards → Import → Upload JSON +``` + +## Querying Metrics + +### PromQL Examples + +```promql +# CPU usage by pod +rate(container_cpu_usage_seconds_total[5m]) + +# Memory usage +container_memory_working_set_bytes + +# HTTP request rate +rate(http_requests_total[5m]) + +# Error rate +rate(http_requests_total{status=~"5.."}[5m]) +``` + +## Alerts + +### Viewing Alerts + +```bash +# List Prometheus rules +sudo kubectl get prometheusrules -n monitoring + +# View Alertmanager status +sudo kubectl get alertmanagers -n monitoring +``` + +### Common Alerts + +- **HighCPUUsage**: Pod using >80% CPU +- **HighMemoryUsage**: Pod using >80% memory +- **PodCrashLooping**: Pod restarting frequently +- **DiskSpaceLow**: Node disk >85% full + +## Log Queries + +### LogQL Examples + +```logql +# All logs from a namespace +{namespace="my-app"} + +# Error logs +{namespace="my-app"} |= "error" + +# Parse JSON logs +{namespace="my-app"} | json | level="error" + +# Count errors +count_over_time({namespace="my-app"} |= "error" [5m]) +``` + +## Accessing Monitoring Data + +### Grafana UI + +1. Navigate to https://grafana0213.kro.kr +2. Log in with credentials +3. Browse dashboards or create queries + +### Port Forwarding (Development) + +```bash +# Prometheus UI +sudo kubectl port-forward -n monitoring svc/prometheus-operated 9090:9090 + +# Access at http://localhost:9090 + +# Alertmanager UI +sudo kubectl port-forward -n monitoring svc/alertmanager-operated 9093:9093 + +# Access at http://localhost:9093 +``` + +## Troubleshooting + +### No Metrics Showing + +```bash +# Check Prometheus targets +sudo kubectl exec -n monitoring prometheus-0 -- promtool check config /etc/prometheus/prometheus.yml + +# Verify service monitors +sudo kubectl get servicemonitors -A +``` + +### Grafana Not Loading Data + +```bash +# Check Grafana logs +sudo kubectl logs -n monitoring deployment/grafana + +# Verify datasource configuration +sudo kubectl get secret -n monitoring grafana-datasources -o yaml +``` + +### High Cardinality Issues + +Too many unique label combinations can cause performance issues: + +```bash +# Check series count +curl http://prometheus:9090/api/v1/status/tsdb | jq '.data.seriesCountByMetricName' +``` + +## Best Practices + +1. **Set up alerts proactively**: Don't wait for incidents +2. **Use labels wisely**: Avoid high cardinality +3. **Create focused dashboards**: One purpose per dashboard +4. **Set retention policies**: Balance storage vs history +5. **Document custom metrics**: Help future maintainers + +## Metrics to Monitor + +### Application Level +- Request rate +- Error rate +- Response time (latency) +- Saturation (queue depth) + +### Infrastructure Level +- CPU usage +- Memory usage +- Disk I/O +- Network throughput + +### Business Level (Optional) +- User signups +- Active sessions +- Feature usage +- Transaction volume + +## Next Steps + +- [Kubernetes Operations](./kubernetes) +- [ArgoCD Configuration](./argocd) diff --git a/docusaurus/docusaurus.config.js b/docusaurus/docusaurus.config.js new file mode 100644 index 0000000..456775f --- /dev/null +++ b/docusaurus/docusaurus.config.js @@ -0,0 +1,146 @@ +// @ts-check +// `@type` JSDoc annotations allow editor autocompletion and type checking +// (when paired with `@ts-check`). +// There are various equivalent ways to declare your Docusaurus config. +// See: https://docusaurus.io/docs/api/docusaurus-config + +import {themes as prismThemes} from 'prism-react-renderer'; + +/** @type {import('@docusaurus/types').Config} */ +const config = { + title: 'Infrastructure Documentation', + tagline: 'Complete guide to our infrastructure and services', + favicon: 'img/favicon.ico', + + // Set the production url of your site here + url: 'https://docusaurus0213.kro.kr', + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: '/', + + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'bluemayne', // Usually your GitHub org/user name. + projectName: 'infrastructure', // Usually your repo name. + + onBrokenLinks: 'warn', + onBrokenMarkdownLinks: 'warn', + + // Even if you don't use internationalization, you can use this field to set + // useful metadata like html lang. For example, if your site is Chinese, you + // may want to replace "en" with "zh-Hans". + i18n: { + defaultLocale: 'ko', + locales: ['ko', 'en'], + }, + + presets: [ + [ + 'classic', + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ + docs: { + routeBasePath: '/', // Serve docs at the site's root + sidebarPath: './sidebars.js', + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + 'https://gitea0213.kro.kr/bluemayne/infrastructure/src/branch/main/docusaurus/', + }, + blog: { + showReadingTime: true, + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + 'https://gitea0213.kro.kr/bluemayne/infrastructure/src/branch/main/docusaurus/', + }, + theme: { + customCss: './src/css/custom.css', + }, + }), + ], + ], + + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // Replace with your project's social card + image: 'img/docusaurus-social-card.jpg', + navbar: { + title: 'Infrastructure Docs', + logo: { + alt: 'Infrastructure Logo', + src: 'img/logo.svg', + }, + items: [ + { + type: 'docSidebar', + sidebarId: 'tutorialSidebar', + position: 'left', + label: 'Documentation', + }, + {to: '/blog', label: 'Blog', position: 'left'}, + { + type: 'localeDropdown', + position: 'right', + }, + { + href: 'https://gitea0213.kro.kr/bluemayne/infrastructure', + label: 'Gitea', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Docs', + items: [ + { + label: 'Documentation', + to: '/docs/intro', + }, + ], + }, + { + title: 'Services', + items: [ + { + label: 'Homer', + href: 'https://homer0213.kro.kr', + }, + { + label: 'Gitea', + href: 'https://gitea0213.kro.kr', + }, + { + label: 'Grafana', + href: 'https://grafana0213.kro.kr', + }, + ], + }, + { + title: 'More', + items: [ + { + label: 'Blog', + to: '/blog', + }, + { + label: 'Repository', + href: 'https://gitea0213.kro.kr/bluemayne/infrastructure', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} Infrastructure Documentation. Built with Docusaurus.`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + }), +}; + +export default config; diff --git a/docusaurus/ingress.yaml b/docusaurus/ingress.yaml new file mode 100644 index 0000000..0690520 --- /dev/null +++ b/docusaurus/ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: docusaurus + 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: nginx + 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 diff --git a/docusaurus/kustomization.yaml b/docusaurus/kustomization.yaml new file mode 100644 index 0000000..f42f58d --- /dev/null +++ b/docusaurus/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리 + # - argocd/docusaurus.yaml + - deployment.yaml + - service.yaml + - ingress.yaml + +namespace: docusaurus diff --git a/docusaurus/package.json b/docusaurus/package.json new file mode 100644 index 0000000..14c99f0 --- /dev/null +++ b/docusaurus/package.json @@ -0,0 +1,44 @@ +{ + "name": "infrastructure-docs", + "version": "1.0.0", + "private": true, + "scripts": { + "docusaurus": "docusaurus", + "start": "docusaurus start", + "build": "docusaurus build", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy", + "clear": "docusaurus clear", + "serve": "docusaurus serve", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids" + }, + "dependencies": { + "@docusaurus/core": "^3.1.0", + "@docusaurus/preset-classic": "^3.1.0", + "@mdx-js/react": "^3.0.0", + "clsx": "^2.0.0", + "prism-react-renderer": "^2.3.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@docusaurus/module-type-aliases": "^3.1.0", + "@docusaurus/types": "^3.1.0" + }, + "browserslist": { + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "engines": { + "node": ">=18.0" + } +} diff --git a/docusaurus/service.yaml b/docusaurus/service.yaml new file mode 100644 index 0000000..ce261a5 --- /dev/null +++ b/docusaurus/service.yaml @@ -0,0 +1,16 @@ +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 diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js new file mode 100644 index 0000000..79565db --- /dev/null +++ b/docusaurus/sidebars.js @@ -0,0 +1,45 @@ +/** + * Creating a sidebar enables you to: + - create an ordered group of docs + - render a sidebar for each doc of that group + - provide next/previous navigation + + The sidebars can be generated from the filesystem, or explicitly defined here. + + Create as many sidebars as you want. + */ + +// @ts-check + +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + // By default, Docusaurus generates a sidebar from the docs folder structure + tutorialSidebar: [ + 'intro', + { + type: 'category', + label: 'Getting Started', + items: ['getting-started/overview', 'getting-started/architecture'], + }, + { + type: 'category', + label: 'Services', + items: ['services/kubernetes', 'services/argocd', 'services/monitoring'], + }, + ], + + // But you can create a sidebar manually + /* + tutorialSidebar: [ + 'intro', + 'hello', + { + type: 'category', + label: 'Tutorial', + items: ['tutorial-basics/create-a-document'], + }, + ], + */ +}; + +export default sidebars; diff --git a/docusaurus/src/css/custom.css b/docusaurus/src/css/custom.css new file mode 100644 index 0000000..2bc6a4c --- /dev/null +++ b/docusaurus/src/css/custom.css @@ -0,0 +1,30 @@ +/** + * Any CSS included here will be global. The classic template + * bundles Infima by default. Infima is a CSS framework designed to + * work well for content-centric websites. + */ + +/* You can override the default Infima variables here. */ +:root { + --ifm-color-primary: #2e8555; + --ifm-color-primary-dark: #29784c; + --ifm-color-primary-darker: #277148; + --ifm-color-primary-darkest: #205d3b; + --ifm-color-primary-light: #33925d; + --ifm-color-primary-lighter: #359962; + --ifm-color-primary-lightest: #3cad6e; + --ifm-code-font-size: 95%; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); +} + +/* For readability concerns, you should choose a lighter palette in dark mode. */ +[data-theme='dark'] { + --ifm-color-primary: #25c2a0; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); +} diff --git a/homer/argocd/homer.yaml b/homer/argocd/homer.yaml new file mode 100644 index 0000000..4539210 --- /dev/null +++ b/homer/argocd/homer.yaml @@ -0,0 +1,31 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: homer + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: homer + + destination: + server: https://kubernetes.default.svc + namespace: homer + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m diff --git a/homer/assets/custom.css b/homer/assets/custom.css new file mode 100755 index 0000000..25b9df7 --- /dev/null +++ b/homer/assets/custom.css @@ -0,0 +1,142 @@ +@charset "UTF-8"; + +/* raleway-regular - latin */ +@font-face { + font-family: 'Raleway'; + font-style: normal; + font-weight: 400; + src: url('./fonts/raleway-v22-latin-regular.eot'); /* IE9 Compat Modes */ + src: local(''), + url('./fonts/raleway-v22-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('./fonts/raleway-v22-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('./fonts/raleway-v22-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('./fonts/raleway-v22-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('./fonts/raleway-v22-latin-regular.svg#Raleway') format('svg'); /* Legacy iOS */ +} + +/* lato-regular - latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: url('./fonts/lato-v20-latin-regular.eot'); /* IE9 Compat Modes */ + src: local(''), + url('./fonts/lato-v20-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('./fonts/lato-v20-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('./fonts/lato-v20-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('./fonts/lato-v20-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('./fonts/lato-v20-latin-regular.svg#Lato') format('svg'); /* Legacy iOS */ +} + +/* lato-700 - latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 700; + src: url('./fonts/lato-v20-latin-700.eot'); /* IE9 Compat Modes */ + src: local(''), + url('./fonts/lato-v20-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('./fonts/lato-v20-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('./fonts/lato-v20-latin-700.woff') format('woff'), /* Modern Browsers */ + url('./fonts/lato-v20-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('./fonts/lato-v20-latin-700.svg#Lato') format('svg'); /* Legacy iOS */ +} + +/* lato-900 - latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 900; + src: url('./fonts/lato-v20-latin-900.eot'); /* IE9 Compat Modes */ + src: local(''), + url('./fonts/lato-v20-latin-900.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('./fonts/lato-v20-latin-900.woff2') format('woff2'), /* Super Modern Browsers */ + url('./fonts/lato-v20-latin-900.woff') format('woff'), /* Modern Browsers */ + url('./fonts/lato-v20-latin-900.ttf') format('truetype'), /* Safari, Android, iOS */ + url('./fonts/lato-v20-latin-900.svg#Lato') format('svg'); /* Legacy iOS */ +} + +/* Sets the group title to be a bolder font */ +.group-title { + font-family: Lato; + font-weight: 800; +} + +/* Changes the card title to be a bolder font */ +.title { + font-weight: 700; +} + +/* Changes the subtitle to be a bolder font */ +.subtitle { + font-weight: 500; +} + +/* Adds spacing to the bottom of cards */ +body #app .card-content { + margin-bottom: 0.75rem; +} + + /*Adds more border radius to the cards */ +body .layout-vertical .column div:first-of-type .card { + border-radius: 1rem; +} +body .layout-vertical .card { + border-radius: 1rem; +} +.card { + border-radius: 1rem; +} +body .layout-vertical .column div:last-of-type .card { + border-radius: 1rem; +} + +/* Changes Header Opacity */ +body #bighead .first-line { + background-color: rgba(0, 0, 0, 0); +} +body #bighead .navbar { + background-color: rgba(0, 0, 0, 0); +} + +body .search-bar input { + opacity: 20%; +} + +body #bighead .navbar a:focus, body #bighead .navbar a:hover { + background-color: rgba(0, 0, 0, 0); + color: var(--link-hover); +} + +/* Blur card backgrounds - Light mode */ +.card { + background-color: rgba(248, 247, 245, 0.85) !important; + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +/* Dark theme card background */ +[data-theme="dark"] .card, +.dark .card { + background-color: rgba(24, 28, 58, 0.75) !important; + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); +} + +/* Group title styling */ +.group-title { + color: var(--text-header) !important; +} + +/* Card hover effect */ +.card:hover { + transform: translateY(-2px); + transition: transform 0.2s ease; +} + +/* Hide theme toggle button only */ +.navbar-item[aria-label="Toggle dark mode"] { + display: none !important; +} \ No newline at end of file diff --git a/homer/assets/favicon.ico b/homer/assets/favicon.ico new file mode 100644 index 0000000..465adad Binary files /dev/null and b/homer/assets/favicon.ico differ diff --git a/homer/assets/fonts/lato-v20-latin-700.eot b/homer/assets/fonts/lato-v20-latin-700.eot new file mode 100755 index 0000000..0d9dac2 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-700.eot differ diff --git a/homer/assets/fonts/lato-v20-latin-700.svg b/homer/assets/fonts/lato-v20-latin-700.svg new file mode 100755 index 0000000..077653d --- /dev/null +++ b/homer/assets/fonts/lato-v20-latin-700.svg @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homer/assets/fonts/lato-v20-latin-700.ttf b/homer/assets/fonts/lato-v20-latin-700.ttf new file mode 100755 index 0000000..4f3d844 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-700.ttf differ diff --git a/homer/assets/fonts/lato-v20-latin-700.woff b/homer/assets/fonts/lato-v20-latin-700.woff new file mode 100755 index 0000000..abf0196 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-700.woff differ diff --git a/homer/assets/fonts/lato-v20-latin-700.woff2 b/homer/assets/fonts/lato-v20-latin-700.woff2 new file mode 100755 index 0000000..f8c37ec Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-700.woff2 differ diff --git a/homer/assets/fonts/lato-v20-latin-900.eot b/homer/assets/fonts/lato-v20-latin-900.eot new file mode 100755 index 0000000..b3d3327 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-900.eot differ diff --git a/homer/assets/fonts/lato-v20-latin-900.svg b/homer/assets/fonts/lato-v20-latin-900.svg new file mode 100755 index 0000000..775c5ae --- /dev/null +++ b/homer/assets/fonts/lato-v20-latin-900.svg @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homer/assets/fonts/lato-v20-latin-900.ttf b/homer/assets/fonts/lato-v20-latin-900.ttf new file mode 100755 index 0000000..92a5f7c Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-900.ttf differ diff --git a/homer/assets/fonts/lato-v20-latin-900.woff b/homer/assets/fonts/lato-v20-latin-900.woff new file mode 100755 index 0000000..6f201e0 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-900.woff differ diff --git a/homer/assets/fonts/lato-v20-latin-900.woff2 b/homer/assets/fonts/lato-v20-latin-900.woff2 new file mode 100755 index 0000000..2f647be Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-900.woff2 differ diff --git a/homer/assets/fonts/lato-v20-latin-regular.eot b/homer/assets/fonts/lato-v20-latin-regular.eot new file mode 100755 index 0000000..c641306 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-regular.eot differ diff --git a/homer/assets/fonts/lato-v20-latin-regular.svg b/homer/assets/fonts/lato-v20-latin-regular.svg new file mode 100755 index 0000000..55b43fb --- /dev/null +++ b/homer/assets/fonts/lato-v20-latin-regular.svg @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homer/assets/fonts/lato-v20-latin-regular.ttf b/homer/assets/fonts/lato-v20-latin-regular.ttf new file mode 100755 index 0000000..3c2d417 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-regular.ttf differ diff --git a/homer/assets/fonts/lato-v20-latin-regular.woff b/homer/assets/fonts/lato-v20-latin-regular.woff new file mode 100755 index 0000000..189a0fe Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-regular.woff differ diff --git a/homer/assets/fonts/lato-v20-latin-regular.woff2 b/homer/assets/fonts/lato-v20-latin-regular.woff2 new file mode 100755 index 0000000..6904b66 Binary files /dev/null and b/homer/assets/fonts/lato-v20-latin-regular.woff2 differ diff --git a/homer/assets/fonts/raleway-v22-latin-regular.eot b/homer/assets/fonts/raleway-v22-latin-regular.eot new file mode 100755 index 0000000..c1caad9 Binary files /dev/null and b/homer/assets/fonts/raleway-v22-latin-regular.eot differ diff --git a/homer/assets/fonts/raleway-v22-latin-regular.svg b/homer/assets/fonts/raleway-v22-latin-regular.svg new file mode 100755 index 0000000..eca08e1 --- /dev/null +++ b/homer/assets/fonts/raleway-v22-latin-regular.svg @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homer/assets/fonts/raleway-v22-latin-regular.ttf b/homer/assets/fonts/raleway-v22-latin-regular.ttf new file mode 100755 index 0000000..9d0afd6 Binary files /dev/null and b/homer/assets/fonts/raleway-v22-latin-regular.ttf differ diff --git a/homer/assets/fonts/raleway-v22-latin-regular.woff b/homer/assets/fonts/raleway-v22-latin-regular.woff new file mode 100755 index 0000000..90dbc4a Binary files /dev/null and b/homer/assets/fonts/raleway-v22-latin-regular.woff differ diff --git a/homer/assets/fonts/raleway-v22-latin-regular.woff2 b/homer/assets/fonts/raleway-v22-latin-regular.woff2 new file mode 100755 index 0000000..b614f0d Binary files /dev/null and b/homer/assets/fonts/raleway-v22-latin-regular.woff2 differ diff --git a/homer/assets/icons/apple-touch-icon.png b/homer/assets/icons/apple-touch-icon.png new file mode 100755 index 0000000..c444c5c Binary files /dev/null and b/homer/assets/icons/apple-touch-icon.png differ diff --git a/homer/assets/icons/argocd.svg b/homer/assets/icons/argocd.svg new file mode 100644 index 0000000..b809ec9 --- /dev/null +++ b/homer/assets/icons/argocd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/docusaurus.svg b/homer/assets/icons/docusaurus.svg new file mode 100644 index 0000000..b7c1831 --- /dev/null +++ b/homer/assets/icons/docusaurus.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homer/assets/icons/favicon-16x16.png b/homer/assets/icons/favicon-16x16.png new file mode 100755 index 0000000..c3e9869 Binary files /dev/null and b/homer/assets/icons/favicon-16x16.png differ diff --git a/homer/assets/icons/favicon-32x32.png b/homer/assets/icons/favicon-32x32.png new file mode 100755 index 0000000..ad5172e Binary files /dev/null and b/homer/assets/icons/favicon-32x32.png differ diff --git a/homer/assets/icons/favicon.ico b/homer/assets/icons/favicon.ico new file mode 100755 index 0000000..ad5172e Binary files /dev/null and b/homer/assets/icons/favicon.ico differ diff --git a/homer/assets/icons/gitea.svg b/homer/assets/icons/gitea.svg new file mode 100644 index 0000000..d9eb11a --- /dev/null +++ b/homer/assets/icons/gitea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/grafana.svg b/homer/assets/icons/grafana.svg new file mode 100644 index 0000000..c482be9 --- /dev/null +++ b/homer/assets/icons/grafana.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/harbor.svg b/homer/assets/icons/harbor.svg new file mode 100644 index 0000000..c96d4f6 --- /dev/null +++ b/homer/assets/icons/harbor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/homer.svg b/homer/assets/icons/homer.svg new file mode 100644 index 0000000..b0fba3c --- /dev/null +++ b/homer/assets/icons/homer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/icon-any.png b/homer/assets/icons/icon-any.png new file mode 100755 index 0000000..c444c5c Binary files /dev/null and b/homer/assets/icons/icon-any.png differ diff --git a/homer/assets/icons/icon-any.svg b/homer/assets/icons/icon-any.svg new file mode 100755 index 0000000..89f4ef7 --- /dev/null +++ b/homer/assets/icons/icon-any.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/icon-maskable.png b/homer/assets/icons/icon-maskable.png new file mode 100755 index 0000000..896ca66 Binary files /dev/null and b/homer/assets/icons/icon-maskable.png differ diff --git a/homer/assets/icons/kubernetes.svg b/homer/assets/icons/kubernetes.svg new file mode 100644 index 0000000..55807cb --- /dev/null +++ b/homer/assets/icons/kubernetes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/logo.svg b/homer/assets/icons/logo.svg new file mode 100644 index 0000000..b0fba3c --- /dev/null +++ b/homer/assets/icons/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/minecraft.svg b/homer/assets/icons/minecraft.svg new file mode 100644 index 0000000..6d624c6 --- /dev/null +++ b/homer/assets/icons/minecraft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/minio.svg b/homer/assets/icons/minio.svg new file mode 100644 index 0000000..6abfcd9 --- /dev/null +++ b/homer/assets/icons/minio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/postgresql.svg b/homer/assets/icons/postgresql.svg new file mode 100644 index 0000000..03078fb --- /dev/null +++ b/homer/assets/icons/postgresql.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/safari-pinned-tab.svg b/homer/assets/icons/safari-pinned-tab.svg new file mode 100755 index 0000000..26dc0ef --- /dev/null +++ b/homer/assets/icons/safari-pinned-tab.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/homer/assets/icons/tekton.webp b/homer/assets/icons/tekton.webp new file mode 100644 index 0000000..0580ca0 Binary files /dev/null and b/homer/assets/icons/tekton.webp differ diff --git a/homer/assets/icons/tilt.svg b/homer/assets/icons/tilt.svg new file mode 100644 index 0000000..e85fc49 --- /dev/null +++ b/homer/assets/icons/tilt.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/homer/assets/icons/umami.svg b/homer/assets/icons/umami.svg new file mode 100644 index 0000000..1e375c3 --- /dev/null +++ b/homer/assets/icons/umami.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/vault.svg b/homer/assets/icons/vault.svg new file mode 100644 index 0000000..1c48582 --- /dev/null +++ b/homer/assets/icons/vault.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/icons/vscode.svg b/homer/assets/icons/vscode.svg new file mode 100644 index 0000000..3f9a35c --- /dev/null +++ b/homer/assets/icons/vscode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/homer/assets/manifest.json b/homer/assets/manifest.json new file mode 100755 index 0000000..9faa093 --- /dev/null +++ b/homer/assets/manifest.json @@ -0,0 +1 @@ +{"name":"Homer Dashboard","short_name":"Homer","theme_color":"#3367D6","icons":[{"src":"./icons/favicon-16x16.png","sizes":"16x16","type":"image/png"},{"src":"./icons/favicon-32x32.png","sizes":"32x32","type":"image/png"},{"src":"./icons/icon-any.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"./icons/icon-any.svg","sizes":"any","type":"image/svg+xml","purpose":"any"},{"src":"./icons/icon-maskable.png","sizes":"512x512","type":"image/png","purpose":"maskable"},{"src":"./icons/safari-pinned-tab.svg","sizes":"any","type":"image/svg+xml","purpose":"monochrome"}],"start_url":"../","display":"standalone","background_color":"#000000"} \ No newline at end of file diff --git a/homer/assets/tools/github.png b/homer/assets/tools/github.png new file mode 100644 index 0000000..731b12e Binary files /dev/null and b/homer/assets/tools/github.png differ diff --git a/homer/assets/tools/reddit.png b/homer/assets/tools/reddit.png new file mode 100755 index 0000000..6936f2c Binary files /dev/null and b/homer/assets/tools/reddit.png differ diff --git a/homer/assets/tools/walkx.png b/homer/assets/tools/walkx.png new file mode 100755 index 0000000..bb52e4d Binary files /dev/null and b/homer/assets/tools/walkx.png differ diff --git a/homer/assets/wallpaper-light.jpeg b/homer/assets/wallpaper-light.jpeg new file mode 100755 index 0000000..8bae8d6 Binary files /dev/null and b/homer/assets/wallpaper-light.jpeg differ diff --git a/homer/assets/wallpaper.jpeg b/homer/assets/wallpaper.jpeg new file mode 100755 index 0000000..84b007c Binary files /dev/null and b/homer/assets/wallpaper.jpeg differ diff --git a/homer/config.yml b/homer/config.yml new file mode 100644 index 0000000..d581f5d --- /dev/null +++ b/homer/config.yml @@ -0,0 +1,303 @@ +# Homepage configuration +# See https://fontawesome.com/v5/search for icons options + +title: "Mayne" +logo: "/assets/icons/homer.svg" +icon: "/assets/icons/homer.svg" + +# Hide header/navbar and footer +header: false # Hide the entire header (including title/logo) +footer: false # Hide the footer + +# Optional CSS +stylesheet: "/assets/custom.css" # path to custom CSS (homer-theme) + +# Optional theme +theme: "default" # 'default' or one of the themes available in 'src/assets/themes' + +# Default settings +defaults: + colorTheme: "light" # Set default theme to light mode + +# Optional columns +columns: "4" # You can change this to any number that is a factor of 12: (1, 2, 3, 4, 6, 12) + +# Optional colors +colors: + light: + highlight-primary: "#3367d6" + highlight-secondary: "#4285f4" + highlight-hover: "#5a95f5" + background: "#f5f5f5" + background-image: "../assets/wallpaper-light.jpeg" + card-background: "#f8f7f5" + text: "#363636" + text-header: "#303030" + text-title: "#303030" + text-subtitle: "#424242" + card-shadow: rgba(0, 0, 0, 0.1) + link: "#3273dc" + link-hover: "#363636" + dark: + highlight-primary: "#181C3A" + highlight-secondary: "#181C3A" + highlight-hover: "#1F2347" + background: "#12152B" + background-image: "../assets/wallpaper.jpeg" + card-background: "#181C3A" + text: "#eaeaea" + text-header: "#7C71DD" + text-title: "#fafafa" + text-subtitle: "#8B8D9C" + card-shadow: rgba(0, 0, 0, 0.5) + link: "#3273dc" + link-hover: "#ffdd57" + +# Optional websocket +websocket: + enabled: false + url: "ws://localhost:8080" + reconnectInterval: 5000 + +# Optional services +services: + - name: "Production" + icon: "fas fa-code" + items: + - name: "Joossam" + logo: "https://joossameng.com/favicon.ico" + subtitle: "OMR Grading API" + tag: "production" + tagstyle: "is-success" + keywords: "omr api" + url: "https://joossameng.com" + target: "_blank" + - name: "Jaejadle" + logo: "https://jaejadle.kro.kr/favicon.ico" + subtitle: "Church Website" + tag: "production" + tagstyle: "is-success" + keywords: "church" + url: "https://jaejadle.kro.kr" + target: "_blank" + - name: "Jotion" + logo: "https://jotion.kro.kr/favicon.ico" + subtitle: "Coming Soon" + tag: "production" + tagstyle: "is-success" + keywords: "jotion" + url: "https://jotion.kro.kr" + target: "_blank" + - name: "Portfolio" + logo: "https://minjo0213.kro.kr/favicon.ico" + subtitle: "Portfolio Site" + tag: "production" + tagstyle: "is-success" + keywords: "portfolio" + url: "https://minjo0213.kro.kr" + target: "_blank" + - name: "Todo" + logo: "https://todo0213.kro.kr/favicon.ico" + subtitle: "Todo Management App" + tag: "production" + tagstyle: "is-success" + keywords: "todo" + url: "https://todo0213.kro.kr" + target: "_blank" + - name: "Jovies" + logo: "https://jovies.kro.kr/favicon.ico" + subtitle: "Movie Service" + tag: "production" + tagstyle: "is-success" + keywords: "movie" + url: "https://jovies.kro.kr" + target: "_blank" + + - name: "Development" + icon: "fas fa-laptop-code" + items: + - name: "Code Server" + logo: "/assets/icons/vscode.svg" + subtitle: "VS Code in the Browser" + tag: "dev" + tagstyle: "is-warning" + keywords: "code editor vscode" + url: "https://vscode0213.kro.kr" + target: "_blank" + - name: "Docusaurus" + logo: "/assets/icons/docusaurus.svg" + subtitle: "Markdown Documentation Site" + tag: "dev" + tagstyle: "is-warning" + keywords: "documentation docusaurus" + url: "https://docusaurus0213.kro.kr" + target: "_blank" + - name: "Gitea" + logo: "/assets/icons/gitea.svg" + subtitle: "Git Service" + tag: "dev" + tagstyle: "is-warning" + keywords: "git gitea" + url: "https://gitea0213.kro.kr" + target: "_blank" + - name: "Homer Dashboard" + logo: "/assets/icons/favicon-32x32.png" + subtitle: "Dashboard" + tag: "dev" + tagstyle: "is-warning" + keywords: "dashboard" + url: "https://mayne.kro.kr" + target: "_blank" + - name: "Minecraft Server" + logo: "/assets/icons/minecraft.svg" + subtitle: "Coming Soon" + tag: "dev" + tagstyle: "is-warning" + keywords: "minecraft game" + url: "https://minecraft0213.kro.kr" + target: "_blank" + - name: "Tilt" + logo: "/assets/icons/tilt.svg" + subtitle: "Coming Soon" + tag: "dev" + tagstyle: "is-warning" + keywords: "Auto Hot Reload" + url: "https://tilt0213.kro.kr" + target: "_blank" + - name: "Umami" + logo: "/assets/icons/umami.svg" + subtitle: "Website Analytics" + tag: "dev" + tagstyle: "is-warning" + keywords: "analytics umami" + url: "https://umami0213.kro.kr" + target: "_blank" + + - name: "Infrastructure" + icon: "fas fa-server" + items: + - name: "ArgoCD" + logo: "/assets/icons/argocd.svg" + subtitle: "GitOps Deployment Tool" + tag: "infra" + tagstyle: "is-info" + keywords: "argocd gitops" + url: "https://argocd0213.kro.kr" + target: "_blank" + - name: "Grafana" + logo: "/assets/icons/grafana.svg" + subtitle: "Monitoring Dashboard" + tag: "infra" + tagstyle: "is-info" + keywords: "grafana monitoring" + url: "https://grafana0213.kro.kr" + target: "_blank" + - name: "Harbor" + logo: "/assets/icons/harbor.svg" + subtitle: "Container Registry" + tag: "infra" + tagstyle: "is-info" + keywords: "harbor registry docker" + url: "https://harbor0213.kro.kr" + target: "_blank" + - name: "Kubernetes Dashboard" + logo: "/assets/icons/kubernetes.svg" + subtitle: "Kubernetes Management Dashboard" + tag: "infra" + tagstyle: "is-info" + keywords: "kubernetes k8s" + url: "https://kubernetes0213.kro.kr" + target: "_blank" + - name: "MinIO Console" + logo: "/assets/icons/minio.svg" + subtitle: "S3 Storage Management" + tag: "infra" + tagstyle: "is-info" + keywords: "minio s3 storage" + url: "https://minio0213.kro.kr" + target: "_blank" + - name: "PgWeb" + logo: "/assets/icons/postgresql.svg" + subtitle: "PostgreSQL Management" + tag: "infra" + tagstyle: "is-info" + keywords: "postgresql pgweb" + url: "https://pgweb0213.kro.kr" + target: "_blank" + - name: "Tekton" + logo: "/assets/icons/tekton.webp" + subtitle: "Coming Soon" + tag: "infra" + tagstyle: "is-info" + keywords: "tekton ci/cd" + url: "https://tekton0213.kro.kr" + target: "_blank" + - name: "Vault" + logo: "/assets/icons/vault.svg" + subtitle: "Secret Management" + tag: "infra" + tagstyle: "is-info" + keywords: "vault management" + url: "https://vault0213.kro.kr" + target: "_blank" + + - name: "Demos" + icon: "fas fa-code-branch" + items: + - name: "PoolC Dev" + logo: "https://dev.poolc.org/favicon.ico" + subtitle: "PoolC Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.poolc.org" + target: "_blank" + - name: "Joossam Dev" + # logo: "https://dev.joossam.com/favicon.ico" + logo: "https://joossameng.com/favicon.ico" + subtitle: "Joossam Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.joossameng.com" + target: "_blank" + - name: "Jaejadle Dev" + logo: "https://dev.jaejadle.kro.kr/favicon.ico" + subtitle: "Jaejadle Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.jaejadle.kro.kr" + target: "_blank" + - name: "Jotion Dev" + logo: "https://dev.jotion.kro.kr/favicon.ico" + subtitle: "Coming Soon" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.jotion.kro.kr" + target: "_blank" + - name: "Portfolio Dev" + logo: "https://dev.minjo0213.kro.kr/favicon.ico" + subtitle: "Portfolio Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.minjo0213.kro.kr" + target: "_blank" + - name: "Todo Dev" + logo: "https://dev.todo0213.kro.kr/favicon.ico" + subtitle: "Todo Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.todo0213.kro.kr" + target: "_blank" + - name: "Jovies Dev" + logo: "https://dev.jovies.kro.kr/favicon.ico" + subtitle: "Jovies Development Environment" + tag: "dev" + tagstyle: "is-warning" + keywords: "dev" + url: "https://dev.jovies.kro.kr" + target: "_blank" \ No newline at end of file diff --git a/homer/homer.yaml b/homer/homer.yaml new file mode 100644 index 0000000..d9ac4a2 --- /dev/null +++ b/homer/homer.yaml @@ -0,0 +1,125 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: homer +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: homer + namespace: homer + labels: + app: homer +spec: + replicas: 1 + selector: + matchLabels: + app: homer + template: + metadata: + labels: + app: homer + spec: + initContainers: + - name: copy-homer-files + image: b4bz/homer:latest + command: ['sh', '-c'] + args: + - | + # Homer의 기본 파일들을 emptyDir로 복사 + cp -r /www/* /tmp/www/ + volumeMounts: + - name: www + mountPath: /tmp/www + - name: copy-assets + image: alpine/git:latest + command: ['sh', '-c'] + args: + - | + # Git에서 assets 복사 + git clone --depth 1 --branch main https://gitea0213.kro.kr/bluemayne/infrastructure.git /tmp/repo + # assets 폴더 덮어쓰기 + rm -rf /www/assets + cp -r /tmp/repo/homer/assets /www/assets + # config.yml 복사 + cp /config/config.yml /www/assets/config.yml + # lighttpd 사용자(uid=1000)가 읽을 수 있도록 권한 변경 + chmod -R 755 /www/assets + chown -R 1000:65533 /www/assets + volumeMounts: + - name: config + mountPath: /config + - name: www + mountPath: /www + containers: + - name: homer + image: b4bz/homer:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + name: http + volumeMounts: + - name: www + mountPath: "/www" + resources: + requests: + memory: "64Mi" + cpu: "50m" + volumes: + - name: config + configMap: + name: homer-config + - name: www + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + name: homer + namespace: homer +spec: + type: ClusterIP + ports: + - name: http + port: 80 + targetPort: 8080 + selector: + app: homer +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: homer-ingress + namespace: homer + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "true" + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + ingressClassName: nginx + tls: + - hosts: + - mayne.kro.kr + - www.mayne.kro.kr + secretName: homer-tls + rules: + - host: mayne.kro.kr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: homer + port: + number: 80 + - host: www.mayne.kro.kr + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: homer + port: + number: 80 diff --git a/homer/kustomization.yaml b/homer/kustomization.yaml new file mode 100644 index 0000000..692ee8a --- /dev/null +++ b/homer/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리 + # - argocd/homer.yaml + - homer.yaml + +# ConfigMap 생성: config.yml만 포함 (assets는 InitContainer에서 Git에서 복사) +configMapGenerator: + - name: homer-config + namespace: homer + files: + - config.yml diff --git a/umami/argocd/umami.yaml b/umami/argocd/umami.yaml new file mode 100644 index 0000000..2cbfbcb --- /dev/null +++ b/umami/argocd/umami.yaml @@ -0,0 +1,50 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: umami + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + - repoURL: https://charts.christianhuth.de + chart: umami + targetRevision: 6.0.1 + helm: + valueFiles: + - $values/umami/helm-values/umami.yaml + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + ref: values + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: umami + + destination: + server: https://kubernetes.default.svc + namespace: analytics + + ignoreDifferences: + # Ignore app-secret data changes in umami-app-secret + # Helm chart generates random app-secret value on each sync, + # causing ArgoCD to detect it as OutOfSync + - group: "" + kind: Secret + name: umami-app-secret + jsonPointers: + - /data + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m diff --git a/umami/helm-values/umami.yaml b/umami/helm-values/umami.yaml new file mode 100644 index 0000000..a81c7ab --- /dev/null +++ b/umami/helm-values/umami.yaml @@ -0,0 +1,65 @@ +fullnameOverride: umami + +image: + tag: postgresql-latest + +# Disable PostgreSQL subchart (using external PostgreSQL) +postgresql: + enabled: false + +# External database configuration +externalDatabase: + type: postgresql + hostname: postgresql-primary.postgresql.svc.cluster.local + port: 5432 + auth: + database: umami + username: bluemayne + # Password is managed via External Secrets Operator (Vault) + +# Use existing secret for sensitive data +database: + existingSecret: umami-password + +# Environment variables from secret +envFrom: + - secretRef: + name: umami-password + +ingress: + enabled: false # Will use our main ingress + +service: + type: ClusterIP + port: 3000 + +resources: + requests: + cpu: 30m # Reduced to 30% of original (100m -> 30m) + memory: 256Mi + +replicaCount: 2 + +# Autoscaling +autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 4 + targetCPUUtilizationPercentage: 80 + +# Health checks +livenessProbe: + enabled: true + httpGet: + path: /api/heartbeat + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 10 + +readinessProbe: + enabled: true + httpGet: + path: /api/heartbeat + port: 3000 + initialDelaySeconds: 10 + periodSeconds: 5 diff --git a/umami/kustomization.yaml b/umami/kustomization.yaml new file mode 100644 index 0000000..42af82c --- /dev/null +++ b/umami/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리 + # - argocd/umami.yaml + - vault/umami-password.yaml diff --git a/umami/vault/umami-password.yaml b/umami/vault/umami-password.yaml new file mode 100644 index 0000000..065cc82 --- /dev/null +++ b/umami/vault/umami-password.yaml @@ -0,0 +1,22 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: umami-password + namespace: analytics +spec: + refreshInterval: 1h + secretStoreRef: + kind: ClusterSecretStore + name: vault-backend + target: + name: umami-password + creationPolicy: Owner + data: + - secretKey: database-url + remoteRef: + key: analytics/umami + property: DATABASE_URL + - secretKey: hash-salt + remoteRef: + key: analytics/umami + property: HASH_SALT