NBUKOPS (NetBackup K8S Operators) Installation Steps

# Agenda:

  1. COMMAND TO UNINSTALL EXISTING NBUKOPS
  2. Installation Steps:
    1. STEP-1: Get Packages
    2. STEP-2: Extract Package & create NS for nbukops installation.
    3. STEP-3: Create a secret under the above ns. This secret would be used for pulling Docker Images.
    4. STEP-4: Load DM image to local cache & upload it to repo.
    5. STEP-5: Update values.yaml file.
    6. STEP-6: Create NetBackup API KEY
    7. STEP-7: Create a secret in k8s namespace 
    8. STEP-8: Run helm install 
    9. STEP-9: Check status of Deployment
    10. STEP-10: Trigger Reinstall (Optional - For failed case)
  3. Validate Installation


COMMAND TO UNINSTALL EXISTING NBUKOPS:

---

    helm uninstall veritas-netbackupkops -n <ns>

    k delete ns <ns>


    E.g:
    helm uninstall veritas-netbackupkops -n shakti-nbukops-ns
    k delete ns shakti-nbukops-ns

 

1) STEP-1: Get Packages.
---

Download following two packages from support.veritas.com

➢ NetBackup Kubernetes operator package (netbackupkops-10.3.1.tar.gz).

➢ NetBackup Data mover image (veritasnetbackup-datamover-10.3.1.tar).

 

2) STEP-2: Extract Package & create NS for nbukops installation.
---
     1) tar -xf netbackupkops-10.3.1.tar.gz -C /root/nbkops
     2) kubectl create ns <ns>

          E.G: kubectl create ns shakti-nbukops-ns
              namespace/shakti-nbukops-ns created

 

3) STEP-3: Create a secret under the above ns. This secret would be used for pulling Docker Images.
---

    1) First Login to all docker repos: 
    docker login -u <user_name> <repo>

     eg :  

     docker login -u <> <repo_where_above_images_would_be_placed>

   

    2) CMD to create netbackupkops-docker-cred:

        Traverse to /root before executing below command.

        Run CMD: kubectl create secret generic netbackupkops-docker-cred --from-file=.dockerconfigjson=.docker/config.json --type=kubernetes.io/dockerconfigjson -n shakti-nbukops-ns

        NOTE: The name of the secret should be netbackupkops-docker-cred under and it should present under that ns.

    3) CMD to validate:  kubectl get secrets -n <ns>

 

 

4) STEP-4: Load DM image to local cache & upload it to nbartifactory repo.
---

    1) docker load -i veritasnetbackup-datamover-10.3.1-0004.tar.gz
    2) docker tag veritasnetbackup/datamover:10.3.1 k8s-nb-support.sbs.com/datamover:10.3.1_0004
    3) docker push k8s-nb-support.sbs.com/datamover:10.3.1_0004

 

5) STEP-5: Update values.yaml file.
---

       Location: /root/nbkops/netbackupkops-helm-chart/values.yaml    

       Sample file: values.yaml

       Change image, nbsha256fingerprint, datamoverimage

 

6) STEP-6: Create NBU API KEY
---
    Go to NetBackup Primary Server WEBUI -> USER -> ADD API KEY
    E.G: A34f09vl6iiHfXQqLZIBUWP84bo1CANizpWBOA5pK7vdBjSPImHEp_CUm2-i_A2W

 

7) STEP-7: Create a secret in k8s namespace 
---

NOTE-1: Update apikey in below yaml with the API key you got in previous step.

NOTE-2: The name of the Secret should be <ns>-nb-config-deploy-secret E.g: shakti-nbukops-ns-nb-config-deploy-secret

 

deply-secret.yaml:
apiVersion: v1
kind: Secret
metadata:
  name: shakti-nbukops-ns-nb-config-deploy-secret
  namespace: shakti-nbukops-ns
type: Opaque
stringData:
  apikey: AzXFQtsYYXW0Ks2zx1KLQJ-d6Ww_tiVrdMXjpTHcCK1lbNJkuAGRrwQloyZxW7My

    # RUN: kubectl create -f ./deply-secret.yaml

 

