SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Source to Service Mesh with Ballerina and Istio
Lakmal Warusawithana
@lakwarus
In the old days...
We write a program, build it and then
just run that program.
Now...
We write it, build it and then have
various ways of running it;
.balx
ballerina build <source.bal>
FROM ballerina/ballerina
COPY demo.balx /home/ballerina
EXPOSE 9090
CMD ballerina run demo.balx
Create a Dockerfile
$> docker build -t my-app .
Sending build context to Docker daemon 7.168kB
Step 1/4 : from ballerina/ballerina
---> a65975411327
Step 2/4 : COPY demo.balx /home/ballerina
---> 3b4e481bef57
Step 3/4 : EXPOSE 9090
---> d95a1292b232
Step 4/4 : CMD ballerina run demo.balx
---> 2698c40bdadd
Successfully built 2698c40bdadd
Successfully tagged my-app:latest
Create the docker image
$> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my-app latest 2698c40bdadd 1 minute ago 128MB
List the docker image
$>docker run -it -p 9090:9090 my-app
ballerina: initiating service(s) in 'demo.balx'
ballerina: started HTTP/WS endpoint 0.0.0.0:9090
Ballerina natively understand Docker
Lets see how we can run our app in the
Kubernetes?
Now...
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-deployment
labels:
app: my-app
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:latest
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 9090
Create a deployment.yaml
$>kubectl apply -f deployment.yaml
deployment.extensions "my-app-deployment" created
$>kubectl get pods
NAME READY STATUS RESTARTS AGE
my-app-666f4f4bbf 1/1 Running 0 50s
apiVersion: "v1"
kind: "Service"
metadata:
labels:
app: "my-app"
name: "my-app"
spec:
ports:
- port: 9090
protocol: "TCP"
targetPort: 9090
selector:
app: "my-app"
type: "NodePort"
Create a service.yaml
$>kubectl apply -f my-app-service.yaml
service "hello-service" created
$>kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-app NodePort 10.110.136.115 <none> 9090:31657/TCP 5m
However, those parts are not part of
the programming experience for the
developer.
Ballerina natively understand Kubernetes
Book Shop Composite App
caller Book Shop
response
Book Details Book Review
Book id
Book details
Book reviews
Overview of Service Mesh and Istio
Ballerina natively understand Istio
Q & A
THANK YOU

Contenu connexe

Plus de Ballerina

Plus de Ballerina (18)

Data integration
Data integrationData integration
Data integration
 
Service resiliency in microservices
Service resiliency in microservicesService resiliency in microservices
Service resiliency in microservices
 
Microservices integration
Microservices integration   Microservices integration
Microservices integration
 
Writing microservices
Writing microservicesWriting microservices
Writing microservices
 
Ballerina philosophy
Ballerina philosophy Ballerina philosophy
Ballerina philosophy
 
Ballerina: Cloud Native Programming Language
Ballerina: Cloud Native Programming Language Ballerina: Cloud Native Programming Language
Ballerina: Cloud Native Programming Language
 
Writing services in Ballerina_Ballerina Day CMB 2018
Writing services in Ballerina_Ballerina Day CMB 2018Writing services in Ballerina_Ballerina Day CMB 2018
Writing services in Ballerina_Ballerina Day CMB 2018
 
Resiliency & Security_Ballerina Day CMB 2018
Resiliency & Security_Ballerina Day CMB 2018  Resiliency & Security_Ballerina Day CMB 2018
Resiliency & Security_Ballerina Day CMB 2018
 
Stream Processing with Ballerina
Stream Processing with BallerinaStream Processing with Ballerina
Stream Processing with Ballerina
 
Secure by Design Microservices & Integrations
Secure by Design Microservices & IntegrationsSecure by Design Microservices & Integrations
Secure by Design Microservices & Integrations
 
Observability with Ballerina
Observability with BallerinaObservability with Ballerina
Observability with Ballerina
 
Serverless Ballerina
Serverless BallerinaServerless Ballerina
Serverless Ballerina
 
Test Driven Development for Microservices
Test Driven Development for MicroservicesTest Driven Development for Microservices
Test Driven Development for Microservices
 
Service Mesh in Practice
Service Mesh in PracticeService Mesh in Practice
Service Mesh in Practice
 
Cloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and KubernetesCloud Native Programing with Docker and Kubernetes
Cloud Native Programing with Docker and Kubernetes
 
Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)Ballerina is not Java (or Go or ..)
Ballerina is not Java (or Go or ..)
 
Ballerina: Cloud Native Programming Language
Ballerina: Cloud Native Programming LanguageBallerina: Cloud Native Programming Language
Ballerina: Cloud Native Programming Language
 
Ballerina Serverless with Kubeless
Ballerina Serverless with KubelessBallerina Serverless with Kubeless
Ballerina Serverless with Kubeless
 

Dernier

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (20)

Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Source to service mesh with Ballerina and Istio_KubeCon 2018