Search…
Kubernetes Application Types
TrilioVault for Kubernetes is Trilio Data's foray into the Kubernetes market providing a cloud-native data protection approach for cloud native applications.

Legacy Applications

IT is under constant transition; Mainframes to Open Systems to virtualization, business applications are undergoing constant change to improve efficiencies, performance and time to market. Data protection is one of the important functions empowering IT with the ability to protect applications against unforeseen outages. Today, there are numerous market proven solutions that provide great backup and recovery functionality for legacy applications that either include bare metal servers or virtualization. However, these solutions cannot address cloud native applications which are mostly "serverless". Therefore, backing up a few computers or virtual machines is not an effective solution to address the sprawling needs of cloud native applications.

Cloud Native Applications

Cloud Native Computing Foundation (CNCF) defines cloud-native as “scalable applications” running in “modern dynamic environments” that use technologies such as containers, microservices, and declarative APIs. A cloud native application may contain 10s to 100s of containers and their associated resources that work in unison to accomplish defined business functionality. For example, containers may be spread across multiple compute nodes and without affinity to the underlying infrastructure. Individual containers within a cloud native application do not have much application context The collection of related containers and their resources must be treated as a single "application".
Since cloud native applications may contain different containers running from different images with different metadata settings, manually building and maintaining these applications is a tedious job. Although Kubernetes defines few building blocks such as replica sets, deployments, stateful sets, etc. to build complex applications, Kubernetes supports additional tools such as Helm charts and Operators to implement life cycle of cloud native applications.
In the next few sections we will discuss how TrilioVault backup and recovery operations are defined within Kubernetes applications and how it enhances the overall application lifecycle management with its backup and recovery operations.

Helm

Helm has three main concepts:
A Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.
A Repository is the place where charts can be collected and shared.
A Release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.
1
$ helm install happy-panda stable/mariadb
2
Fetched stable/mariadb-0.3.0 to /Users/mattbutcher/Code/Go/src/helm.sh/helm/mariadb-0.3.0.tgz
3
happy-panda
4
Last Deployed: Wed Sep 28 12:32:28 2016
5
Namespace: default
6
Status: DEPLOYED
7
8
Resources:
9
==> extensions/Deployment
10
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
11
happy-panda-mariadb 1 0 0 0 1s
12
13
==> v1/Secret
14
NAME TYPE DATA AGE
15
happy-panda-mariadb Opaque 2 1s
16
17
==> v1/Service
18
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
19
happy-panda-mariadb 10.0.0.70 <none> 3306/TCP 1s
20
21
22
Notes:
23
MariaDB can be accessed via port 3306 on the following DNS name from within your cluster:
24
happy-panda-mariadb.default.svc.cluster.local
Copied!
In the above example a new release called happy-panda is created from a helm chart stable/mariadb using helm install command. Helm created various resources including deployment, secrets and service objects as part of release creation.
When a new version of a chart is released, or when you want to change the configuration of your release, you can use the helm upgrade command.
1
$ helm upgrade -f panda.yaml happy-panda stable/mariadb
2
Fetched stable/mariadb-0.3.0.tgz to /Users/mattbutcher/Code/Go/src/helm.sh/helm/mariadb-0.3.0.tgz
3
happy-panda has been upgraded. Happy Helming!
4
Last Deployed: Wed Sep 28 12:47:54 2016
5
Namespace: default
6
Status: DEPLOYED
7
...
Copied!
Helm supports additional commands such as rollback of an upgrade or uninstalling a release.
Application instances in Helm's world is a release. Just as each Helm operation is defined for a given Release, TrilioVault defines its backup and operations at a given Helm Release. You can define a TrilioVault backup job for a release and restore a release from TrilioVault backups. From the above example, you can restore happy-panda release from a TrilioVault backup and then call helm upgrade to upgrade the release to a new revision.

Operator

