GithubHelp home page GithubHelp logo

piomin / kubernetes-quickstart Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 4.0 31 KB

Demo Java apps for several scenarios on Kubernetes

Home Page: https://piotrminkowski.com/

Java 100.00%
java jib kafka kubernetes skaffold spring-boot

kubernetes-quickstart's Introduction

Demo Java Apps for Kubernetes Twitter

In this repository, you will find the simple Java apps to run on Kubernetes for a particular scenario. Currently, there are apps for:

  • Kafka (kafka directory)

In order to easily run the apps directly from the source you need to install skaffold.

Articles

I'm using those apps in the several articles on my blog. Here's the list:

  1. How to run and manage Kafka on Kubernetes with the Strimzi operator. We run two simple apps for sending messages (kafka/producer) and receiving them for Kafka topic (kafka/consumer). A detailed guide may be found in the following article: Apache Kafka on Kubernetes with Strimzi

Usage

In order to run the example apps you need to have:

  • JDK17+
  • Maven
  • Skaffold
  • Kubernetes cluster

Apache Kafka

Go to the kafka directory. It contains to sample apps: producer and consumer.

To run them on Kubernetes just execute:

skaffold run --tail 

You can also automatically create and configure Kafka based on Strimzi by activating the kafka-strimzi profile:

skaffold run --tail -p kafka-strimzi 

However, first you need to install Strimzi, e.g. using its Helm chart:

helm repo add strimzi https://strimzi.io/charts
helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator 

kubernetes-quickstart's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kubernetes-quickstart's Issues

Producer not having traces (but consumer has)

Hello there,

First of all, if not anything else, I wanted to say thank you for this project.
The code, as well as the blogpost, is easy to read, easy to understand.

I wanted to reach out, because it seems there is an issue with the code.
I added this pattern statement in the property file:

logging.pattern.console: '%d{yyyy-MM-dd HH:mm:ss} ${PID} %-5level --- [%thread] [${spring.application.name:},%X{traceId:-},%X{spanId:-}] %logger{36} : %msg%n'

Please note the },%X{traceId:-},%X{spanId:-}]

With that, I would have expected logs within your project to contain traces.

While the consumer here: https://github.com/piomin/kubernetes-quickstart/blob/master/kafka/consumer/src/main/java/pl/piomin/services/kafka/consumer/ListenerService.java#L21 does contain the traces in the output logs (great!)

I would have expected the trace to be the same here as well: https://github.com/piomin/kubernetes-quickstart/blob/master/kafka/producer/src/main/java/pl/piomin/services/kafka/producer/SenderService.java

Unfortunately, the trace is empty for the producer part.

May I ask if you reproduce the same?

If yes, how to fix this issue please?

Thank you

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Failed to look up docker package library/producer, Failed to look up docker package library/consumer, Failed to look up maven package pl.piomin.services:kafka.

Files affected: kafka/docker-compose.yml, kafka/common/pom.xml, kafka/consumer/pom.xml, kafka/producer/pom.xml


This repository currently has no open or pending branches.

Detected dependencies

circleci
.circleci/config.yml
  • cimg/openjdk 21.0.2
  • cimg/openjdk 21.0.2
  • maven 1.4.1
docker-compose
kafka/docker-compose.yml
  • producer 1.0-SNAPSHOT
  • consumer 1.0-SNAPSHOT
maven
kafka/common/pom.xml
  • pl.piomin.services:kafka 1.0-SNAPSHOT
kafka/consumer/pom.xml
  • pl.piomin.services:kafka 1.0-SNAPSHOT
kafka/pom.xml
  • org.springframework.boot:spring-boot-dependencies 3.3.0
kafka/producer/pom.xml
  • pl.piomin.services:kafka 1.0-SNAPSHOT
pom.xml
  • com.google.cloud.tools:jib-maven-plugin 3.4.3

  • Check this box to trigger a request for Renovate to run again on this repository

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.