Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
026523e
chore: setup repo
lothar1998 May 9, 2025
e8e3efe
chore: setup gradle
lothar1998 Apr 18, 2025
e642f4a
chore: setup lib subproject dependencies
lothar1998 May 9, 2025
7509f4d
feat: kubernetes endpointslice models
lothar1998 May 9, 2025
8431af1
feat: kubernetes endpoint slice watchers
lothar1998 May 9, 2025
b457a63
chore: lib unit test dependecies
lothar1998 May 9, 2025
f43477e
test: kubernetes endpointslice watchers
lothar1998 May 9, 2025
cb49a47
feat: resolver target params parsing
lothar1998 May 9, 2025
5096e73
feat: name resolver
lothar1998 May 9, 2025
a63ed08
feat: name resolver provider
lothar1998 May 9, 2025
7d475c9
chore: setup github action to run unit tests in lib subproject
lothar1998 May 9, 2025
210d949
chore: setup test app subproject
lothar1998 May 9, 2025
9d35a4d
chore: setup grpc structure and generator
lothar1998 May 9, 2025
0d2e30a
feat: create test server that handles grpc traffic and exposes its ow…
lothar1998 May 9, 2025
d5fb664
feat: create test client that sends grpc requests and discovers serve…
lothar1998 May 9, 2025
e35be46
chore: create Dockerfile and building targets in Gradle
lothar1998 May 9, 2025
677f3cb
chore: setup integration test subproject
lothar1998 May 9, 2025
86d7949
feat: create IPsDiscoverer that discovers IPs using the test client app
lothar1998 May 9, 2025
59aff08
feat: create KubernetesManager that facilities setting up the integra…
lothar1998 May 9, 2025
d9f01ad
test: create integration test suite
lothar1998 May 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode
.github
67 changes: 0 additions & 67 deletions .github/workflows/gradle.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
unit-tests:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run Unit Tests
run: ./gradlew :lib:test --parallel

integration-tests:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Minikube
uses: medyagh/setup-minikube@latest
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run Integration Tests
run: |
eval $(minikube docker-env)
./gradlew buildDockerImages --parallel
./gradlew :test:test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Ignore Gradle build output directory
build

.idea
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# kuberesolver
# kuberesolver-java
Kuberesolver for Java
30 changes: 30 additions & 0 deletions integration/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM gradle:8.5.0-jdk21 AS build

WORKDIR /kuberesolver/
COPY ../../ ./

WORKDIR /kuberesolver/integration/app
RUN gradle :app:shadowJar

FROM eclipse-temurin:21-jre AS client

WORKDIR /app
COPY --from=build /kuberesolver/integration/app/build/libs/app-all.jar app.jar
ENTRYPOINT ["java", \
"--add-opens", "java.base/jdk.internal.misc=ALL-UNNAMED", \
"-cp", "app.jar", \
"io.github.lothar1998.kuberesolver.integration.app.Client", \
"--target", "kubernetes:///server", \
"--port", "50052" \
]

FROM eclipse-temurin:21-jre AS server

WORKDIR /app
COPY --from=build /kuberesolver/integration/app/build/libs/app-all.jar app.jar
ENTRYPOINT ["java", \
"--add-opens", "java.base/jdk.internal.misc=ALL-UNNAMED", \
"-cp", "app.jar", \
"io.github.lothar1998.kuberesolver.integration.app.Server", \
"--port", "50051" \
]
92 changes: 92 additions & 0 deletions integration/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
plugins {
id 'application'
id 'com.google.protobuf' version '0.9.5'
id 'com.gradleup.shadow' version '8.3.6'
}

repositories {
mavenCentral()
mavenLocal()
}

application {
mainClass = ''
}

dependencies {
testImplementation libs.junit.jupiter
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

compileOnly 'org.projectlombok:lombok:1.18.38'
annotationProcessor 'org.projectlombok:lombok:1.18.38'

implementation project(":lib")

if (JavaVersion.current().isJava9Compatible()) {
// Workaround for @javax.annotation.Generated
// see: https://github.com/grpc/grpc-java/issues/3633
implementation 'javax.annotation:javax.annotation-api:1.3.1'
}

implementation 'commons-cli:commons-cli:1.9.0'
implementation 'ch.qos.logback:logback-classic:1.5.18'
implementation 'com.google.protobuf:protobuf-java:4.30.2'
implementation 'io.grpc:grpc-protobuf:1.72.0'
implementation 'io.grpc:grpc-stub:1.72.0'
implementation 'io.grpc:grpc-netty-shaded:1.72.0'
implementation 'io.projectreactor.netty:reactor-netty-http:1.2.5'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.3'

protobuf files("proto/")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:4.30.2'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.72.0'
}
}
generateProtoTasks {
ofSourceSet('main').configureEach {
plugins {
grpc {}
}
}
}
}

shadowJar {
mergeServiceFiles()
}

def dockerfilePath = file("Dockerfile").absolutePath
def dockerContext = rootProject.projectDir.absolutePath

tasks.register('buildClientDockerImage', Exec) {
group = 'docker'
description = 'Builds Docker image for client target in integration app'
workingDir = dockerContext
commandLine 'sh', '-c', "docker build -f ${dockerfilePath} -t client --target client ${dockerContext}"
}

tasks.register('buildServerDockerImage', Exec) {
group = 'docker'
description = 'Builds Docker image for server target in integration app'
workingDir = dockerContext
commandLine 'sh', '-c', "docker build -f ${dockerfilePath} -t server --target server ${dockerContext}"
}

tasks.register('buildDockerImages') {
group = 'docker'
description = 'Builds both client and server Docker images'
dependsOn 'buildClientDockerImage', 'buildServerDockerImage'
}
14 changes: 14 additions & 0 deletions integration/app/proto/ip-service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
option java_package = "io.github.lothar1998.kuberesolver.integration.app.ip";

service IPService {
rpc WhatIsYourIP(IPRequest) returns (IPResponse);
}

message IPRequest {

}

message IPResponse {
repeated string ip_addresses = 1;
}
Loading
Loading