Define a custom app

Contributors ebarcott netapp-bcammett Download PDF of this page

Creating a custom app lets you group elements of your Kubernetes cluster into a single app.

A custom app gives you more granular control over what to include in a Astra operation, including:

  • Clone

  • Snapshot

  • Backup

  • Protection Policy

In most cases you will want to use Astra’s features on your entire app. However, you can also create a custom app to use these features by the labels you assign to Kubernetes objects in a namespace.

To create a custom app, go to the Apps page and click + Define custom app.

As you make your selections, the Custom App window will show you which resources will be included or excluded from your custom app. This helps you make sure you are choosing the correct criteria for defining your custom app.

A screenshot of the Define Custom App pop-up window showing which resources will and won’t be included in the custom app

In the above example, one resource (the pod nginx-pod0 labeled deployment:canary) will be included in the custom app. Two pods (nginx-pod and nginx-pod2 both labeled deployment:stable) will be excluded.

Custom apps can only be created within a specified namespace on a single cluster. Astra does not support the ability for a custom app to span multiple namespaces or clusters.

A label is a key/value pair you can assign to Kubernetes objects for identification. Labels make it easier to sort, organize, and find your Kubernetes objects. To learn more about Kubernetes labels, see the official Kubernetes documentation.

Overlapping policies for the same resource under different names can cause data conflicts. If you create a custom app for a resource, be sure it’s not being cloned or backed up under any other policies.

Example: Separate Protection Policy for canary release

In this example, the devops team is managing a canary release deployment. Their cluster has three pods running NginX. Two of the pods are dedicated to the stable release. The third pod is for the canary release.

The devops team’s Kubernetes admin adds the label deployment=stable to the stable release pods. She adds the label deployment=canary to the canary release pod.

A screenshot of the result of running 'kubectl get pods --namespace=nginx-app --show-labels' showing the Kubernetes labels on the three pods.

The team’s stable release includes a requirement for hourly snapshots and daily backups. The canary release is more ephemeral, so they want to create a less aggressive, short-term Protection Policy for anything labeled deployment=canary.

In order to avoid possible data conflicts, the admin will create two custom apps: one for the canary release, and one for the stable release. This keeps the backups, snapshots, and clone operations separate for the two groups of Kubernetes objects.

After she adds the cluster to Astra, her next step is to define a custom app. To do this, she clicks the + Define custom app button on the Apps page.

In the pop-up window which appears, she sets devops-canary-deployment as the app name. She chooses the cluster in the Compute drop-down, then the app’s namespace from the Namespace drop-down.

At this point, she can either type deployment=canary in the Labels field, or select that label from the resources listed below.

After defining the custom app for the canary deployment, she repeats the process for the stable deployment.

When she has finished creating the two custom apps, she can treat these resources as any other Astra application. She can clone them, create backups and snapshots, and create a custom Protection Policy for each group of resources based on her Kubernetes labels.