Skip to main content

Create the Tenant

What You Will Learn

  • How to create a new tenant directory in the Flux repo
  • What the namespace manifest looks like and why it comes first
  • How the file numbering convention keeps everything organized
  • What the kustomization.yaml file does and why it is required

What Is a Tenant?

In Junovy, a tenant is a client or project that gets its own isolated space on the cluster. Each tenant gets:

  • A namespace (like a folder on the cluster that keeps their resources separate)
  • A directory in the dds-k8s-cluster repo (where the manifests live)
  • A naming pattern: hst-<tenant-name>

For your Godot game, the tenant name will be com.junovy.godot-demo.

Think of it like a Godot scene tree: the namespace is the root node, and everything else (Pods, Services, Ingress) are children that live inside it.


Create the Directory

Open the dds-k8s-cluster repo and navigate to the clients/ directory. This is where all tenant directories live.

# Navigate to the Flux repo
cd ~/workspace/junovy/dds-k8s-cluster/clients/

# Create the tenant directory
mkdir -p com.junovy.godot-demo

The File Numbering Convention

Junovy uses numeric prefixes on filenames to control ordering and make the purpose of each file instantly clear. Here is the system:

Prefix Purpose Example
010 Namespace 010-namespace.yaml
020-029 Secrets 020-image-pull-secret.yaml
030-039 ConfigMaps, values 030-configmap.yaml
040-049 Deployments, HelmReleases 040-deployment.yaml
050-059 Services, Ingress 050-service.yaml, 055-ingress.yaml
060-069 RBAC 060-role.yaml
070-079 Jobs, CronJobs 070-backup-job.yaml
080-089 Monitoring 080-service-monitor.yaml
090-099 NetworkPolicies 090-network-policy.yaml
100+ Custom CRDs 100-certificate.yaml

This keeps things predictable. When you open any tenant directory, you always know that 010 is the namespace and 040 is the main workload. No guessing needed.


Create the Namespace Manifest

The namespace must exist before anything else can be created in it. That is why it gets the lowest number: 010.

Create the file clients/com.junovy.godot-demo/010-namespace.yaml:

# 010-namespace.yaml
# Creates the isolated namespace for the Godot demo tenant
# This MUST be applied before any other resource in this directory
apiVersion: v1
kind: Namespace
metadata:
  # Tenant namespaces always follow the pattern: hst-<name>
  name: hst-godot-demo
  labels:
    # These labels help with filtering and policy enforcement
    app.kubernetes.io/part-of: junovy
    junovy.com/tenant: godot-demo

That is the entire file. A namespace is one of the simplest Kubernetes resources -- just a name and some labels.


Create the Kustomization File

Kustomize needs a kustomization.yaml file to know which resources to include. Without this file, Flux will not process the directory.

Create the file clients/com.junovy.godot-demo/kustomization.yaml:

# kustomization.yaml
# Tells Kustomize (and therefore Flux) which manifests to apply
# Resources are listed in the order they should be applied
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  # Namespace first -- everything else depends on it
  - 010-namespace.yaml
  # We will add more resources here in the next step

You will come back and add more entries to this list in the next page when you create the Deployment, Service, and Ingress manifests.


Your Directory So Far

Here is what your tenant directory looks like at this point:

dds-k8s-cluster/
  clients/
    com.junovy.godot-demo/
      kustomization.yaml       # Tells Kustomize what to apply
      010-namespace.yaml       # Creates the com.junovy.godot-demo namespace

Two files. That is all you need to establish a tenant on the cluster. In the next step, you will add the manifests that actually run your game.


Key Takeaways

  • Each tenant gets a directory under dds-k8s-cluster/clients/ with reverse-domain naming (e.g., com.junovy.godot-demo)
  • The file numbering convention (010, 020, 040, 050...) makes file purpose instantly recognizable
  • The namespace manifest (010-namespace.yaml) must be created first because all other resources live inside it
  • The kustomization.yaml file is required for Flux to discover and apply the manifests

What Is Next

Next up: Write the Kustomize Patches where you will create the Deployment, Service, and Ingress that actually run and expose your game.