Tenant operator guide

Documentation home · Console guide · Field reference

Tenant operators maintain application repositories and ODs inside an assigned namespace. This guide uses namespace team-a, OD web, and an example Git repository. Your cluster administrator provisions the namespace, grants access and defines any admission, quota and registry requirements.

Your scope

An OD outside kube-system runs in tenant mode. Every desired object must be namespaced and belong to that OD's namespace. A manifest without metadata.namespace is placed there automatically. Cluster-scoped objects and objects targeting another namespace invalidate the pass; ask the platform team to provide Namespaces, CRDs, ClusterRoles or other shared infrastructure.

Each OD uses one optional Secret from its own namespace. It can manage another OD in the same namespace, but it cannot create an unrestricted child OD in kube-system. Separate OD workers have separate inventories and ownership.

Create an application source

Use a directory dedicated to the workload inventory:

web-deployments/
  default/
    deployment.json
    10-settings.yaml
    20-web.yaml
    30-service.yaml

default/deployment.json:

{
  "images": {
    "web-image": "docker.io/library/nginx:stable"
  },
  "replacements": {
    "replicas": "2",
    "site-name": "web"
  }
}

The image is an illustrative public example. Use your approved repository and release reference for an actual application.

default/10-settings.yaml:

apiVersion: v1
kind: ConfigMap
metadata:
  name: web-settings
data:
  SITE_NAME: "<!site-name!>"
  ENVIRONMENT: "<!environment!>"

default/20-web.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: <!replicas!>
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
      annotations:
        example.com/source-image-hash: "<!web-image-hash!>"
    spec:
      containers:
        - name: web
          image: "<!web-image!>"
          ports:
            - name: http
              containerPort: 80
          envFrom:
            - configMapRef:
                name: web-settings

default/30-service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  selector:
    app: web
  ports:
    - name: http
      port: 80
      targetPort: http

Commit and push the source before creating an active OD. Orbit reads committed Git content, not uncommitted files in your workstation. Keep generated output and unrelated YAML outside the selected path: all .yaml and .yml documents under it are considered workload input. Filenames are walked in case-insensitive sorted order; CRDs and Namespaces are ordered before ordinary objects during application, but this is not a dependency-readiness system.

Validate before deployment

From the application repository root, use the Orbit image's offline lint mode:

docker run --rm -v "$PWD:/work" -w /work \
  registry.gitlab.com/tak-os-platform/tak-os-containers/orbit-deploy:latest \
  --lint https://git.example.com/team-a/web-deployments.git \
  default environment=staging

Replace the image tag with your approved tool version where required. Supply tokens normally supplied through spec.replacements or cluster defaults. The URL is an exact-match identity for nested ODs; lint uses the local checkout and does not clone it. Exit code is zero for no errors, including warning-only runs, or the error count capped at 255.

Lint validates rendering and shared YAML/resource-shape parsing. It does not contact Kubernetes or registries, validate workload readiness, prove ownership, validate full Kubernetes schemas or guarantee that pruning is intended. Image hashes are simulated. Read the complete lint manual for CI integration and nested-source behavior.

Create the OrbitDeployment

Create an OD manifest outside the selected workload directory unless you deliberately want self-management:

apiVersion: k8s.tlspu.com/v1
kind: OrbitDeployment
metadata:
  name: web
  namespace: team-a
spec:
  source: https://git.example.com/team-a/web-deployments.git
  path: default
  ref: refs/heads/main
  pause: false
  replacements:
    environment: staging

Save it as web-orbitdeployment.yaml and apply it:

kubectl apply -f web-orbitdeployment.yaml
kubectl -n team-a get orbit-deployments.k8s.tlspu.com web -o yaml
kubectl -n team-a rollout status deployment/web --timeout=180s
kubectl -n team-a get pods,service,configmap

Allow time for source access and reconciliation. Inspect the OD's status and controller logs through your platform team if the workload never appears. lastRun and the console's alive indicator do not replace native rollout and application checks.

