Successfully reported this slideshow.
Your SlideShare is downloading. ×

MuleSoft Nashik Meetup#6 - RTF [self managed GKE ] CICD

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 44 Ad

More Related Content

Similar to MuleSoft Nashik Meetup#6 - RTF [self managed GKE ] CICD (20)

More from Jitendra Bafna (20)

Advertisement

Recently uploaded (20)

MuleSoft Nashik Meetup#6 - RTF [self managed GKE ] CICD

  1. 1. All contents © MuleSoft, LLC Nashik MuleSoft Meetup Group CICD on RTF hosted on self managed GKE - using Jenkins [September 10th, 2022]
  2. 2. All contents © MuleSoft, LLC Safe Harbor Statement ● Both the speaker and host are organizing this meet up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purpose only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements also. ● This presentation is not meant for any promotional activities.
  3. 3. All contents © MuleSoft, LLC A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 3
  4. 4. All contents © MuleSoft, LLC 4 Organizers Jitendra Bafna Senior Solution Architect III EPAM Systems Ankur Bahadur Mathur Lead Software Engineer Collabera
  5. 5. All contents © MuleSoft, LLC Speaker ⮚ Integration architect with over 14+ years of experience ⮚ Working with Devoteam Netherlands. My area of expertise is within Enterprise Application Integration, built over many years of successful implementations on large scale enterprises to enable digital transformation and meet their integration requirements Siddamma Tigadi Integration Architect Devoteam
  6. 6. All contents © MuleSoft, LLC Agenda 6 Introduction to CICD and approach? Branching Strategy? Deployment approach to RTF Connected Apps Containerized mule apps SSS – N Simple Steps to implement CICD for RTF Q&A Trivia Quiz
  7. 7. All contents © MuleSoft, LLC Introduction
  8. 8. All contents © MuleSoft, LLC What is Continuous Integration (CI) ? 8 ● Continuous integration is a practice and coding philosophy that makes it easier for development teams to prepare, implement, and run quality control on a release. ● The goal of continuous integration is to automate and ensure consistency in the way development teams build, test, and package applications. ● Many of today’s applications are built on code that has been developed in various different tools and platforms. ● Development teams need a way to integrate and validate their changes. ● CI provides wide benefits such as reducing error-prone deployment work to providing early visibility into bugs.
  9. 9. All contents © MuleSoft, LLC What is Continuous Delivery (CD) ? 9 ● Continuous delivery (CD) is the other end of the CI/CD pipeline. ● CD automates the delivery of applications and code changes, to artifact repositories and deployment to multiple infrastructure environments such as testing and development. ● Then, CD automation performs calls to databases, web servers, and additional services that must be updated or restarted once an application is deployed. ● Teams can set then deploy productions on a daily, hourly, or continuous deployment schedule.
  10. 10. All contents © MuleSoft, LLC RTF Deployment approach
  11. 11. All contents © MuleSoft, LLC Pipeline interaction example 11
  12. 12. All contents © MuleSoft, LLC CI/CD Flow for Runtime Fabric 12
  13. 13. All contents © MuleSoft, LLC Automating deployments to Runtime Fabric 13 Deployments to Runtime Fabric can be automated using: – Runtime Manager – Mule Maven Plugin – Anypoint Platform Runtime Manager API
  14. 14. All contents © MuleSoft, LLC Typical list of third party tools** 14 **This is an indicative/sample list only
  15. 15. All contents © MuleSoft, LLC CD Workflow (NON-DEV ENV) example Jenkins Automation Services Internal Maven Repo Maven Artifact Repository ( Artifactory, etc…) MuleSoft Runtime 1. User/Automated trigger deployment for specific artifact that target to RTF 2. Jenkins download artifact from Artifact Repository 3. Upload the artifact ONLY IF the artifact with same version is not exist in Exchange 4.Trigger Deployment based on artifact uploaded to Exchange Anypoint Exchange Anypoint Runtime Manager 4. deployment is triggered 4. download artifact from exchange to be
  16. 16. All contents © MuleSoft, LLC Upload to Exchange via Maven 16 https://docs.mulesoft.com/exchange/to-publish-assets-maven Set the distribution point Set group id follow to Exchange Organization ID $mvn clean deploy -DskipTests -e
  17. 17. All contents © MuleSoft, LLC Upload to Exchange via Anypoint API 17
  18. 18. All contents © MuleSoft, LLC Trigger Deployment via Maven (RTF example) 18 https://docs.mulesoft.com/mule-runtime/4.3/deploy-to-rtf#deploy-to-runtime-fabric Configure Maven Plugin mvn clean deploy -DmuleDeploy - Dmaven.properties=mule.rtf.deploy.properties Prepare deploy properties
  19. 19. All contents © MuleSoft, LLC Trigger Deployment via Anypoint API (RTF example) 19
  20. 20. All contents © MuleSoft, LLC
  21. 21. All contents © MuleSoft, LLC How to connect to Anypoint Platform APIs (Connected Apps)
  22. 22. All contents © MuleSoft, LLC Prepare connected apps for login to Anypoint Platform API 22 https://docs.mulesoft.com/access-management/connected-apps-overview
  23. 23. All contents © MuleSoft, LLC Getting access to Anypoint Platform and check if asset is exist at Exchange 23
  24. 24. All contents © MuleSoft, LLC Retrieve all necessary information for deployment 24
  25. 25. All contents © MuleSoft, LLC Retrieve all necessary information for deployment 25 Auth token injection to settings.xml and pom file : maven settings.xml inject : <server> <id>anypoint-exchange-v2</id> <username>~~~Token~~~</username> <password>${ACCESS_TOKEN}</password> </server> Mule App pom.xml inject : <plugin> ... <configuration> <classifier>mule-application</classifier> <runtimeFabricDeployment> <!- Use authToken in place of userId and Password > <authToken>${authToken}</authToken>
  26. 26. All contents © MuleSoft, LLC Jenkins File pipeline { agent any stages { stage('deploy-to-nexus') { steps { git 'https://github.com/gituser123/hello-world.git' // use profile nexus (-P nexus) to deploy to Nexus. sh "mvn clean deploy -P nexus" } } stage('deploy-to-exchange') { steps { // deploys the same binary zip file exchange // mvn clean deploy works fine, // it will rebuilt an equivalent binary zip file sh "mvn deploy" } } stage('deploy-to-rtf') { steps { // deploy from Exchange to RTF runtime. sh "mvn deploy -DmuleDeploy -Denvironment=dev" } post { success { sh 'echo all done!' } } } } }
  27. 27. All contents © MuleSoft, LLC Pom file <plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>3.7.1</version> <extensions>true</extensions> <configuration> <runtimeFabricDeployment> <uri>https://anypoint.mulesoft.com</uri> <muleVersion>4.4.0</muleVersion> <username>user</username> <password>pass</password> <applicationName>newapp</applicationName> <target>rtf</target> <environment>Sandbox</environment> <provider>MC</provider> <replicas>1</replicas> <properties> <key>value</key> </properties> <deploymentSettings> <enforceDeployingReplicasAcrossNodes>false</enforceDeployingReplicasAcrossNodes> <updateStrategy>recreate</updateStrategy> <clustered>false</clustered> <forwardSslSession>false</forwardSslSession> <lastMileSecurity>false</lastMileSecurity> <resources> <cpu> <reserved>20m</reserved> <limit>1500m</limit> </cpu> <memory> <reserved>700Mi</reserved> </memory> </resources> <http> <inbound> <publicUrl>url</publicUrl> </inbound> </http> </deploymentSettings> </runtimeFabricDeployment> </configuration> </plugin>
  28. 28. All contents © MuleSoft, LLC 28 1. Publish assets to Anypoint Exchange mvn clean deploy 1. To deploy mule application to RTF cluster mvn clean package deploy -Pbuild -Dpackaging=mule-application -DmuleDeploy -Dmule.version=4.4.0 -Denv=sandbox - Dusername=<obfuscate> -Dpassword=<obfuscate> -Drtf.app.name=demo-rtf-cicd-muleapp -Ddeployment.target=mule-rtf - Dbusiness.group.id=<obfuscate> -DplatformClientId=<obfuscate> -DplatformClientSecret=<obfuscate> -DplatformEnv=Sandbox - Dreplicas=1 -DingressUrl=<obfuscate> -DdeploymentName=demo-rtf-cicd-muleapp Maven commands to deploy leveraging Mule Maven Plugin
  29. 29. All contents © MuleSoft, LLC 29 Kubectl commands 1. kubectl get namespaces 2. kubectl get pods -n rtf 3. kubectl get pods --all-namespaces 4. kubectl get node Mule app logs 1. kubectl logs <mule appname> -n <namespace> -c app Important kubectl Commands
  30. 30. All contents © MuleSoft, LLC Where does the Mule app reside in RTF Cluster?
  31. 31. All contents © MuleSoft, LLC 31 Runtime Fabric architecture is based on Kubernetes, it runs on nodes where a node can be a physical or virtual machine. There are two types of nodes: Controller node for managing the Runtime Fabric cluster Worker node for running Mule applications A worker node is a physical or virtual machine characterized by: CPU or vCPU and Memory When a mule app is deployed to Runtime Fabric, it automatically deploys the application to a worker node .So the application is not directly deployed. Runtime Fabric creates a POD composed of two containers. One container will run your application, the other will run the monitoring agent Where does the Mule app in RTF run ?
  32. 32. All contents © MuleSoft, LLC Simple steps to set up CICD
  33. 33. All contents © MuleSoft, LLC 33 • Prerequisite ensure the RTF cluster is available , up and running • Install the Jenkins Link • Install the following plugins to Jenkins jdk ,git and maven plugin • Push the mule app code to github • Configure the jenkins pipeline • Trigger the Jenkins the job to execute the deployment SSS – Six Simple Steps to implement CICD on Anypoint RTF
  34. 34. All contents © MuleSoft, LLC 34 • Tracking changes to closure • Automate the deployment and faster delivery time • Consistent results • Minimal delays Benefits • Automate API promotion , moving towards DevOps,incorporate RPA for end to end automation . Which can be a topic for our subsequent meetups What next Beyond CICD Automation
  35. 35. All contents © MuleSoft, LLC 35 https://help.mulesoft.com/s/article/How-to-Use-Maven-to-Deploy-an-Application-from-Exchange-to-RTF-Directly https://docs.mulesoft.com/mule-runtime/4.3/deploy-to-rtf#redeploy-to-runtime-fabric https://docs.mulesoft.com/mule-runtime/4.4/deploy-to-rtf https://help.mulesoft.com/s/article/How-to-live-tail-logs-from-all-pods-of-a-Runtime-Fabric-RTF-app References
  36. 36. All contents © MuleSoft, LLC Q & A Session
  37. 37. All contents © MuleSoft, LLC Quiz Time Get ready to WIN a Special Gift from MuleSoft Community
  38. 38. All contents © MuleSoft, LLC Question 1: Can we deploy directly to runtime fabric cluster without publishing the asset to Exchange ? Answer : True or False
  39. 39. All contents © MuleSoft, LLC Question 2: Which are the different options to deploy to RTF ? Answer : 1. Runtime Manager, Mule Maven Plugin and Anypoint REST API 2. Mule Maven Plugin 3. Runtime Manager only 4. None of the above
  40. 40. All contents © MuleSoft, LLC Question 3: Which authentication method was the method used to deploy the mule application to RTF cluster ? Answer : 1. userid and password 2. AuthToken 3. None of the above
  41. 41. All contents © MuleSoft, LLC Congratulations ● Congratulation to all the winners ○ Quiz ● Remember to send your email address to the organizer via chat window! 41
  42. 42. All contents © MuleSoft, LLC 42 ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Invite your network to join: https://meetups.mulesoft.com/nashik/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program What’s next?
  43. 43. All contents © MuleSoft, LLC See you next time
  44. 44. All contents © MuleSoft, LLC Appendix

×