Skip to main content
Blog

Introducing Kubernetes Label Selector searches across namespaces


Mathew Ericson
Vaulter
Forum|alt.badge.img+6

One of the benefits of application modernizationcontainers, and orchestrating your data-center with Kubernetes is the ability to move to 'fully programmable' infrastructure.

Now, while this makes the developers day much much easier as they provision apps / storage whenever and wherever they need it - what impact does that have on backup & recovery?

Well, for Metallic (and Commvault) it is simple...

Commvault is cloud-native, and we use Kubernetes Label Selectors to automatically discover applications based on the 'labels' that developers apply to their apps.

Let's take a look at a standard application definition:

apiVersion: v1
kind: ConfigMap
metadata:
  name: postgres-config-demo
  namespace: env-prod
  labels:
    app: postgres
data:
  POSTGRES_DB: demopostgresdb
  POSTGRES_USER: demopostgresadmin
  POSTGRES_PASSWORD: demopostgrespwd
---
apiVersion: v1
kind: Service
metadata:
  name: postgres
  namespace: env-prod
  labels:
    app: postgres
spec:
  ports:
  - port: 5432
    name: postgres
  clusterIP: None
  selector:
    app: postgres
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgres-demo
  namespace: env-prod
spec:
  serviceName: "postgres"
  replicas: 3
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
      - name: postgres
        image: postgres:latest
        envFrom:
          - configMapRef:
              name: postgres-config-demo
        ports:
        - containerPort: 5432
          name: postgredb
        volumeMounts:
        - name: postgredb
          mountPath: /var/lib/postgresql/data
          subPath: postgres
  volumeClaimTemplates:
  - metadata:
      name: postgredb
      namespace: env-prod
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: rook-ceph-block
      resources:
        requests:

In this case the developer has flagged this application as 

env=prod, or

environment = production in longer form ...

 

Now we just tell Commvault about this setting in the Application Group definition

 

We support searching within a single namespace

env=prod -n some_namespace

But now, from 11.23 we can now search for labelled applications across all namespaces in the cluster

env=prod --all-namespaces

This means Kubernetes backup is effectively - set and forget...

Let's click PREVIEW and see what our label selector has found....

 

We found a number of production applications across the cluster. which we will now protect on the next backup run.

Commvault performs this check at backup time, meaning with adjust data protection to the developer - we get out of the way of the developer and let the business dictate what data is protected - the IT-Ops team simply needs to define plans for each data / label type:

  • Production
  • Development
  • QA
  • Mission-critical

Now that's truly simplified, intelligent data management.....

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings