Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java Spring Boot on K8s with C4C

Java Spring Boot on K8s with C4C

本資料はOSC東京2019春にて登壇した資料になります。

Taiji HAGINO

February 22, 2019
Tweet

More Decks by Taiji HAGINO

Other Decks in Technology

Transcript

  1. TECHNOLOGISTS RULE THE WORLD      

     #    "! $ %   
  2. ,, (&& Ph deS R (&& (&&( . (&&( (&&)

    29J9 aV7 JB 27 02. (&&) (&&* 29J9 1B9 1B9 6 CE (&&* (&&, 29J9 b V g (&&, F F E A 4 A 7 N R V- E fS29J9i P O
  3. B

  4. ) (

  5. ,2% &% •IBM Cloud Kubernetes Service (IKS): IBM Cloud-( !&%

    &$&#% & •Compose for MySQL: &%&.*RDB •IBM Cloud FuncAons: &&$ & " %!%+1 &&) /'0FaaS (FuncAon as a Service) 3
  6. % 1.  Clone 2.   3. Spring Boot

    Microservices 4. IBM Cloud Functions$#  ("!) 5. Microservices 6.    
  7. MySQL $ kubectl create -f account-database.yaml service "account-database" created deployment

    "account-database" created $ kubectl apply -f secrets.yaml secret "demo-credentials" created IBM Cloud Compose for MySQL DB or
  8. MySQL $ kubectl create -f account-database.yaml service "account-database" created deployment

    "account-database" created $ kubectl apply -f secrets.yaml secret "demo-credentials" created IBM Cloud Compose for MySQL DB or
  9. Create the Spring Boot Microservices Maven  $ brew install

    maven $ mvn --version Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T03:41:47+09:00)
  10. Maven& #" MavenJava #-( ,. +' Docker" "  %*

    Docker!$,.)/ Go to containers/compute-interest-api $ mvn package Go to containers/send-notification $ mvn package
  11. DockerSpringBoot  IBM Cloud Container Registry !  Docker hub

    !   Docker hub  $ docker build -t $DOCKERHUB_USERNAME/compute-interest-api:latest containers/compute-interest-api/ $ docker build -t $DOCKERHUB_USERNAME/send-notification:latest containers/send-notification/ $ docker push $DOCKERHUB_USERNAME/compute-interest-api:latest $ docker push $DOCKERHUB_USERNAME/send-notification:latest
  12. compute-interest-api.yaml  send-notification.yaml  Docker     

    # compute-interest-api.yaml spec: containers: - image: <your image> # send-notification.yaml spec: containers: - image: <your image>
  13. Spring Boot Microservices $ kubectl apply -f compute-interest-api.yaml service "compute-interest-api"

    created deployment "compute-interest- api" created $ kubectl apply -f send-notification.yaml service "send-notification" created deployment "send-notification" created
  14. Frontend service  $ kubectl apply -f account-summary.yaml service "account-summary"

    created deployment "account-summary" created   Node.js Web
  15. Transaction Generator $ kubectl apply -f transaction-generator.yaml service "transaction-generator" created

    deployment "transaction- generator" created   Python