Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Source to service mesh with Ballerina and Istio_KubeCon 2018

32 views

Published on

Istio is a service mesh cloud platform that helps to run a distributed microservice architecture; it provides a uniform way to secure, connect, and monitor microservices. The platform makes it easy to create a network of deployed services with load balancing, service-to-service authentication, monitoring, and more, without any changes in service code. After a developer builds a microservice, he/she needs to create a container image and a set of YAML files to deploy the microservice into Istio mesh. Most of the time, these parts are not part of the programming experience.

Ballerina is a cloud native programming language that understands the architecture around it. It is capable of auto-generating deployment artifacts like Docker images and Kubernetes YAMLs. This session will discuss the advantage of having a service mesh and a cloud native programing language in your microservice application ecosystem. The session will also demonstrate how a developer can deploy from source to Istio service mesh by adding a set of annotations in the source code.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Source to service mesh with Ballerina and Istio_KubeCon 2018

  1. 1. Source to Service Mesh with Ballerina and Istio Lakmal Warusawithana @lakwarus
  2. 2. In the old days... We write a program, build it and then just run that program.
  3. 3. Now... We write it, build it and then have various ways of running it;
  4. 4. .balx ballerina build <source.bal>
  5. 5. FROM ballerina/ballerina COPY demo.balx /home/ballerina EXPOSE 9090 CMD ballerina run demo.balx Create a Dockerfile
  6. 6. $> 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
  7. 7. $> docker images REPOSITORY TAG IMAGE ID CREATED SIZE my-app latest 2698c40bdadd 1 minute ago 128MB List the docker image
  8. 8. $>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
  9. 9. Ballerina natively understand Docker
  10. 10. Lets see how we can run our app in the Kubernetes? Now...
  11. 11. 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
  12. 12. $>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
  13. 13. 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
  14. 14. $>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
  15. 15. However, those parts are not part of the programming experience for the developer.
  16. 16. Ballerina natively understand Kubernetes
  17. 17. Book Shop Composite App caller Book Shop response Book Details Book Review Book id Book details Book reviews
  18. 18. Overview of Service Mesh and Istio
  19. 19. Ballerina natively understand Istio
  20. 20. Q & A
  21. 21. THANK YOU

×