According to Kubernetes an Operator is defined as the following:
The Operator pattern aims to capture the key aim of a human operator who is managing a service or set of services. Human operators who look after specific applications and services have deep knowledge of how the system ought to behave, how to deploy it, and how to react if there are problems.
People who run workloads on Kubernetes often like to use automation to take care of repeatable tasks. The Operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.
The Kubernetes community has plethora of Operators for managing various applications. These are primarily stateful applications which otherwise cannot fully be managed using Kubernetes building blocks such as deployments, replica sets or stateful sets. These Operators have an innate knowledge of the operational aspects of its underlying application and will provide complete life cycle management of the application. For example, an Operator for a Galera cluster knows how to adjust a number of replicas, how to recover a cluster or a member, and how to tune various operational parameters.
Lets walk through the sequence of steps to deploy an Operator based application. Here we took an example memcached operator to aid our discussion.
Before running the Operator, the CRD must be registered with the Kubernetes apiserver:
1
$ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml
Copied!
1
2
$ cat deploy/service_account.yaml
3
serviceAccountName: memcached-operator
4
containers:
5
- name: memcached-operator
6
# Replace this with the built image name
7
image: quay.io/<user>/memcached-operator:v0.0.1
8
command:
9
- memcached-operator
10
imagePullPolicy: Always
11
12
$ kubectl create -f deploy/service_account.yaml
13
$ kubectl create -f deploy/role.yaml
14
$ kubectl create -f deploy/role_binding.yaml
15
$ kubectl create -f deploy/operator.yaml
16
Copied!
Verify that the memcached-operator deployment is up and running:
1
$ kubectl get deployment
2
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
3
memcached-operator 1 1 1 1 1m
Copied!
Create the example Memcached CR that was generated at deploy/crds/cache.example.com_v1alpha1_memcached_cr.yaml:
1
$ cat deploy/crds/cache.example.com_v1alpha1_memcached_cr.yaml
2
apiVersion: "cache.example.com/v1alpha1"
3
kind: "Memcached"
4
metadata:
5
name: "example-memcached"
6
spec:
7
size: 3
8
9
$ kubectl apply -f deploy/crds/cache.example.com_v1alpha1_memcached_cr.yaml
Copied!
Ensure that the memcached-operator creates the deployment for the CR:
1
$ kubectl get deployment
2
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
3
memcached-operator 1 1 1 1 2m
4
example-memcached 3 3 3 3 1m
Copied!
Check the pods and CR status to confirm the status is updated with the memcached pod names:
1
$ kubectl get pods
2
NAME READY STATUS RESTARTS AGE
3
example-memcached-6fd7c98d8-7dqdr 1/1 Running 0 1m
4
example-memcached-6fd7c98d8-g5k7v 1/1 Running 0 1m
5
example-memcached-6fd7c98d8-m7vn7 1/1 Running 0 1m
6
memcached-operator-7cc7cfdf86-vvjqk 1/1 Running 0 2m
Copied!
1
$ kubectl get memcached/example-memcached -o yaml
2
apiVersion: cache.example.com/v1alpha1
3
kind: Memcached
4
metadata:
5
clusterName: ""
6
creationTimestamp: 2018-03-31T22:51:08Z
7
generation: 0
8
name: example-memcached
9
namespace: default
10
resourceVersion: "245453"
11
selfLink: /apis/cache.example.com/v1alpha1/namespaces/default/memcacheds/example-memcached
12
uid: 0026cc97-3536-11e8-bd83-0800274106a1
13
spec:
14
size: 3
15
status:
16
nodes:
17
- example-memcached-6fd7c98d8-7dqdr
18
- example-memcached-6fd7c98d8-g5k7v
19
- example-memcached-6fd7c98d8-m7vn7
Copied!
In the above example, example-memcached is the application instance and memcached-operator is the Operator. The Operator has a CRD definition and container image that includes the Operator controller code to manage Operator CRD.
Let's discuss the Operator based applications from a backup and restore operations viewpoint. In the above example, the application contains three pods at that given time. Backing up these three pods as part of the application backup and then restoring these three pods do not sufficiently addresses the example-memcached needs. The restored pods are not associated with the Operator and the Operator controller cannot be used to manage restored the application.
TrilioVault backups include the Operator CRD, its image, application CR and all the resources are created by the Operator as backup image. When a backup is restored, TrilioVault will restore the Operator (if not already present), create the application using the Operator and will restore the data from the backup images. Hence, TrilioVault restored applications can still be managed using an Operator. For example, user can grow the size of memcached 4 by using Operator functionality.

Label and Selectors based Applications

Helm Charts and Operators cover a wide range of applications deployments in Kubernetes. However, there may be applications that can be identified by Labels. TrilioVault supports backup and recovery of these applications as well.
Labels are key/value pairs that are attached to objects, such as PODs and PVs. Labels are intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of objects. Labels can be attached to objects at creation time and subsequently added and modified at any time. Each object can have a set of key/value labels defined. Each Key must be unique for a given object.
1
"metadata": {
2
"labels": {
3
"app" : "gcp-compute-persistent-disk-csi-driver",
4
"componentname" : "comp1"
5
}
6
}
Copied!
In the above example, app and componentname are the attributes.
You can create backup plan based on labelSelectors. For a complete description of labelSelectors, please refer to Kubernetes documentation.
1
backupPlanComponents:
2
custom:
3
matchLabels:
4
app: gcp-compute-persistent-disk-csi-driver
Copied!

Namespaces

Namespaces aim at providing multi-tenancy within a Kubernetes cluster. Being a natural concept of the Kubernetes cluster, often time users leverage namespaces within Kubernetes clusters as a boundary for their application or a logical group of applications. While not a direct correlation between application discovery/deployment, an indirect relationship does exist that makes it important to call out namespaces as an identifier or segregation mechanism for application/s.

Other Application Deployments

Application deployments are not limited to these three types. There are other third party tools such as Terraforms, Cloud Formations, etc. TrilioVault will continue to add support for these deployments models in the future.
Last modified 5mo ago