Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -44,6 +44,10 @@ spec:
- name: "MOCK_WLS"
value: "true"
{{- end }}
resources:
requests:
cpu: "100m"
memory: "512Mi"
volumeMounts:
- name: "weblogic-operator-cm-volume"
mountPath: "/operator/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;

import io.kubernetes.client.custom.Quantity;
import io.kubernetes.client.models.ExtensionsV1beta1Deployment;
import io.kubernetes.client.models.V1ClusterRole;
import io.kubernetes.client.models.V1ClusterRoleBinding;
import io.kubernetes.client.models.V1ConfigMap;
import io.kubernetes.client.models.V1Namespace;
import io.kubernetes.client.models.V1ResourceRequirements;
import io.kubernetes.client.models.V1Role;
import io.kubernetes.client.models.V1RoleBinding;
import io.kubernetes.client.models.V1Secret;
Expand Down Expand Up @@ -210,6 +212,11 @@ protected ExtensionsV1beta1Deployment getExpectedWeblogicOperatorDeployment() {
newEnvVar()
.name("JAVA_LOGGING_LEVEL")
.value(getInputs().getJavaLoggingLevel()))
.resources(
new V1ResourceRequirements()
.putRequestsItem("cpu", Quantity.fromString("100m"))
.putRequestsItem(
"memory", Quantity.fromString("512Mi")))
.addVolumeMountsItem(
newVolumeMount()
.name("weblogic-operator-cm-volume")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ private ApiClient getApiClient() {
return client;
}

@Override
protected ApiClient onRecycle(ApiClient instance) {
// Work around async processing creating, but not cleaning-up network interceptors
instance.getHttpClient().networkInterceptors().clear();
return super.onRecycle(instance);
}

private static class DefaultClientFactory implements ClientFactory {
private final AtomicBoolean first = new AtomicBoolean(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ protected Queue<T> getQueue() {
* @param instance Pool object to recycle
*/
public final void recycle(T instance) {
getQueue().offer(instance);
getQueue().offer(onRecycle(instance));
if (LOGGER.isFinerEnabled()) {
LOGGER.finer("Recycling instance to pool, instances now in pool: " + getQueue().size());
}
}

protected T onRecycle(T instance) {
return instance;
}

/**
* Creates a new instance of object. This method is used when someone wants to {@link #take()
* take} an object from an empty pool. Also note that multiple threads may call this method
Expand Down
5 changes: 4 additions & 1 deletion src/scripts/operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ cp /operator/logstash.conf /logs/logstash.conf
# assumption is that we have mounted a volume on /logs which is also visible to
# the logstash container/pod.

# Container memory optimizaton flags
HEAP="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XshowSettings:vm"

# Start operator
java $MOCKING_WLS $DEBUG $LOGGING -jar /operator/weblogic-kubernetes-operator.jar &
java $HEAP $MOCKING_WLS $DEBUG $LOGGING -jar /operator/weblogic-kubernetes-operator.jar &
PID=$!
wait $PID