Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/scalable-core/com.h2datab…
Browse files Browse the repository at this point in the history
…ase-h2-2.2.220
  • Loading branch information
songxiaosheng authored Sep 2, 2023
2 parents 0e16a9a + b5fe631 commit 67dec10
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<curator.version>5.2.0</curator.version>
<client-java.version>18.0.1</client-java.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -28,6 +29,14 @@
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.kubernetes/client-java -->
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
<version>${client-java.version}</version>
</dependency>


</dependencies>
</dependencyManagement>
<dependencies>
Expand Down
9 changes: 9 additions & 0 deletions scalable-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>link.elatic</groupId>
<artifactId>scalable</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>link.elastic</groupId>
<artifactId>scalable-core</artifactId>
<version>1.0-SNAPSHOT</version>
Expand Down Expand Up @@ -44,6 +49,10 @@
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package link.elastic.scalable.core.resource.kubernetes.log;

import io.kubernetes.client.PodLogs;
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.openapi.models.V1Pod;
import io.kubernetes.client.util.Config;
import io.kubernetes.client.util.Streams;

import java.io.IOException;
import java.io.InputStream;

public class LogVisit {
public static void main(String[] args) throws IOException, ApiException {
ApiClient client = Config.defaultClient();
Configuration.setDefaultApiClient(client);
CoreV1Api coreApi = new CoreV1Api(client);

PodLogs logs = new PodLogs();
V1Pod pod =
coreApi
.listNamespacedPod(
"default", "false", null, null, null, null, null, null, null, null, null)
.getItems()
.get(0);

InputStream is = logs.streamNamespacedPodLog(pod);
Streams.copy(is, System.out);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package link.elastic.scalable.core.resource.kubernetes;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package link.elastic.scalable.core.resource;

0 comments on commit 67dec10

Please sign in to comment.