Git refs, paths and source changes

spec.path defaults to default. Use . deliberately to process the repository root. Paths and linked inputs must stay inside the checkout. A directory's deployment.json and all visited YAML must be readable. Invalid deployment metadata aborts the run; malformed YAML or resource documents are logged and valid documents/files continue. Missing CRDs and Kubernetes object rejections also leave other manifests eligible. Any such item error blocks pruning. A missing selected directory is an error, not an empty desired deployment.

spec.ref can select a remote branch, tag, explicit full ref or available historical commit. Omit it, clear it or use HEAD to follow the remote's current default branch. Branches and tags are refreshed, including forced moves and deletions. A named ref that disappears fails instead of silently using a stale local checkout. An arbitrary Git revision expression such as HEAD~1 is not a supported substitute for a source ref.

Use names such as main, lab or release-1.2.0. Bare names consisting only of 4–40 hexadecimal characters are ambiguous with cached commit IDs. If you must use such a branch or tag, specify refs/heads/... or refs/tags/.... An explicit commit can only be checked out when available locally or through the fetched history; do not assume an unreachable remote commit can be fetched by arbitrary hash.

Changing source URL replaces the checkout. Changing source/ref/path can change the entire desired inventory and prune resources from the previous one. Review removals as carefully as additions.

Before and after rendering, Orbit compares selected files, directories and linked inputs with the selected committed Git tree, independently of the index or file timestamps. Missing/unexpected files, altered metadata and partial checkouts fail before application or pruning. Git LF/CRLF conversion and canonical ident expansions ($Id$ or $Id: <40-hex object ID> $) are accepted; other content-changing checkout filters cause a retrying error. A genuinely committed empty root (spec.path: .) can prune everything previously tracked; a missing selected directory remains an error.

Values and inheritance

Each directory can contain deployment.json with images and replacements maps. Subdirectories inherit values from the processed parent and may override or extend them. Metadata above the selected start path is not implicitly loaded. For example, selecting production does not import a repository-root deployment.json merely because it exists.

For a token <!name!>, precedence is:

  1. Image entries, including matching spec.images overrides.
  2. The OD's spec.replacements.
  3. Current-directory replacements, inherited directory replacements and cluster defaults.

Values may refer to other tokens. Circular or unresolved substitutions fail the pass. Substitution is textual before YAML parsing: quote string values where needed and leave numeric/list tokens unquoted when you intend YAML numbers or lists. spec.replacements values are strings in the CRD. A replacement value does not automatically become a Secret or get hidden from resulting resources.

Cluster defaults include domain, JSON strings for internal node addresses and external_addresses, and any administrator-defined ConfigMap values. Ask your platform team which values exist; explicitly set deployment-specific ones in the OD or repository.

Site-specific sources

A parent can render an OD whose source/path/ref contains cluster tokens, for example selecting one site's directory in a shared repository:

apiVersion: k8s.tlspu.com/v1
kind: OrbitDeployment
metadata:
  name: site-specific
  namespace: kube-system
spec:
  source: https://git.example.com/platform/sites.git
  path: "<!domain!>"

Keep this template in a source rendered by the parent OD so the token becomes a concrete value before the child CR is applied. Use tenant scope instead when the child should manage only its own namespace.

Images and credentials for pulling Pods

Image declarations produce <!image-name!> and generated <!image-name-hash!> tokens. Normal reconciliation resolves the source image and emits a digest-pinned image reference even when the embedded registry is disabled. spec.images overrides matching image declarations throughout the selected tree:

spec:
  images:
    web-image: registry.example.com/team-a/web:release-1.2.0

Use this as a field fragment of the OD, not as a standalone Kubernetes object. An explicit hash replacement in metadata is preserved rather than treated as an automatically generated hash. Image URLs can use ordinary tags, digest references or a tag plus digest. A sanitized k8s.tlspu.com/original-image label records human-readable image provenance on manifests using image tokens; it is informational and can be truncated to the label-length limit. The value contains project/tag pairs for only the image tokens referenced by that manifest, joined with -, sanitized to label characters and limited to 63 bytes. No separate version label is added. A final validation failure skips the label and logs the problem while still deploying the object.

