Skip to main content
Version: v1.2

Multiple Luna instances in a single cluster

To set up different profiles or configurations for various workloads, run multiple Luna instances within a single namespace.

Single Service Account

A single service account can permit Luna to make API calls to the cloud provider for node creation. Run multiple Luna instances using a single service account shared across all deployments. The deployment script deploy.sh creates necessary objects, and all other Luna instances use this service account.

It works like this: the first Luna install creates the service account, and all subsequent install will reference this same service account. Set the Helm value serviceAccount.create=false once the service has been created by the first installation to avoid conflicts.

The initial Luna installation creates the service account, and all subsequent installations will use of the same service account. Once the first installation has created the service account, set the Helm value serviceAccount.create=false to prevent conflicts.

Example

For GKE, first deploy the initial Luna instance on the cluster:

$ cd luna-*/deploy/gke
$ ./deploy.sh --name <cluster> --region <region> --namespace=<namespace> ...
$ kubectl --namespace=<namespace> get deploy

Next, create a Helm values file with the desired configuration:

$ cat <<EOF > my_luna_instance.yaml
appName: my-luna-instance
labels: env=dev,workload=foo
nodeTags:
env: dev
workload: foo
EOF

Then, use Helm to create the new Luna instance, first passing the cluster's values file, then your customized files:

$ helm install luna-instance-1 ./luna-v*.tgz \
--namespace=<namespace> \
-f <cluster>_values.yaml \
-f my-luna-instance.yaml

Repeat for each configuration:

$ helm install luna-instance-2 ./luna-v*.tgz \
--namespace=<namespace> \
--set serviceAccount.create=false \
-f <cluster>_values.yaml \
-f my-luna-instance.yaml

Manage service account with deploy.sh

You can install multiple Luna instances on a single cluster with the deploy.sh script.

In order to manage multiple Luna instances with deploy.sh on a single cluster each instance must have unique name, namespace, and service account prefix.

Kubernetes Service Account Prefix

To customize the Kubernetes service account name’s prefix, use the deploy script option --service-account-prefix <prefix>. When using the --service-account-prefix option: do not specify serviceAccount.prefix with the --additional-helm-values option, it won’t work.

To re-use a single service account across Luna instances, all the instances must be in the same namespace.

For example, here is how to deploy the first Luna instance:

$ ./deploy.sh ... --service-account-prefix my-luna ...

Then to deploy the subsequent Luna instances:

$ ./deploy.sh ... --service-account-prefix my-luna --additional-helm-values '--set serviceAccount.create=false'

For multiple Luna deployments directly with Helm, you can assign a unique Service Account Prefix to each instance. To reuse an existing service account, set serviceAccount.create=false and specify the target account using the same --service-account-prefix <prefix> option.

In case no prefix is specified, the default value is "luna" and the service account names will be luna-manager and luna-webhook.

NOTE: The Helm values serviceAccount.create and serviceAccount.prefix are available for Luna version 0.6.2+. In prior versions, the service account prefix was set to "luna."