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.

Cloud-Native Sling

279 views

Published on



Kubernetes is quickly becoming the de facto deployment platform for container runtimes. Sling provides a quick out-of-the box experience using the Starter jar, but this kind of setup is not always easy to deploy in containers.

In this talk we will present how a Sling application can be deployed on a Kubernetes platform, exploring various patterns such as scaling out, centralised logging and monitoring, content distribution and persistence.

After this talk participants will gain a better understanding about how Sling can be molded into a cloud-native applications without sacrificing the features that make Sling a strong development platform.

Published in: Software
  • Writing you here to say that this is one of the best collection of plans I've seen I'm on my 4th day and have already build a few wooden toys for my daughter! 》》》 https://url.cn/ktFCrsHZ
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Cloud-Native Sling

  1. 1. APACHE SLING & FRIENDS TECH MEETUP 2-4 SEPTEMBER 2019 Cloud-Native Sling Robert Munteanu, Adobe 1
  2. 2. Welcome 2
  3. 3. About me 3
  4. 4. Outline Cloud-native applications? Managing cloud-native applications Cloud-native Sling walkthrough Future plans Resources 4
  5. 5. Cloud-native applications? 5
  6. 6. Cloud-native applications 6
  7. 7. Defining cloud-native  Using cloud-native services Application-centric design Automation Cloud Native Architectures - Kamal Arora, Erik Farr, Tom Laszewski, Piyum Zonooz 7
  8. 8. Managing cloud-native applications 8
  9. 9. Containers, container, containers FROM openjdk:8-jre-alpine MAINTAINER dev@sling.apache.org RUN mkdir -p /opt/sling COPY target/sling-cloud-ready-*.jar /opt/sling/sling.jar WORKDIR /opt/sling EXPOSE 8080 VOLUME /opt/sling/sling ENV JAVA_OPTS -Xmx512m ENV SLING_OPTS '' CMD exec java $JAVA_OPTS -jar sling.jar $SLING_OPTS 9
  10. 10. Kubernetes 10
  11. 11. Kubernetes apiVersion: v1 kind: Pod metadata: name: nginx-pod labels: name: wildfly-pod spec: containers: - name: nginx image: nginx:1.17.1 ports: - containerPort: 80 11
  12. 12. Kubernetes interface $ kubectl get pods NAME READY STATUS A grafana-78c6877b7f-ghmwp 1/1 Running 1 prometheus-alertmanager-5cfb66f7f7-mtrx2 2/2 Running 1 prometheus-kube-state-metrics-57d85676c5-bvh5j 1/1 Running 1 prometheus-node-exporter-5pdnf 1/1 Running 1 prometheus-node-exporter-6qf72 1/1 Running 1 prometheus-node-exporter-h7bjx 1/1 Running 1 prometheus-node-exporter-wrxfl 1/1 Running 1 prometheus-pushgateway-86cf78b9f4-4m4fc 1/1 Running 1 prometheus-server-747fc94b5d-fx5qf 2/2 Running 1 12
  13. 13. What does Kubernetes manage? Applications (Pods, Services, Deployments) DNS services Volume management (NFS, Ceph, Azure/GCE disks, AWS EBS, etc) Software-defined networking Resource quotas (CPU, Memory, etc) Rollouts, rollbacks and scaling Secrets 13
  14. 14. Cloud-native Sling walkthrough 14
  15. 15. Logging [configurations] org.apache.sling.commons.log.LogManager org.apache.sling.commons.log.pattern="%d{dd.MM.yyyy HH:mm:ss.S org.apache.sling.commons.log.file="" org.apache.sling.commons.log.level="info" org.apache.sling.commons.log.packagingDataEnabled=B"true" 15
  16. 16. Logging $ kubectl logs -f sling 07.08.2019 10:50:45.212 *INFO* [FelixStartLevel] org.apache.sling.co 07.08.2019 10:50:45.216 *INFO* [FelixStartLevel] org.apache.geronimo 07.08.2019 10:50:45.216 *INFO* [FelixStartLevel] org.apache.geronimo 07.08.2019 10:50:45.219 *INFO* [FelixStartLevel] org.apache.geronimo 07.08.2019 10:50:45.221 *INFO* [FelixStartLevel] org.apache.felix.ev 07.08.2019 10:50:45.225 *INFO* [FelixStartLevel] org.apache.felix.ev 16
  17. 17. Logging 17
  18. 18. Startup readiness readinessProbe: httpGet: path: / port: 8080 initialDelaySeconds: 15 periodSeconds: 5 18
  19. 19. Startup readiness $ kubectl get pods -l=app=sling NAME READY STATUS AGE sling-59c6d6c656-857vq 0/1 Running 23s sling-59c6d6c656-9wlzm 0/1 Running 23s sling-59c6d6c656-cbbwc 1/1 Running 13m 19
  20. 20. Monitoring annotations: prometheus.io/scrape: "true" prometheus.io/port: "8080" 20
  21. 21. Monitoring 21
  22. 22. Persistence $ kubectl get svc mongo NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) mongo ClusterIP 10.102.248.138 <none> 27017/TCP 22
  23. 23. Persistence env: - name: SLING_OPTS value: -Dsling.run.modes=oak_mongo" 23
  24. 24. Persistence apiVersion: v1 kind: PersistentVolumeClaim metadata: name: sling-datastore spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi 24
  25. 25. Scalability - replicas: 1 + replicas: 3 25
  26. 26. Performance org.apache.sling.dynamicinclude.Configuration-starter include-filter.config.enabled=B"true" include-filter.config.resource-types=["sling/starter/hostname"] include-filter.config.path="/content/starter" include-filter.config.include-type="SSI" include-filter.config.add_comment=B 26
  27. 27. Performance apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress-sling annotations: # use the shared ingress-nginx kubernetes.io/ingress.class: "nginx" # set sticky sessions via cookie nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/configuration-snippet: | ssi on; 27
  28. 28. Performance <!-- SDI include (path: /content/starter/sidebar-extensions/hostna <h2>System information</h2> <p id="system-information">Currently running on host <span class=" 28
  29. 29. Future plans 29
  30. 30. Feature model Next big thing™! Smaller docker images More flexible feature selection 30
  31. 31. Docker image extensibility Base image + extensions Bring your own JVM 31
  32. 32. Composite NodeStore Clear separation of code from data Prevent config installation races at startup Scripting Bundle Tracker 32
  33. 33. Drop sticky sessions Encapsulated tokens like AEM Need to account for Oak DocumentNodeStore background sync delay 33
  34. 34. All good things... 34
  35. 35. Resources prometheus-exporter starter-extender https://hub.docker.com/r/apache/sling https://kubernetes.io/ https://github.com/apache/sling-whiteboard https:/github.com/rombert/sling-cloud-native 35

×