Cluster policy can rewrite source-image registry/path prefixes to a proxy before resolution. The optional embedded registry can also rewrite the pull address when enabled. Ask the platform team for the expected resulting host. Controller credentials used for resolving images are separate from the imagePullSecrets and node trust configuration needed by Kubernetes to start Pods from a private registry. A manifest with a literal image value rather than an image token does not automatically become a declared deployment.json image.

Git and registry credentials

Set spec.secret to an Opaque Secret name in the OD's namespace. Credentials are read on reconciliation. Keep actual credential material out of Git unless your approved secret-management system encrypts or supplies it.

For HTTPS Git, use username and password; the latter can be an access token accepted by the Git provider. A registry credential entry is named for the registry host and contains the string username:password:

apiVersion: v1
kind: Secret
metadata:
  name: web-source
  namespace: team-a
type: Opaque
stringData:
  username: git-reader
  password: REPLACE_WITH_GIT_READ_TOKEN
  registry.example.com: "registry-reader:REPLACE_WITH_REGISTRY_TOKEN"

Then add secret: web-source under the OD's spec. stringData accepts plain strings which Kubernetes stores in data using base64 encoding; base64 is not encryption. The registry entry is the credential format used by Orbit's OCI client, not a .dockerconfigjson image-pull Secret.

For SSH sources such as git@git.example.com:team-a/web-deployments.git or ssh://git@git.example.com/team-a/web-deployments.git, populate these Secret keys:

Key Value
sshPrivateKey Full PEM/OpenSSH private key, normally provided from a local file.
sshPasshrase Optional passphrase. This exact historical spelling is required.
sshKnownHosts Trusted OpenSSH known-host entries, including the correct host/port form.
username Optional SSH user when the source URL does not specify one; default git.

For example, with trusted key and known-host files already provisioned:

kubectl -n team-a create secret generic web-source \
  --from-file=sshPrivateKey=/secure/path/web-deploy-key \
  --from-file=sshKnownHosts=/secure/path/git-known-hosts

The command creates a new Secret; update an existing one through your approved credential-management process. An encrypted key also needs sshPasshrase. Private-key files are normalized to LF line endings with a final newline, even when Secret contents use CRLF or omit the final newline. Supply real line breaks: use plain text with stringData, or base64 encode once in data. Literal \n sequences and double-base64 encoding are not decoded into key text. SSH password and interactive login are disabled. Empty or missing sshKnownHosts accepts the host without verification; provide trusted entries when verification is required. Nonstandard SSH ports use the usual [hostname]:port known-host format.

Current OCI client limitations include native Basic-authenticated registries and registry credential lookup keys containing host:port, which cannot be represented as valid Kubernetes Secret keys. Do not invent an encoding or use a .dockerconfigjson Secret expecting Orbit to read it. Ask the platform team for a supported endpoint; these limitations are tracked in TODO.md.

Conditional manifests

Use paired markers around complete YAML fragments or documents:

<!ifod monitoring!>
apiVersion: v1
kind: ConfigMap
metadata:
  name: monitoring-integration
data:
  enabled: "true"
<!endifod!>

<!ifod name!> includes the block when an OD with that name exists in the worker's namespace or kube-system; <!ifnotod name!> does the inverse. Matching uses names, not workload health or fully qualified namespace/name. Nested markers are supported. Malformed pairing or uncertain cluster lists abort the pass. If a previously included object's block becomes excluded after a valid evaluation, that is a desired-inventory removal and can cause pruning. Offline lint uses names discovered in its local source instead of live lists.

Protect resources and understand recreation

Put Orbit annotations on the managed object's metadata.annotations. A Pod template annotation protects a Pod only if that Pod is itself a managed target; it does not protect the enclosing Deployment from Orbit deleting it.

