Git Product home page Git Product logo

spring-kubernetes-microservices's Introduction

Spring Kubernetes Micro Services Showcase

Kubernetes is leading orchestration framework which enables automated deployments, scaling, and management of containerized applications. Spring Kubernetes Micro Services is a showcase application which uses the new Spring Cloud Kubernetes framework to manage service discovery and is deployed on kubernetes network. The application provides services to fetch the generated report documents using Spring Batch and stored on a Minio cloud storage. The application has below services.

  • Discovery Service: Eureka discovery service allows micro services to find and communicate with each other for local testing. Kubernetes uses Spring Cloud Kubernetes for service discovery.

  • Data Service: Data service provides reactive services using Spring WebFlux to store and fetch report document data.

  • Minio Service: Minio service provides private cloud storage services to store and fetch files.

  • Storage Service: Storage services provide service to fetch files using object id and bucket.

  • Document Service: Document service exposes services to get list of reports for the user and download them using document id.

  • Elastic Logging: ElasticSearch-Beats-Logstash-Kibana provides log storage and management.

  • Ingress Controller: Ingress controller is responsible for directing external traffic to corresponding Kubernetes service within the cluster.

    Spring Kubernetes Microservices Design

Follow the below documentation in order to setup this application using Kubernetes.

  • Kubernetes Architecture: Blog post discussing Kubernetes concepts, architecture and various commands in depth.
  • Kubernetes Installation: Setup Kubernetes Master and Worker nodes for Ubuntu Bionic. Please refer to various documentations online for respective operating systems.
  • Docker Registry: Docker registry setup is required to distribute docker images to various Kubernetes pods.
  • Kubernetes Commands: Kubernetes commands provides some frequently used commands to deploy and delete/clean up Kubernetes services and debug or troubleshoot kubernetes pods.
  • Helm: Helm is the package manager for Kubernetes which assists in installing and managing applications on Kubernetes clusters.

spring-kubernetes-microservices's People

Contributors

pranav-patil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-kubernetes-microservices's Issues

Kubernetes Cassandra-Service fails when configured using cassandra docker image

The cassandra non-seed pods fails with the error Unable to gossip with any peers, after cassandra seed pods starts up when deploying kubernetes cassandra-service. Some solutions recommend setting CASSANDRA_LISTEN_ADDRESS in cassandra docker environment variables to pod IP address as in Issue#95 but this does not work. This issue is raised in Cassandra-Jira and claimed to be resolved but yet persists. Refer to the cassandra-service.yaml for kubernetes configuration.

INFO  [HANDSHAKE-cassandra-0.cassandra.default.svc.cluster.local/192.168.232.42] 2019-09-15 01:02:10,508 OutboundTcpConnection.java:561 - Handshaking version with cassandra-0.cassandra.default.svc.cluster.local/192.168.232.42
Exception (java.lang.RuntimeException) encountered during startup: Unable to gossip with any peers
java.lang.RuntimeException: Unable to gossip with any peers
        at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1435)
        at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:566)
        at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:823)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:683)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:632)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:388)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:732)
ERROR [main] 2019-09-15 01:03:11,507 CassandraDaemon.java:749 - Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any peers
        at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1435) ~[apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:566) ~[apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:823) ~[apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:683) ~[apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:632) ~[apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:388) [apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620) [apache-cassandra-3.11.4.jar:3.11.4]
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:732) [apache-cassandra-3.11.4.jar:3.11.4]
INFO  [StorageServiceShutdownHook] 2019-09-15 01:03:11,806 HintsService.java:209 - Paused hints dispatch
WARN  [StorageServiceShutdownHook] 2019-09-15 01:03:11,807 Gossiper.java:1559 - No local state, state is in silent shutdown, or node hasn't joined, not announcing shutdown
INFO  [StorageServiceShutdownHook] 2019-09-15 01:03:11,812 MessagingService.java:981 - Waiting for messaging service to quiesce
INFO  [ACCEPT-/192.168.41.235] 2019-09-15 01:03:11,813 MessagingService.java:1336 - MessagingService has terminated the accept() thread
INFO  [StorageServiceShutdownHook] 2019-09-15 01:03:16,822 HintsService.java:209 - Paused hints dispatch

FileBeat log configuration not working

The LogStash service is unable to fetch the logs from FileBeat with the filebeat-ds.yaml config file. Currently the application logback directly sends all the logs to 5044 to logstash server. The application logback should be switched to standard ConsoleAppender, with a LogstashEncoder needed to encode logs in JSON. Filebeat should be configured to extract the application logs from the Kubernetes Pod logs.
FileBeat later decodes JSON log using decode_json_fields to map each field (such as timestamp, version, message, logger_name, โ€ฆ) to an indexed Elasticsearch field.

<configuration>
    <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
    </appender>
    <root level="INFO">
        <appender-ref ref="jsonConsoleAppender"/>
    </root>
</configuration>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.