tenant-namespace-operator

by kfox1111

Helm chartv0.1.30App 0.1.25-1

A Helm chart for Kubernetes

About this chart

tenant-namespace-operator

The tenant-namespace-operator chart launches an instance of the tenant-namespace-operator allowing you to quickly deploy tenant-namespaces in a Kubernetes native way.

Install Chart

Apply the CRD's if not already done so:

kubectl apply -f https://raw.githubusercontent.com/pnnl-miscscripts/miscscripts/master/containers/tenant-namespace-operator/config/crd/bases/miscscripts.pnnl.gov_tenantnamespaceflavors.yaml
kubectl apply -f https://raw.githubusercontent.com/pnnl-miscscripts/miscscripts/master/containers/tenant-namespace-operator/config/crd/bases/miscscripts.pnnl.gov_tenantnamespaces.yaml

To install the Chart into your Kubernetes cluster (Helm 3 only) :

kubectl create namespace tenant-namespace-operator
helm upgrade --install tenant-namespace-operator --namespace "tenant-namespace-operator" pnnl-miscscripts/tenant-namespace-operator

After installation succeeds, you can get a status of Chart

helm status "tenant-namespace-operator" --namespace "tenant-namespace-operator"

If you want to delete your Chart, use this command:

helm delete "tenant-namespace-operator"

Usage

You can create a cluster wide tenantnamespace flavor like:

apiVersion: miscscripts.pnnl.gov/v1beta1
kind: TenantNamespaceFlavor
metadata:
  name: example
spec: {}

To deploy a tenant namespace named example, you may do so like:

apiVersion: miscscripts.pnnl.gov/v1beta1
kind: TenantNamespace
metadata:
  name: example
spec:
  flavorRef:
    name: example
    kind: TenantNamespaceFlavor
    group: miscscripts.pnnl.gov

When a flavorRef is specified, settings in the flavor are added to the TenantNamespace. The TenantNamespace config overrides the flavor config.

The content of the spec in both TenantNamespaceFlavor and TenantNamespace are values as specified here:

https://gitlab.com/gitlab-org/charts/tenant-namespace/blob/master/values.yaml

Deploy tenant-namespace-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tenant-namespace-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttenant-namespace-operator is pinned at v0.1.30 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply