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.

The Experience of Java on Kubernetes with Microservices from HackFest

This is the presentation material which I presented at Oracle CodeOne 2018.

  • Be the first to comment

The Experience of Java on Kubernetes with Microservices from HackFest

  1. 1. Microsoft Corporation Sr. Cloud Developer Advocate Java Champion Yoshio Terada
  2. 2. • GlassFish Evangelist at Sun Microsystems 2001 - 2010 • Java SE/EE Evangelist at Oracle Japan 2010 - 2015 • Java Evangelist • Cloud Developer Advocate at Microsoft Japan 2015 – • Tech Conference Speaker in Japan Self Introduction
  3. 3. I will share the Important Topic Java - Basic Docker - Basic Kubernetes - Experience Dev & DevOps Java Fun Demo ! Bot on Serverless & Voice operate k8s
  4. 4. When you touch a new technology, You may encounter some problems, But please Overcome it and let's make a better future !!
  5. 5. RUN /jdk-11/bin/jlink --module-path /jdk-11/jmods --add-modules java.base,java.logging,java.xml, jdk.unsupported,java.sql,java.naming, java.desktop,java.management, java.security.jgss,java.instrument --compress 2 --no-header-files --no-man-pages --output /tmp/custom-jdk-11-min Create Custom JRE since Java 9
  6. 6. Improvement for Container since JDK10 Container detection and Resource config usage CPU and Memory allocation for container become correct value. Change RAM usage in Container -XX:InitialRAMPercentage -XX:MaxRAMPercentage -XX:MinRAMPercentage
  7. 7. Take care of using JDK 11
  8. 8. • java.xml.ws (JAX-WS、Web Services) • java.xml.bind (JAXB) • java.activation (JAF) • java.xml.ws.annotation (Common Annotation) • java.corba (CORBA) • java.transaction (JTA) • java.se.ee • jdk.xml.ws (JAX-WS Tool) • jdk.xml.bind (JAXB Tool) Removed Package since JDK 11 Same Enterprise Application will not run on JDK 11. Because many enterprise was using XML.
  9. 9. However we should move forward to JDK 11
  10. 10. Don't use the latest tag $ docker build -t myimage/app:latest . $ docker tag myimage/app:latest private-repo.azurecr.io/myimage/app:latest $ docker push private-repo.azurecr.io/myimage/app:latest
  11. 11. Please Use BuildId instead of latest
  12. 12. Please create small size of Image $ docker images|grep openjdk openjdk 8u171-jre-alpine3.8 ccfb0c 83MB openjdk 8u171-jre bef23b 443MB openjdk latest 82f76 977MB
  13. 13. The case : Payara Micro Image $ docker images |grep account tyoshio2002/account-service 1.4 1fcf34937c1c 4 minutes ago 178MB
  14. 14. Permission of User FROM openjdk:8-jre-alpine LABEL MAINTAINER Yoshio Terada COPY ./target/front-end-svc-1.0-SNAPSHOT.jar /tmp/app.jar RUN addgroup -g 1000 java RUN adduser -D -u 1000 -G java java RUN chown java:java /tmp/payara-micro.jar USER java EXPOSE 8080 ENTRYPOINT java -jar /tmp/app.jar
  15. 15. k8s is not Silver Bullet
  16. 16. It is not for Production !! https://github.com/yoshioterada/k8s-Azure-Container-Service-AKS--on-Azure/blob/master/Kubernetes-Workshop3.md Configuration for Deployment
  17. 17. Easy for Hello World
  18. 18. https://github.com/yoshioterada/k8s-Azure-Container-Service-AKS--on-Azure/blob/master/Kubernetes-Workshop3.md Many additional Configuragtion is Need
  19. 19. Request Limitation $ kubectl top pod NAME CPU(cores) MEMORY(bytes) account-service-74b64648b7-2bqgs 3m 842Mi account-service-74b64648b7-48kf8 3m 826Mi For CPU entry: The above 0.5(500m) is guaranteed to use the half CPU in 1 CPU. The expression 0.1 is equivalent to the expression 100m, which can be read as “one hundred millicpu”. CPU is always requested as an absolute quantity, never as a relative quantity. For Memory entry: You can express memory as a plain integer or as a fixed- point integer using one of these suffixes: E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. For example, the following represent roughly the same value:
  20. 20. Service V1 Pod Account Service V1 Pod Account Service V2 Pod Account Service V2 Pod Account Service Account Service Understand “Label & Selector” is Important
  21. 21. I Recommended Customer Not to use the Persistence Volume on k8s
  22. 22. Not Only Azure, But also it may occure on Others
  23. 23. Instead of mount the Volume I recommend to use SDK !!
  24. 24. Managed DB Access via Secure VNet
  25. 25. 1. Version UP 2. Staging & Production 3. High Availability
  26. 26. Only “One Command” or “Push the Button” ! $ az aks upgrade --name yoshio-java-aks ¥ --resource-group yoshio-java-aks ¥ --kubernetes-version 1.11.3 --yes ¥ --debug Sounds like Very Easy !!
  27. 27. Please Wait !!
  28. 28. 7. Take Care of k8s Version Up ? This is not only Azure but others too ! • If executed the command failed, what do you do ? • If you version up the k8s, Old Configuration may not Run on new Version. -> Need to modify YAML file. -> Need to specify new command option 3rd Party utilities may not run on new Version Best way is to create new k8s cluster environment
  29. 29. Version Up the k8s Master VM (node) VM (node) Version11.2 Master VM (node) VM (node) Version 12.1 I recommend to create new Cluster
  30. 30. Dev & Staging & Production (Multi Tenant) Master VM (node) VM (node) Staging Version11.2 Master VM (node) VM (node) Production Version 11.2 I recommend to create new Cluster for safe resource Isolation
  31. 31. High Available k8s Env on 2 Region Master VM (node) VM (node) Master VM (node) VM (node) West Region East Region Traffic Manager (DNS Base) (LB West) (LB East)
  32. 32. Trouble
  33. 33. 1. Broken by upgrade k8s version (Ex:1.8 → 1.9) 2. Failed to scale the Linux VM 3. So many PODs course operation unavailable 4. YAML Configuration failed when upgrade 5. Attach/Detach PV failed 6. 3rd Party Tool(like Istio) version compatibility Actual Trouble I faced
  34. 34. 1. kubectl describe pod 2. kubectl logs POD_NAME 3. kubectl exec -it POD_NAME /bin/sh 4. kubectl get events –w 5. Deploy Ubuntu pod in same NameSpace When you faced the problem
  35. 35. Supported Java on Azure
  36. 36. Free for Java Developer of Azure User https://www.azul.com/downloads/azure-only/zulu/
  37. 37. Azul zule on Docker for Azure $ docker pull mcr.microsoft.com/java/jre:8u181-zulu-alpine https://www.azul.com/downloads/azure-only/zulu/ These downloadable binaries are free to download but can only be used with Java applications or Java application components that are being developed for deployment on Microsoft Azure Cloud or Azure Stack and are not intended to be used for any other purpose.
  38. 38. How many minutes? Do you spend to create DevOps Environment?
  39. 39. I spend 2-3 Day to create DevOps Env.
  40. 40. (Aka :Visual Studio Team Services) You can use it for any Environment include AWS, GCP, Oracle
  41. 41. Azure DevOps Providing
  42. 42. Just only Few Click !!
  43. 43. Free !! I’m not a Sales Person !!
  44. 44. Bot on Serverless & Void Operate k8s Fan Demo
  45. 45. LUIS Bot クライアント k8s operation by Slack & Voice Msg
  46. 46. https://www.luis.ai/
  47. 47. When you touch a new technology, You may encounter some problems, But please Overcome it and let's make a better future !!
  48. 48. Engineer can change the World !!
  49. 49. Microsoft Java
  50. 50. Microsoft Corporation Sr. Cloud Developer Advocate Java Champion Yoshio Terada

    Be the first to comment

    Login to see the comments

  • giriprasads1

    Sep. 10, 2019

This is the presentation material which I presented at Oracle CodeOne 2018.

Views

Total views

1,283

On Slideshare

0

From embeds

0

Number of embeds

3

Actions

Downloads

14

Shares

0

Comments

0

Likes

1

×