Skip to content

Kubernetes Manifests Documentation

Deployment

Backend Deployment (backend.yml)

  • API: ASP.NET Core application
  • Ports: 8080 (HTTP), 8443 (HTTPS)
  • Health Checks:
    • Startup: /health/startup (failureThreshold: 30, periodSeconds: 10)
    • Liveness: /api/live (initialDelay: 30s, period: 60s, timeout: 2s)
    • Readiness: /health/ready (initialDelay: 5s, period: 5s, timeout: 2s)
  • Resources: 100m CPU/64Mi min, 500m CPU/128Mi max
  • Autoscaling: 1-10 replicas based on CPU (50%) and memory (70%)

Database (database.yml)

  • Image: PostgreSQL 16
  • Storage: 1Gi PersistentVolume via local-path StorageClass
  • Health Checks:
    • Liveness: TCP check on port 5432
    • Readiness: pg_isready command
  • Service: ClusterIP on port 5432

Frontend (frontend.yml)

  • Image: Nginx
  • Configuration: ConfigMap for Keycloak configuration
  • Ports: 80 (HTTP), 443 (HTTPS)
  • Health Checks:
    • Startup Probe: HTTP GET on / (failureThreshold: 30, periodSeconds: 10)
    • Liveness Probe: HTTP GET on / (initialDelay: 30s, period: 60s, timeout: 2s)
    • Readiness Probe: HTTP GET on / (initialDelay: 5s, period: 5s, timeout: 2s)
    • Resources: 50m CPU/64Mi min, 500m CPU/128Mi max
  • Autoscaling: 1-10 replicas based on CPU (50%) and Memory (70%)

Network (ingress-proxy.yml)

  • Ingress Controller: Nginx
  • Host: cloudstack.staging.tesnix.be
  • Routes:
    • / → Frontend Service
    • /api/* → Backend Service
    • /swagger/* → Backend Service (API documentation)
  • TLS: SSL redirect enforced, certificate via app-tls secret

  • Host: cloudstack.production.tesnix.be
  • Routes:
    • / → Frontend Service
    • /api/* → Backend Service
  • TLS: SSL redirect enforced, certificate via app-tls secret

Authentication (keycloak.yml, keycloak-database.yml)

  • Keycloak: Version 26.0.0
  • Database: Separate PostgreSQL instance
  • Hostname: cloudstack.auth.tesnix.be
  • Proxy Mode: Edge mode with X-Forwarded headers
  • Storage: 1Gi PersistentVolume

Monitoring (uptime-kuma.yml)

  • Image: louislam/uptime-kuma:latest
  • Storage: 5Gi PersistentVolume
  • Host: cloudstack.kuma.tesnix.be
  • Host Aliases: Static DNS mapping for internal services

Cluster Tools

  • Kubernetes Dashboard: Cluster management interface
  • Metrics Server: Collects metrics for HPA and monitoring

Variables

Environment variables are injected via GitLab CI/CD into Kubernetes deployments for secure, environment-specific configuration.

Backend Variables (backend.yml)

CloudStack API Integration

VariableDescriptionExampleRequiredGitLab Settings
CLOUDSTACK_API_URLBase URL of the CloudStack API management endpointhttps://api.cloud.example.com/client/apiVariable
CLOUDSTACK_API_KEYAPI Key - Unique identifier for CloudStack userAbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCMasked Variable
CLOUDSTACK_SECRET_KEYSecret Key for authentication and request signingAbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCMasked Variable
ZONE_IDUUID of default CloudStack zoneb5c9f0d2-8a4e-47c3-9c1f-6a8b7e2d3c5aVariable
SERVICEOFFERING_IDUUID of default compute service offeringd8e7f6a5-4b3c-2d1e-9f0a-8b7c6d5e4f3aVariable

Database Configuration

VariableDescriptionExampleRequiredGitLab Settings
ConnectionStrings__DefaultConnectionPostgreSQL connection string for .NETHost=cloudstack-database;Port=5432;Database=cloudstack;Username=user;Password=pass;N/A (auto-generated)
PG_HOSTPostgreSQL database hostnamecloudstack-databaseVariable
PG_DBPostgreSQL database namecloudstackVariable
PG_USERPostgreSQL usernamecloudstack_userVariable
PG_PASSWORDPostgreSQL passwordsecure_password_123Masked Variable

Authentication & Security

VariableDescriptionExampleRequiredGitLab Settings
AUTH_AUTHORITYOIDC/OAuth2 authority URL (Keycloak)https://cloudstack.auth.{domein naam}.be/realms/stagingVariable
AUTH_AUDIENCEExpected audience for JWT tokenscloudstack-backendVariable
CORS_ALLOWED_ORIGINAllowed origins for CORShttps://cloudstack.staging.{domein naam}.beVariable

Frontend Variables (frontend.yml)

VariableDescriptionExampleRequiredGitLab Settings
CI_ENVIRONMENT_NAMEGitLab CI/CD environment identifierstaging, productionAuto (GitLab CI)
CI_COMMIT_BRANCHGit branch name (used as Keycloak realm)staging, main, feature-branchAuto (GitLab CI)

Database Variables (database.yml)

VariableDescriptionExampleRequiredGitLab Settings
PG_HOSTPostgreSQL database hostnamecloudstack-databaseVariable
PG_DBPostgreSQL database namecloudstackVariable
PG_USERPostgreSQL usernamecloudstack_userVariable
PG_PASSWORDPostgreSQL passwordsecure_password_123Masked Variable

Keycloak Database (keycloak-database.yml)

VariableDescriptionExampleRequiredGitLab Settings
KC_POSTGRES_USERPostgreSQL username for Keycloakkeycloak_userVariable
KC_POSTGRES_PASSWORDPostgreSQL password for Keycloakkeycloak_password_123Masked Variable

Keycloak (keycloak.yml)

VariableDescriptionExampleRequiredGitLab Settings
KC_ADMINKeycloak administrator usernameadminMasked Variable
KC_ADMIN_PASSKeycloak administrator passwordsecure_admin_password_123Masked Variable
KC_POSTGRES_USERPostgreSQL username for Keycloakkeycloak_userVariable
KC_POSTGRES_PASSWORDPostgreSQL password for Keycloakkeycloak_password_123Masked Variable