Questo slide rappresentano un approfondimento su Runtime Fabric - il modello di deployment containerizzato di MuleSoft.
Al loro interno troverete:
- Panoramica su Runtime Fabric
- Setup e configurazione di un cluster su cloud AWS
- Deployment di un'API di test
3. 3
● Panoramica su Runtime Fabric (30 mins)
● Setup e configurazione di un cluster su cloud AWS (20 mins)
● Deployment di un’API di test su Runtime Fabric (10 mins)
● Q&A (15 mins)
● Trivia quiz (15 mins)
● Wrap up (5 mins)
Agenda
5. 1 - 2 VMs
<50 apps
On-Prem
Standalone
(naked)
Runtimes
6+ VMs
100+ apps
On-Prem
CloudHub RTF on VMs / Bare
Metal
No VMs
Near-infinite scale
Fully managed
2+ VMs
100+ apps
On-Prem
k8s
RTF on
managed k8s
EKS, AKS, GKE
OpenShift (on roadmap)
MuleSoft-hosted Customer-hosted
Portabilità del Runtime
Scenario utilizzo di Runtime Fabric
6. Caratteristiche generali di Runtime Fabric
6
● Anypoint Runtime Fabric è un container service che porta i
benefici del cloud su i deployments on-premise — non importa
se si tratta di un data centers oppure in un private cloud (AWS,
Google, Microsoft).
● E’ possibile eseguire il deploy di runtimes Mule sulle piattaforme
cloud, inclusi Microsoft Azure, Amazon Web Services (AWS), e i
data centers aziendali.
● E’ possibile automatizzare e orchestrare facilmente i deploy
senza competenze specifiche di gestione di Kubernetes.
● E’ possibile eseguire istanze multiple di runtime Mule su un
singolo Runtime Fabric
● Sono garantite isolamento della applicazioni, scalabilità
orizzontale, redeploy con zero downtime
● Runtime Fabric è connesso ed integrato con Anypoint control
plane
7. Punti di forza di Runtime Fabric
7
MULTI & HYBRID CLOUD
● Azure
● AWS
● GCP
● Data centers
ALWAYS AVAILABLE
● High availability
● Automated failover
● Increased isolation
● Rolling upgrades
LOW BARRIER
● Single place to manage
● Only basic Docker /
Containerization
knowledge required
● Only basic k8s knowledge
required
9. Divisione delle responsabilità
9
Runtime Fabric su Self-Managed
Kubernetes prevede un approccio a
responsabilità condivise:
Mulesoft: si occupa delle componenti
specifiche di Runtime Fabric ad
esempio gli agent, il runtime e le altre
dipendenze
Cliente: si occupa di preparare
ambiente K8s su piattaforma cloud e
tutti gli aspetti sistemistici legati ad
esso.
10. Oggetti di Kubernetes
10
k8s native
controllers,
resource objects
(API objects),
etc. that can be
applied to a pod
12. Prerequisiti per il setup di Runtime Fabric
12
Per configurare Runtime Fabric è necessario:
● Un cluster Kubernetes funzionante e operativo
● La versione di Kubernetes deve essere una delle seguenti:
○ 1.17 (1.8, 1.9, and 1.10.0)
○ 1.18
○ 1.19
○ 1.20 (1.10.26 and later)
● Kubernetes deve avere un minimo di 2 nodi nel cluster con le
seguenti caratteristiche:
○ Almeno 2 CPU cores
○ Almeno 15 GiB di RAM
○ Almeno 250 GiB di spazio disco disponibile
● Architettura x86/x64 e sistema operativo Linux
● Ingress controller compatibile con Kubernetes installato (non è
parte dell’installazione Mulesoft)
13. Step 0: Verificare la connessione a
Amazon EKS
13
La prima operazione da eseguire è verificare la connessione con il cluster
Kubernetes creato su Amazon EKS.
E’ possibile seguire questo controllo in due modi:
● Utilizzare la riga di comando kubectl ed eseguire:
$ kubectl get svc
● Utilizzare una GUI per Kubernetes (ad esempio Lens*)
* è possibile scaricare Lens dal sito: https://k8slens.dev/
14. Step 1: Configurazione della rete
14
Queste sono le porte che devono essere aperte per permettere le
comunicazioni da e verso Runtime Fabric.
La configurazione deve essere effettuata su Amazon EKS.
More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/install-self-managed#step-1-
configure-your-network-to-support-
runtime-fabric-on-self-managed-
Port Layer 4
Protocol
Layer 5
Protocol
Source Destination Description
443 TCP HTTPS Internet All nodes Allow inbound requests to Mule runtime servers
443 TCP AMQP over
WebSockets
All
nodes
Internet Anypoint Platform management services
443 TCP HTTPS All
nodes
Internet API Manager policy updates, API Analytics Ingestion, and
Resource retrieval (application files, container images).
443 (v1.8.50,
or later)
TCP Lumberjack All
nodes
Internet Anypoint Monitoring, Anypoint Visualizer
5044
(deprecated)
TCP Lumberjack All
nodes
Internet Anypoint Monitoring, Anypoint Visualizer
This port and hostname are deprecated in Anypoint
Runtime Fabric, version 1.8.50 and later.
If you are using a previous version of Anypoint Runtime
Fabric you must add this port your allow list. If you are
using a newer version, use the port and hostname
specified above.
15. Step 2: Creazione di Runtime Fabric in Runtime
Manager
15
In questa fase si crea istanza di Runtime Fabric lato Anypoint Control Plane
nella sezione “Runtime Manager”
More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/install-self-managed#step-2-
create-a-runtime-fabric-using-runtime-
manager
16. Step 3: Scaricare utility rtfctl
16
Scaricando utility rtfctl si prosegue con la creazione degli oggetti Runtime Fabric su
Kubernetes
Download the rtfctl command-line utility:
rtfctl è supportato per Windows, MacOS (Darwin), e Linux. Per scaricare utilizzare la
URL di seguito:
Windows:
$ curl -L
https://anypoint.mulesoft.com/runtimefabric/api/download/rtfctl
-windows/latest -o rtfctl.exe
MacOS (Darwin):
$ curl -L
https://anypoint.mulesoft.com/runtimefabric/api/download/rtfctl
-darwin/latest -o rtfctl
Linux:
$ curl -L
https://anypoint.mulesoft.com/runtimefabric/api/download/rtfctl
/latest -o rtfctl
Cambiare i permessi di esecuzione per rtfctl command-line utility:
$ sudo chmod +x rtfctl
More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/install-self-managed#step-3-
download-the-rtfctl-utility
17. Step 4: Installare Runtime Fabric
17
Verificare che l’utility da riga di comando kubectl sia configurata
per raggiungere il cluster Kubernetes EKS su AWS.
Verificare che Kubernetes sia pronto per installazione:
$ rtfctl validate <activation_data>
La verifica effettua i seguenti controlli:
● The Kubernetes environment is running.
● All required components exist.
● All required services are available.
Ogni anomalia viene evidenziata nell’output del comando
Install Runtime Fabric:
$ rtfctl install <activation_data>
<activation_data> è la stringa ottenuta nell’istanza Runtime Fabric
creata precedentemente in Runtime Manager.
More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/install-self-managed#step-4-
install-runtime-fabric
18. Step 5: Inserire la Licenza Mulesoft
18
Si procede quindi ad inserire la licenza Mule
Encoding Base64 del file .lic fornito da MuleSoft:
On MacOS, run the following command:
$ base64 -b0 license.lic
On Unix, run the following command:
$ base64 -w0 license.lic
Per Windows, è necessario uno shell terminal emulator (ad esempio
cygwin)
$ base64 -w0 license.lic
Inserimento della chiave della licenza:
$ rtfctl apply mule-license BASE64_ENCODED_LICENSE
Per verifciare che la licenza sia stata applicata correttamente:
$ rtfctl get mule-license More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/install-self-managed#step-5-
insert-the-mule-license-key
19. Step 6: Associare Environment
19
Si associano gli Environment (ad esempio Prod, Sandbox etc) al
cluster Runtime Fabric creato
20. Step 7: Configurare Ingress controller
20
La configurazione dell’Ingress Controller è a discrezione
del cliente. In questo caso utilizziamo NGINX
E’ necessario installare Ingress controller specifico per
Amazon EKS:
$ kubectl apply -f
https://raw.githubusercontent.com/kubernete
s/ingress-nginx/controller-
v1.1.1/deploy/static/provider/aws/deploy.ya
ml
Si procede poi ad installare il template specifico per
Runtime Fabric che verrà utilizzato al momento del deploy
della app Mulesoft
$ kubectl apply -f rtf-ingress-template-
deploy.yaml
Questo template è personalizzabile in base a come si
intende plubblicare i servizi: Internet intranet e come
risolvere i nomi delle Mule APP.
More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/custom-ingress-configuration
21. Step 8: Disinstallazione di Runtime Fabric
21
Per disinstallare Runtime Fabric da Amazon EKS è possibile
utilizzare utility a riga di comando.
● Utilizando il Runtime Manager, cancellare tutte le applicazioni
Mule e le API gateways installate su Runtime Fabric.
● Verificare da tutti gli environments associati che tutte le
applicazioni siano state rimosse.
● Utilizando Runtime Manager, procedere alla cancellazione
dell’istanza di Runtime Fabric.
● Eseguire il comando $ rtfctl uninstall per disinstallare i
servizi Runtime Fabric services dal cluster Kubernetes.
● Eseguire il comando $ rtfctl uninstall --confirm
per verificare l’esecuzione del comando di disinstallazione.
● Alla fine verificare che tutti i servizi di Runtime Fabric non
siano piu presenti nel cluster Kubernetes. More info:
https://docs.mulesoft.com/runtime-
fabric/1.11/uninstall-self
22. Internals di Runtime Fabric su Kubernetes
22
A valle dell’installazione di Runtime Fabric vengono creati una
serie di oggetti all’interno di Kubernetes che sono necessari per il
funzionamento e il collegamento con Anypoint Control Plane.
● Viene creato un Namespace rtf che contiene tutti gli oggetti
di Runtime Fabric
● Per ogni Environment definito su Anypoint Control Plane (ad
esempio Sandbox, Prod etc) viene creato al primo deploy di
una applicazione un Namespace contraddistinto da uno UUID
riferito all’environment
● Ingress Template (nel nostro case Nginx) è creato nel
Namespace rtf come template. Ogni volta che si esegue il
deploy di un’applicazione Mule viene utilizzato e copiato nel
Namespace relativo all’environment specificato.
● In caso di utilizzo di scheduler all’interno dell’applicazione
Mule sarà necessario attivare la modalità cluster per l’elezione
del master tra le varie istanze deployate su kubernetes
24. Write once run everywhere
24
● Adottando Anypoint Runtime Fabric è possibile eseguire il
deploy delle applicazioni Mule già sviluppate per CloudHub.
● Sarà possibile gestire il ciclo di vita dell ‘applicazione
direttamente da Anypoint Runtime Manager e beneficiare di tutte
le funzionalità
● La gestione del deploy delle applicazioni da UI è molto simile a
quello su CloudHub quindi l’impatto a livello operations è minimo
(Deploy tramite API è specifico per Runtime Fabric)
● L’agent di Runtime Fabric (all’interno del Namespace rtf) si
occupa di intercettare le richieste di deploy e creare i relativi
manifest K8s (Service e Deployment)
● Ogni Applicazione Mule è modellata come deployment e
distribuita in un POD di k8s. Per ogni applicazione vengono
instanziati 3 container: App, Init e Monitoring
More info:
25. MuleSoft components only
RTF Migration Assessment
# Component Delta Impact
1 HTTP Listener RTF Services listening on port http.port
8081 is the target port for both http and https (even for internal communications)
Port 8081 is on the POD level, not the nodes so no need to set a rule for port 8081 if there is a
firewall for internal communication
HTTP Listener config for
all services
2 Service Discovery Internal services discovered as documented here
General services discovery (automatic DNS entry for cluster.local domain):
<app>.<namespace>.svc.cluster.local/
And within same namespace (same BG and Environment):
http://<app>:8081/
HTTP Request Connector
config
3 Pipeline Different deployment process (dedicated set of APIs). Documented here. Pipeline
pom.xml
4 Templating Different allocation methods (not present vCores fixed increments like for CloudHub). New
parameters:
● Reserved CPU
● CPU Limit
● Memory
Template and Pipeline
26. # Component Delta Impact
5 Secure Properties Secure Properties not supported anymore in RTF. Secrets are internally managed through Kubernetes
Secrets, as documented here.
As an alternative to be introduced Custom Properties Provider, or properties injection from CI/CD pipeline
(side-effect, not possible to hide properties like in CloudHub).
CI/CD pipeline
Properties Mngt.
6 Object Store OSv2 not supported (see here). Embedded Object Store is by definition ephemeral (linked to Pod lifecycle).
As an alternative Persistence Gateway can be used (it relies on OSv2 APIs and an external PostGre DB)
This impacts also all Processors relying behind the hood on OS (i.e. On Table Row for watermarking
storage)
Switch from OSv2 to another
storage
Custom watermarking
implementation relying on a
different storage
7 Scheduler Runtime Fabric does not allow management of Poll or Schedule scope via the Runtime Manager interface
(see here). Any configured Poll or Schedule scope will trigger against the clock of the machine the
application is running on. The timezone for a Cron expression trigger can be configured as part of the mule
configuration.
Schedule frequency to be
embedded in Processor
8 AWS Resources Access through AWS Default Profile chain (assume Role) Connector config
9 Resource Usage
Monitoring
To be introduced in order to monitor license compliance New
MuleSoft components only
RTF Migration Assessment
32. 32
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/rome/
● 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?