Skip to content

Commit

Permalink
Kube QOL Improvements. (airbytehq#4968)
Browse files Browse the repository at this point in the history
* Use cluster ip when possible.

* Removed noisy logging.
  • Loading branch information
davinchia authored Jul 27, 2021
1 parent 344e326 commit 23dc777
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,21 +542,8 @@ private void close() {
Exceptions.swallow(this.stderrServerSocket::close);
Exceptions.swallow(this.executorService::shutdownNow);

var stdoutPortReleased = KubePortManagerSingleton.offer(stdoutLocalPort);
if (!stdoutPortReleased) {
LOGGER.warn(
"Error while releasing port {} from pod {}. This can cause the scheduler to run out of ports. Ignore this error if running Kubernetes on docker for desktop.",
stdoutLocalPort,
podDefinition.getMetadata().getName());
}

var stderrPortReleased = KubePortManagerSingleton.offer(stderrLocalPort);
if (!stderrPortReleased) {
LOGGER.warn(
"Error while releasing port {} from pod {}. This can cause the scheduler to run out of ports. Ignore this error if running Kubernetes on docker for desktop",
stderrLocalPort,
podDefinition.getMetadata().getName());
}
KubePortManagerSingleton.offer(stdoutLocalPort);
KubePortManagerSingleton.offer(stderrLocalPort);

LOGGER.debug("Closed {}", podDefinition.getMetadata().getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ public static Integer take() throws InterruptedException {
return workerPorts.poll(10, TimeUnit.MINUTES);
}

public static boolean offer(Integer port) {
public static void offer(Integer port) {
if (!workerPorts.contains(port)) {
workerPorts.add(port);
return true;
}
return false;
}

public static int getNumAvailablePorts() {
Expand Down
2 changes: 1 addition & 1 deletion kube/resources/db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
name: airbyte-db-svc
spec:
type: NodePort
type: ClusterIP
ports:
- port: 5432
protocol: TCP
Expand Down
2 changes: 1 addition & 1 deletion kube/resources/temporal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
name: airbyte-temporal-svc
spec:
type: NodePort
type: ClusterIP
ports:
- port: 7233
protocol: TCP
Expand Down

0 comments on commit 23dc777

Please sign in to comment.