From 7b696209ed03d394557e8766fa3df5f2d956ba9a Mon Sep 17 00:00:00 2001 From: kkothapelly Date: Fri, 26 Apr 2024 17:41:32 +0530 Subject: [PATCH] TKGm to TKGS stateful app migration Signed-off-by: kkothapelly --- .../image1.png | Bin 0 -> 15527 bytes .../guestbook-frontend-deployment.yaml | 28 +++ .../guestbook-frontend-service.yaml | 14 ++ .../guestbook-ingress.yaml | 16 ++ .../redis-follower-deployment.yaml | 39 ++++ .../redis-follower-pvc.yaml | 11 + .../redis-follower-service.yaml | 15 ++ .../redis-leader-deployment.yaml | 34 ++++ .../redis-leader-pvc.yaml | 11 + .../redis-leader-service.yaml | 16 ++ .../tkgm-to-tkgs-stateful-app-migration.md | 191 ++++++++++++++++++ 11 files changed, 375 insertions(+) create mode 100644 src/solution-workbooks/img/tkgm-to-tkgs-stateful-app-migration/image1.png create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/guestbook-frontend-deployment.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/guestbook-frontend-service.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/guestbook-ingress.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-follower-deployment.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-follower-pvc.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-follower-service.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-leader-deployment.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-leader-pvc.yaml create mode 100644 src/solution-workbooks/resources/tkgm-to-tkgs-stateful-app-migration/redis-leader-service.yaml create mode 100644 src/solution-workbooks/tkgm-to-tkgs-stateful-app-migration.md diff --git a/src/solution-workbooks/img/tkgm-to-tkgs-stateful-app-migration/image1.png b/src/solution-workbooks/img/tkgm-to-tkgs-stateful-app-migration/image1.png new file mode 100644 index 0000000000000000000000000000000000000000..08ed16eccbeb9e7679fa27e9dfe6cf69cf078434 GIT binary patch literal 15527 zcmch8cT|&Imv4+gLXV;p5ebT-(xr*C&_rH(?}Q>EBE3mB6cItdM(ePaaRHkrxZs-aC(6(Lt zUFvfD`2qltkWiAB(RpjOl^m98rW?PqavsO5Q15fAzRl#Y}A^E+Yyu5}C%ZFbX z^361wQ_sk(mB>J`4!2}(Qj|T^U@~m`LI#FXuycHtM3lUsdx7qsUg17W+2Ym3>uKRf z4^NIIG!6?;VuyWR{@B`{6ZCZwB`^^166tjfLfQZz`W=k)drDdrcAERm!E?|6(oU#jzxn%~omLBNYiBF-f*&-C!4*;}ut z4w7H5^v@7F6@DsW6fsH|WsE9@PqetL3U54|SD85S$ge@HuZuL(-S;r2u3vp0YQH|J z@@Uhm^xB{WwSYe#fA#uy+}r1>Z+urhx%;wYC6AZBzCPYt zeqHU^63~|*{L~MJ=@ZHF`~dl&p1Jwp=&Ws(9VhXnhh}`$@DvMdE15UuL^$C`^z+w- za;APXqK4F^3mJHfUPK+xqNL9oo*quSj--d)Hk!1NJ~5P3pQ?7$_ndYPRrA@dU3v3q z7J3cpd1qM?Y-%9v8RNap7)yTNmS4!@4LY7iV|=!9x`~Fm?Y&JQa6T`;=nrB$m|ji8 zxZ0sI*C&cq+~cS8*_!%#cA|rpx+MOa>P)!=u2*pVYwBrcN^Chw%J{4+;54*u|Bv#> z((kYClesx5c|{F--I`aydq<|e*OqCIdF#oG(Vn3RwODlC2^y!5P)b;;6og9>Q#^A| z=+45ty?WFV^>zq6uls%O=jZ58E>gVf^^ENyx6?=Fr94??eLXu}U3To#qsLcksw#HI zfZwe9Btw{{k}A6L@>6=xoqRTZ#zvexzW(0K_SuJXd$-c8CUK=L!7YoE)wL(((k%)POI`mA_6cg0=^)Jl?jPEO~=>@AV%6#Z?aBo}Rx zJ3YlS=roS#nM)o}UIP9i;spj;ES|!1YeUbC8Ve*40%{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a?~DmObEVz0r$~p-POsO-2%VSfvg2E;GEkn dev v1.27.5---vmware.1-tkg.1 + tkg-standalone-mgmt-cl tkg-system running 1/1 1/1 v1.27.5+vmware.1 management dev v1.27.5---vmware.1-tkg.1 +``` + +### Destination Environment - TKGS + +We have configured the TKGs environment backed with NSX-T Networking by following the reference architecture, [VMware Tanzu for Kubernetes Operations using vSphere with Tanzu on NSX Reference Design](https://docs.vmware.com/en/VMware-Tanzu-for-Kubernetes-Operations/2.3/tko-reference-architecture/GUID-reference-designs-tko-on-vsphere-with-tanzu-nsxt.html), with the below bill of materials. + +|**Software Components**|**Version**| +| --- | --- | +|VMware vSphere ESXi|8.0 U1c| +|VMware vCenter (VCSA)|8.0 U1c| +|Supervisor Version|v1.25.6| +|Tanzu Kubernetes Release(for workload clusters)|v1.26.13| +|VMware NSX|4.1.0.2| + +We have enabled the Supervisor cluster, created a Supervisor Namespace, and deployed a Tanzu workload cluster. TKGs environment is backed with NSX-T Networking and Contour is deployed as a Tanzu package on the workload cluster to provide L7 Ingress functionality. For more information on installing Tanzu packages on the TKGS workload cluster, please visit [Prepare to install Tanzu Packages](https://docs.vmware.com/en/VMware-Tanzu-Packages/2024.2.1/tanzu-packages/prep.html). + +```bash +# kubectl vsphere login --vsphere-username=administrator@vsphere.local --server=192.168.120.2 --tanzu-kubernetes-cluster-name tkgs-cluster-01 --insecure-skip-tls-verify + +KUBECTL_VSPHERE_PASSWORD environment variable is not set. Please enter the password below +Password: + +Logged in successfully. + +You have access to the following contexts: + 192.168.120.2 + tkgs-cluster-01 + tkgs-namespace-01 +``` + +### Velero Installation on Tanzu Kubernetes Clusters: + +Velero has been configured on Tanzu Kubernetes Clusters to backup and restore the workloads. It should be configured on both source and destination clusters. Velero configuration includes: +- Installed Velero CLI on the local client machine +- Configured a storage provider with buckets to store the backups, in our case we used MinIO as the storage provider. +- Configured Velero server on source and destination Tanzu Kubernetes clusters. + +For more information on configuring Velero and best practices, see [Installing Velero in Tanzu Kubernetes Cluster](https://docs.vmware.com/en/VMware-Tanzu-Reference-Architecture/services/tanzu-solutions-workbooks/solution-workbooks-velero-with-restic.html). + +## App Deployment on TKGm cluster and Backup via Velero + +We will deploy a stateful application named `Guestbook` on the source cluster, and enter some messages for data persistence validation. We will also create an Ingress object for backing up this application and ensure to backup and restore this in the destination environment. + +1. Deploy the Guestbook app on the TKGM cluster by following the steps mentioned [here](https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-with-tanzu-tkg/GUID-A6348191-D403-4CDA-9183-4F4C28A6B093.html). Please refer [here](./resources/tkgm-to-tkgs-stateful-app-migration/) for app config files. +1. Add some data entries in the guestbook app before taking Velero backup and ensure that you see the new entries. +![Guestbook app](img/tkgm-to-tkgs-stateful-app-migration/image1.png) + +1. Backup the application using Velero, by including the complete Namespace. + ```bash + # velero backup create --include-namespaces + ``` +1. Verify the backup status by running the below command and ensure that all the objects are backed up and the status is COMPLETE: + ```bash + # velero backup describe + ``` + +## App restore on TKGS cluster using Velero + +Now we will restore this application on the destination cluster and ensure that all the objects are backed up and validate the data persistency. + +1. Restore the app backed up in the above section to the TKGS workload cluster. + ```bash + # velero restore create --from-backup + ``` +1. Validate the restore status by running the following command: + ```bash + # velero restore describe + ``` +1. Once Velero restore completes, validate the status application by ensuring all the pods, services, PV/PVCs, and Ingress objects are deployed as expected + ```bash + # kubectl get all -n + # kubectl get pv,pvc -n + # kubectl get ingress -n + ``` +1. Edit the ingress object of the app, and update the `spec.ingressClass` name to match the IngressClass name on the Destination cluster. +1. Access the application and validate that the data is persistent after the migration. Also, make some new entries to the application to ensure the app runs fine on the destination. + +## TKGm-TKGS Migration Observations: + +In this section, we will discuss some of the issues we encounter and document the customizations we need to perform to complete the app migration from the TKGm to the TKGS environment. + +### Pod creation failure with PodSecurityAdmission error: + +When you configure a source application with an image created with non-root permissions or privileged containers, pod restore on the TKGs cluster will fail with the PodSecurityPolicy error. + +```bash +error restoring pods/guestbook/guestbook-frontend-deployment-7fd64c8b4c-m424b: pods "guestbook-frontend-deployment-7fd64c8b4c-m424b" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "php-redis" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "php-redis" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "php-redis" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "php-redis" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") +``` + +PodSecurityAdmission replaces the PodSecurityPolicy from K8s 1.25.x onwards, and you need to add the below label on Namespace to enable the Privileged containers. + +```bash +# kubectl label --overwrite ns pod-security.kubernetes.io/enforce=privileged +``` + +However, when you restore the workloads using Velero, it creates the Namespace as well and the restored pods will fail as the namespace does not have the above label applied. To avoid this scenario, if you have any Privileged containers running in the source cluster, ensure to label the namespace at the source cluster itself, so that the same settings will be applied on the destination namespace and restore works without any issues. + +### Changing PV/PVC StorageClasses: + +When you create a stateful application with Dynamic Persistent Volumes, you provide a Storage Class Name to create the PVs on the backend storage. When you restore these stateful applications on the destination cluster, it expects the same StorageClass to be available and PV creation fails if it does not exist. + +To avoid this issue, you need to ensure that the same storage class is present on the destination cluster as well. However, this might not always be feasible as customers might be interested in using an existing SC instead of creating a new SC with a matching name on the destination cluster. + +Velero provides an option to change the storage class of persistent volumes and persistent volume claims during restores. To configure this, create a config map in the Velero namespace on the destination cluster by mapping the source and destination storage class names. For more information, see [Velero Documentation.](https://velero.io/docs/v1.13/restore-reference/#changing-pvpvc-storage-classes) + +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + # any name can be used; Velero uses the labels (below) + # to identify it rather than the name + name: change-storage-class-config + # must be in the velero namespace + namespace: velero + # the below labels should be used verbatim in your + # ConfigMap. + labels: + # this value-less label identifies the ConfigMap as + # config for a plugin (i.e. the built-in restore item action plugin) + velero.io/plugin-config: "" + # this label identifies the name and kind of plugin + # that this ConfigMap is for. + velero.io/change-storage-class: RestoreItemAction +data: + # add 1+ key-value pairs here, where the key is the old + # storage class name and the value is the new storage + # class name. + : + : +``` + +### Updating IngressClass on Destination Cluster: + +Source (TKGm) cluster is configured with NSX ALB and Destination (TKGs) cluster is configured with contour for L7 ingress functionality. So when you backup and restore the ingress workloads, ingress will not be assigned with an IP address due to ingress class mismatch. + +You need to ensure to change the IngressClass name after restoring the workloads on the destination cluster. To perform this edit the Ingress object, and update the `spec.ingressClass` field to match with the destination ingress class name, or just remove the field to make use of the default Ingress provider. + +## Appendix: References +- [Velero Storage classes config map](https://velero.io/docs/v1.13/restore-reference/#changing-pvpvc-storage-classes) +- [Package Installation on TKGS cluster](https://docs.vmware.com/en/VMware-Tanzu-Packages/2024.2.1/tanzu-packages/prep.html#supervisor-version-requirements-4) +- [NSX ALB L7 for TKGM](https://docs.vmware.com/en/VMware-Tanzu-for-Kubernetes-Operations/2.3/tko-reference-architecture/GUID-deployment-guides-tko-on-vsphere-nsxt.html#configure-ako-deployment-config-adc-for-workload-cluster-to-enable-nsx-alb-l7-ingress-with-nodeportlocal-mode-28) +- [Guesbook config files]() +- [App deployment steps](https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-with-tanzu-tkg/GUID-A6348191-D403-4CDA-9183-4F4C28A6B093.html)