website-and-documentation/content/en/docs/documentation/publishing.md
Stephan Lo 9aea2a3583 feat(docs): add comprehensive documentation platform architecture and guides
Created a complete documentation system for new documentors, including
interactive architecture diagrams and step-by-step guides for all documentation
workflows.

New LikeC4 architecture project (resources/doc-likec4/):
- Created documentation-platform.c4 model with 252 lines covering:
  * Actors: documentor, reviewer, CI system, edge platform
  * Tools: Hugo, LikeC4, Git, VS Code, markdownlint, htmltest
  * Processes: local development, testing, CI/CD pipeline
  * Repositories: git repo, cloudlet registry
- Defined 6 comprehensive views:
  * overview: Complete documentation platform ecosystem
  * localDevelopment: Local writing and preview workflow
  * cicdPipeline: Automated testing and validation
  * deploymentFlow: From commit to production
  * fullWorkflow: End-to-end documentation lifecycle
  * testingCapabilities: Quality assurance toolchain

New documentation pages (content/en/docs/documentation/):
- _index.md: Overview and introduction for new documentors
- local-development.md: Setting up local environment, live preview
- testing.md: Running markdown, HTML, and link validation
- cicd.md: Understanding automated CI/CD pipeline
- publishing.md: Deployment to Edge Connect Munich cloudlet
- quick-reference.md: Command reference and common tasks

Hugo shortcode for embedding LikeC4 diagrams:
- Created layouts/shortcodes/likec4-view.html
- Supports loading state with animated indicator
- Graceful error handling for missing views
- Automatic shadow DOM checking to ensure webcomponent loaded
- Usage: {{< likec4-view view="viewId" project="projectName" >}}

Supporting documentation:
- resources/LIKEC4-REGENERATION.md: Guide for regenerating webcomponents
- All diagrams are interactive and explorable in the browser
- Views include zoom, pan, and element inspection

This implementation provides:
1. Self-documenting documentation platform ("meta-documentation")
2. Visual learning for complex workflows via interactive diagrams
3. Clear separation of concerns (6 focused views vs 1 overwhelming diagram)
4. Onboarding path for new team members
5. Living architecture documentation that evolves with the platform

All new documentation passes markdown linting and builds successfully.
2025-11-07 11:50:58 +01:00

6.9 KiB

title linkTitle weight description
Publishing to Edge Publishing 50 How documentation is deployed to the edge environment.

Deployment Overview

After successful CI/CD, the documentation is deployed to an edge computing environment.

{{< likec4-view view="deploymentFlow" project="documentation-platform" >}}

Deployment Architecture

Edge Connect Platform

Our documentation is deployed using Edge Connect, which orchestrates deployments to edge cloudlets.

Configuration: edgeconnectdeployment.yaml

kind: edgeconnect-deployment
metadata:
  name: "edpdoc"
  appVersion: "1.0.0"
  organization: "edp2"
spec:
  k8sApp:
    manifestFile: "./k8s-deployment.yaml"
  infraTemplate:
    - region: "EU"
      cloudletOrg: "TelekomOP"
      cloudletName: "Munich"
      flavorName: "EU.small"

Key settings:

  • Deployment name: edpdoc
  • Region: EU (Munich)
  • Cloudlet: TelekomOP Munich
  • Flavor: EU.small (resource allocation)

Kubernetes Deployment

The application runs on Kubernetes: k8s-deployment.yaml

Service Definition

apiVersion: v1
kind: Service
metadata:
  name: edpdoc
  labels:
    run: edpdoc
spec:
  type: LoadBalancer
  ports:
    - name: tcp80
      protocol: TCP
      port: 80
      targetPort: 80
  selector:
    run: edpdoc
  • Type: LoadBalancer (external access)
  • Port: 80 (HTTP)
  • Selector: Routes traffic to pods with label run: edpdoc