Annotation Effect
k8s.tlspu.com/no-update: "true" Read only from the rendered Git manifest. Blocks ordinary in-place replaces of existing objects. Creation and recreation DELETE are not blocked.
k8s.tlspu.com/no-delete: "true" Once live, blocks Orbit DELETE of that target during pruning, cleanup or recreation. It does not block an allowed update that removes the flag.
k8s.tlspu.com/recreate-on-change: "true" A changed, previously managed target is deleted then created, rather than replaced. Live no-delete on the old target prevents this.
k8s.tlspu.com/priority: "10" Requests priority 10 for this object; default priority is 1. Higher-priority ownership can prevent another OD applying it.

Legacy noupdate and nodelete spellings are accepted. Truthy values are true, 1, yes and on, ignoring case and surrounding spaces. If either protection spelling is truthy, a false value on the other spelling does not cancel it. Use quoted annotation values.

Remove no-update from Git or set it false to resume ordinary updates. A flag present only on the live object does not block updates and can be removed by the next successful apply. A Git-only flag immediately protects an existing object without requiring an update to install the annotation first. Use both no-update and no-delete when both forms of protection are intended, and account separately for recreate-on-change. A no-delete annotation on a new desired replacement does not protect the old object that recreation deletes.

Nested and self-managed deployments

A parent can apply a child OD as a normal namespaced resource:

apiVersion: k8s.tlspu.com/v1
kind: OrbitDeployment
metadata:
  name: reporting
  annotations:
    k8s.tlspu.com/no-delete: "true"
spec:
  source: https://git.example.com/team-a/reporting-deployments.git
  path: default
  ref: refs/heads/main

In tenant mode the child inherits the parent's namespace. The child runs its own worker; its secret, replacements and images must be configured explicitly as needed. These values are not inherited from the parent's OD spec merely because the child was loaded by it. A parent with an explicit ref supplies that ref to a child manifest which has no ref, so specify the child's intended ref when the repositories have different release names.

After the child's no-delete is live, deleting the parent OD or pruning that child manifest retains the child. Parent tracking/ownership is released; the child's worker and independently managed resources remain. This does not protect it from Namespace deletion. An allowed parent update can remove a child's no-delete flag before a later deletion, so preserve intended protection in the authoritative source.

A source may contain its own OD. Its applied spec becomes authoritative, and Orbit writes status separately so a final status update does not restore an old spec. Changes made directly with kubectl or UI pause actions may be overwritten by that self-manifest or another managing parent.

Update, remove and hand over workloads

For ordinary updates, change and lint Git, commit and push, then observe the next reconciliation and native rollout. Reverting Git or selecting an earlier available release ref is an application rollback request, not a data restore.

Removing an object from a complete valid source makes it eligible for pruning after successful application of the remaining inventory. No manual prune button or approval setting is required. Source or apply errors prevent pruning for that pass; lack of workload readiness does not.

For retention, make sure no-delete is live before removing the source object or deleting the OD. Orbit releases tracking and ownership on a normal protected removal. Plan who will manage the retained resource afterward. Deleting an OD is not equivalent to pausing it: it starts one best-effort cleanup pass, and failed deletions have no durable retry queue.

For a manual pause:

kubectl -n team-a patch orbit-deployments.k8s.tlspu.com web \
  --type=merge -p '{"spec":{"pause":true}}'

Pause does not stop Pods or immediately interrupt an already running pass. Set pause to false to resume. Avoid Purge for ordinary retries because it forgets old tracking, while preserving ownership. The operator guide explains recovery actions and their effects.

When to ask the platform team

Escalate cross-namespace or cluster-scoped requirements, controller/API outages, ownership-map errors, unsupported registry authentication and stuck retirement. Provide the OD namespace/name, source/ref/path, commit you intended to deploy, relevant status errors, object annotations and observed rollout symptoms. Share Secret key names or missing-key symptoms, never credential values.