8) STEP-8: Run helm install 
---
    E.g: helm install veritas-netbackupkops /root/NBKOPS_10.3.1_004/nbukops/netbackupkops-helm-chart -n shakti-nbukops-ns

 

NOTE 1 - The storage class must have default tag otherwise pods will not be running successfully.

Command to set storage class as default -

 oc patch storageclass ocs-storagecluster-cephfs -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'

[root@r7515-117-vm18 nbkops]# oc get sc
NAME                                  PROVISIONER                             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
localblock                            kubernetes.io/no-provisioner            Delete          WaitForFirstConsumer   false                  6d18h
ocs-storagecluster-ceph-rbd           openshift-storage.rbd.csi.ceph.com      Delete          Immediate              true                   6d18h
ocs-storagecluster-ceph-rgw           openshift-storage.ceph.rook.io/bucket   Delete          Immediate              false                  6d18h
ocs-storagecluster-cephfs 
(default)   openshift-storage.cephfs.csi.ceph.com   Delete          Immediate              true                   6d18h
openshift-storage.noobaa.io           openshift-storage.noobaa.io/obc         Delete          Immediate              false                  6d18h

NOTE 2 - If you are installing two nbkops in a single cluster which will talk to 2 different primary, you may get below error.

[root@sbs]# helm install veritas-netbackupkops /root/netbackupkops-helm-chart/ -n shakti-nbukops-ns
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /etc/kubernetes/admin.conf
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /etc/kubernetes/admin.conf
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "backups.netbackup.veritas.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "shakti-nbukops-ns": current value is "xyz-nbkops"

 

Solution - Open deployment file for current installation: <base_path>/netbackupkops-helm-chart/templates/deployment.yaml and remove all line that are under kind:CustomResourceDefinition.

With most of the content will get deleted.


Then try again.

[CMD]:  helm install veritas-netbackupkops /root/NBKOPS_10.3.1_004/nbukops/netbackupkops-helm-chart -n shakti-nbukops-ns

9) STEP-9: Check status of Deployment
---
    k get pods -n <ns>

 

10) STEP-10: Trigger Reinstall (Optional - For failed case)
---
    + Please ensure this secret is created in the next 10 minutes after running helm install.
    + If you fail to create secret set the replica count to zero for deployment <kops-namespace>-netbackup-config-deploy to remove the deploy pod. Again, set the replica count to 1 to restart configuration. Use below command to set the replica count:
    kubectl scale --replicas=1 deployment <kops-namespace>-netbackup-config-deploy –n <kops-namespace>
    E.g: kubectl scale --replicas=1 deployment shakti-nbukops-ns-netbackup-config-deploy –n shakti-nbukops-ns

## helm install veritas-netbackupkops /root/nbkops/netbackupkops-helm-chart -n nbkopsnamespace

 

 

# Validate Installation -

1) 

k get all -n shakti-nbukops-ns
NAME                                                             READY   STATUS              RESTARTS         AGE
pod/shakti-nbukops-ns-controller-manager-85d7d8b66b-h8w7z        0/2     Init:0/1            0                16s
pod/shakti-nbukops-ns-netbackup-config-deploy-549f78df4c-5jdjf   0/1     ContainerCreating   0                16s
pod/shakti-pod-3                                                 0/1     CrashLoopBackOff    1109 (36s ago)   3d22h

NAME                                                           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/shakti-nbukops-ns-controller-manager-metrics-service   ClusterIP   10.99.78.242   <none>        8443/TCP   16s

NAME                                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/shakti-nbukops-ns-controller-manager        0/1     1            0           16s
deployment.apps/shakti-nbukops-ns-netbackup-config-deploy   0/1     1            0           16s

NAME                                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/shakti-nbukops-ns-controller-manager-85d7d8b66b        1         1         0       16s
replicaset.apps/shakti-nbukops-ns-netbackup-config-deploy-549f78df4c   1         1

 

2) k describe <controller manager name as per above output> -n shakti-nbukops-ns

3) K logs shakti-nbukops-ns-netbackup-config-deploy-549f78df4c-5jdjf  -n shakti-nbukops-ns

4) Run Backup and restore of K8S namespace.

Comments

Popular posts from this blog

KMP Algorithm: Pattern Searching in Text

Z-Function Algorithm: Substring Search

Back of the envelope estimations