Deployment Configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: edpdoc
spec:
  replicas: 1
  selector:
    matchLabels:
      run: edpdoc
  template:
    metadata:
      labels:
        run: edpdoc
        mexDeployGen: kubernetes-basic
    spec:
      containers:
        - name: edpdoc
          image: ###IMAGETAG###
          imagePullPolicy: Always
          ports:
            - containerPort: 80
              protocol: TCP
  • Replicas: 1 (single instance)
  • Image: Injected by deployment pipeline (###IMAGETAG### placeholder)
  • Pull policy: Always (ensures latest version)

Network Configuration

Outbound connections are configured in edgeconnectdeployment.yaml:

network:
  outboundConnections:
    - protocol: "tcp"
      portRangeMin: 80
      portRangeMax: 80
      remoteCIDR: "0.0.0.0/0"
    - protocol: "tcp"
      portRangeMin: 443
      portRangeMax: 443
      remoteCIDR: "0.0.0.0/0"
  • Port 80: HTTP outbound
  • Port 443: HTTPS outbound
  • CIDR: 0.0.0.0/0 (all destinations)

Deployment Process

1. Container Image Ready

After CI passes:

  • Docker image built with task build:oci-image
  • Tagged with git commit SHA
  • Pushed to container registry

2. Edge Connect Orchestration

Edge Connect:

  1. Pulls container image
  2. Reads edgeconnectdeployment.yaml
  3. Provisions resources on Munich cloudlet
  4. Applies Kubernetes manifests

3. Kubernetes Deployment

Kubernetes:

  1. Creates deployment with 1 replica
  2. Pulls container image (imagePullPolicy: Always)
  3. Starts pod running Nginx + static Hugo site
  4. Creates LoadBalancer service
  5. Assigns external IP

4. Service Available

Documentation is now accessible:

  • Protocol: HTTP
  • Port: 80
  • IP: Assigned by LoadBalancer

Complete Workflow

{{< likec4-view view="fullWorkflow" project="documentation-platform" >}}

End-to-End Process

  1. Documentor writes content (Markdown, LikeC4 models)
  2. Local testing with task serve and task test
  3. Commit and push to Git repository
  4. GitHub Actions triggered on push to main
  5. CI tests run (build, markdown, HTML, links)
  6. Container image built if tests pass
  7. Image pushed to registry
  8. Edge deployment triggered
  9. Kubernetes applies manifests
  10. Service available on edge cloudlet

Monitoring Deployment

Check Deployment Status

kubectl get deployments -n <namespace>
kubectl get pods -n <namespace>
kubectl get services -n <namespace>

View Logs

kubectl logs deployment/edpdoc -n <namespace>

Access Documentation

Find the LoadBalancer external IP:

kubectl get service edpdoc -n <namespace>

Access via: http://<EXTERNAL-IP>

Rollback

If issues occur after deployment:

Option 1: Revert Commit

git revert <bad-commit>
git push origin main

CI will rebuild and redeploy.

Option 2: Manual Rollback

kubectl rollout undo deployment/edpdoc -n <namespace>

Returns to previous deployment version.

Option 3: Deploy Specific Version

Update image tag in deployment:

kubectl set image deployment/edpdoc edpdoc=<registry>/<image>:<tag> -n <namespace>

Scaling

Currently: 1 replica

To scale for higher traffic:

spec:
  replicas: 3

Then apply:

kubectl apply -f k8s-deployment.yaml

Or scale dynamically:

kubectl scale deployment/edpdoc --replicas=3 -n <namespace>

Security Considerations

  1. Image scanning - Scan container images for vulnerabilities
  2. Resource limits - Set CPU/memory limits in deployment
  3. Network policies - Restrict pod-to-pod communication
  4. HTTPS - Consider adding TLS termination (Ingress)

Performance Optimization

  1. CDN - Add CDN in front of LoadBalancer
  2. Caching - Configure Nginx caching headers
  3. Compression - Enable gzip in Nginx
  4. Image optimization - Compress images in documentation

Troubleshooting

Pod not starting

kubectl describe pod <pod-name> -n <namespace>

Check:

  • Image pull errors
  • Resource constraints
  • Configuration errors

Service unreachable

kubectl describe service edpdoc -n <namespace>

Check:

  • LoadBalancer IP assigned
  • Port configuration
  • Network policies

Old content served

Check:

  • imagePullPolicy: Always in deployment
  • Image tag is updated
  • Pod has restarted

Force pod restart:

kubectl rollout restart deployment/edpdoc -n <namespace>

Best Practices

  1. Test before deploying - Always run task test locally
  2. Use feature branches - Don't deploy directly from local
  3. Monitor after deployment - Check logs and access
  4. Document changes - Update RELEASE.md
  5. Version control - Tag releases in Git

Future Enhancements

Potential improvements:

  • Blue-green deployment - Zero-downtime updates
  • Canary releases - Gradual rollout to subset of users
  • Auto-scaling - HorizontalPodAutoscaler based on traffic
  • Multi-region - Deploy to multiple cloudlets
  • HTTPS - TLS certificates and Ingress controller

Summary

The deployment process is automated and reliable:

CI ensures quality - Tests prevent broken deployments Edge infrastructure - Low-latency access from EU Kubernetes orchestration - Reliable, scalable platform Simple rollback - Easy to recover from issues

As a documentor, focus on content quality. The platform handles deployment automatically! 🚀