Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Optional<V1DeploymentSpec> getDeploymentSpec(String serviceLabel, Kuberne
try
{
String labelSelector = String.format("%s=%s", serviceLabel, service);
log.debug("Filtering deployment {} using selector {}", resource, labelSelector);
log.debug("Filtering resource {} using selector {}", resource, labelSelector);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could keep it as Filtering deployment for consistency with other logs and because we actually filtering data from deployments....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see but it's logging like this Filtering deployment DEPLOYMENT using selector. Actually argument KubernetesResources resource is representing the resource type which in this function is Deployment.
There are another resource type defined : https://github.com/freenowtech/sauron/blob/main/plugins/kubernetesapi-report/src/main/java/com/freenow/sauron/plugins/utils/KubernetesResources.java#L5

var deployments = createAppsV1Api(client).listNamespacedDeployment(
K8S_DEFAULT_NAMESPACE,
K8S_PRETTY_OUTPUT,
Expand Down Expand Up @@ -65,9 +65,10 @@ public Optional<V1DeploymentSpec> getDeploymentSpec(String serviceLabel, Kuberne
}
catch (ApiException ex)
{
log.error(ex.getMessage(), ex);
log.error("getDeploymentSpec failed '{}'", ex.getMessage(), ex);
}

log.warn("No deployment returned for service '{}'", service);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider this log as DEBUG instead? Also, maybe add the labelSelector?

return Optional.empty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public final class KubernetesConstants
{
public static final String K8S_DEFAULT_NAMESPACE = "default";

public static final int K8S_API_TIMEOUT_SECONDS = 5;
public static final int K8S_API_TIMEOUT_SECONDS = 30;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure if you noticed, but the timeout is only happening in the mgmt. Are we sure that the K8s API is accessible there?


public static final String K8S_PRETTY_OUTPUT = Boolean.FALSE.toString();
}