🩺 Add Healthcheck
This commit is contained in:
parent
63b8d65166
commit
64e0e59a9d
@ -15,16 +15,3 @@ services:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "6667:5432"
|
||||
big-bucket:
|
||||
image: big-bucket-test
|
||||
ports:
|
||||
- "8090:8080"
|
||||
environment:
|
||||
BIG_BUCKET_CLIENT_KUBOOBOO_RW: password
|
||||
BIG_BUCKET_UNITS: RAW,HOURLY,DAILY
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
DB_HOST: db-big-bucket
|
||||
DB_PORT: 5432
|
||||
DB_DATABASE: postgres
|
||||
DB_SCHEMA: public
|
||||
10
pom.xml
10
pom.xml
@ -47,6 +47,11 @@
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<version>7.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-httpclient-vertx</artifactId>
|
||||
<version>7.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-elytron-security</artifactId>
|
||||
@ -61,9 +66,8 @@
|
||||
<artifactId>quarkus-smallrye-jwt-build</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-httpclient-vertx</artifactId>
|
||||
<version>7.3.1</version>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-health</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
package dev.dinauer.inspect.cr.argocd;
|
||||
|
||||
public class ArgoCdApplicationResource
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package dev.dinauer.inspect.cr.cnpg.cluster;
|
||||
|
||||
import dev.dinauer.inspect.cr.cnpg.cluster.model.Cluster;
|
||||
import dev.dinauer.utils.ClientProvider;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Path("/resources/clusters.postgresql.cnpg.io")
|
||||
public class PostgresClusterResource
|
||||
{
|
||||
@Inject
|
||||
ClientProvider clientProvider;
|
||||
|
||||
@GET
|
||||
@Path("/{namespace}")
|
||||
public List<Cluster> get(@PathParam("namespace") String namespace)
|
||||
{
|
||||
if ("_all".equals(namespace))
|
||||
{
|
||||
return clientProvider.getClient().resources(Cluster.class).inAnyNamespace().list().getItems();
|
||||
}
|
||||
return findByNamespace(namespace);
|
||||
}
|
||||
|
||||
private List<Cluster> findByNamespace(String namespace)
|
||||
{
|
||||
List<Cluster> result = new LinkedList<>();
|
||||
for (Cluster cluster : clientProvider.getClient().resources(Cluster.class).inAnyNamespace().list().getItems())
|
||||
{
|
||||
if (cluster.getMetadata().getNamespace().equals(namespace))
|
||||
{
|
||||
result.add(cluster);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package dev.dinauer.inspect.cr.cnpg.cluster.model;
|
||||
|
||||
import io.fabric8.kubernetes.client.CustomResource;
|
||||
import io.fabric8.kubernetes.model.annotation.Group;
|
||||
import io.fabric8.kubernetes.model.annotation.Kind;
|
||||
import io.fabric8.kubernetes.model.annotation.Version;
|
||||
|
||||
@Group("postgresql.cnpg.io")
|
||||
@Kind("Cluster")
|
||||
@Version("v1")
|
||||
public class Cluster extends CustomResource<Spec, Status>
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package dev.dinauer.inspect.cr.cnpg.cluster.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record Spec(Integer instances)
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package dev.dinauer.inspect.cr.cnpg.cluster.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record Status(String phase)
|
||||
{
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user