@Override protected List<Container> getContainers() { List<Container> containers = new ArrayList<>(); if (topicOperator != null) { containers.addAll(topicOperator.getContainers()); } if (userOperator != null) { containers.addAll(userOperator.getContainers()); } String tlsSidecarImage = EntityOperatorSpec.DEFAULT_TLS_SIDECAR_IMAGE; if (tlsSidecar != null && tlsSidecar.getImage() != null) { tlsSidecarImage = tlsSidecar.getImage(); } Container tlsSidecarContainer = new ContainerBuilder() .withName(TLS_SIDECAR_NAME) .withImage(tlsSidecarImage) .withLivenessProbe(ModelUtils.tlsSidecarLivenessProbe(tlsSidecar)) .withReadinessProbe(ModelUtils.tlsSidecarReadinessProbe(tlsSidecar)) .withResources(ModelUtils.tlsSidecarResources(tlsSidecar)) .withEnv(asList(ModelUtils.tlsSidecarLogEnvVar(tlsSidecar), buildEnvVar(ENV_VAR_ZOOKEEPER_CONNECT, zookeeperConnect))) .withVolumeMounts(createVolumeMount(TLS_SIDECAR_EO_CERTS_VOLUME_NAME, TLS_SIDECAR_EO_CERTS_VOLUME_MOUNT), createVolumeMount(TLS_SIDECAR_CA_CERTS_VOLUME_NAME, TLS_SIDECAR_CA_CERTS_VOLUME_MOUNT)) .withLifecycle(new LifecycleBuilder().withNewPreStop().withNewExec().withCommand("/opt/stunnel/stunnel_pre_stop.sh", String.valueOf(templateTerminationGracePeriodSeconds)).endExec().endPreStop().build()) .build(); containers.add(tlsSidecarContainer); return containers; }
createContainerPort(LEADER_ELECTION_PORT_NAME, LEADER_ELECTION_PORT, "TCP"), createContainerPort(CLIENT_PORT_NAME, CLIENT_PORT, "TCP"))) .withLifecycle(new LifecycleBuilder().withNewPreStop().withNewExec().withCommand("/opt/stunnel/stunnel_pre_stop.sh", String.valueOf(templateTerminationGracePeriodSeconds)).endExec().endPreStop().build()) .build();
.withVolumeMounts(createVolumeMount(BROKER_CERTS_VOLUME, TLS_SIDECAR_KAFKA_CERTS_VOLUME_MOUNT), createVolumeMount(CLUSTER_CA_CERTS_VOLUME, TLS_SIDECAR_CLUSTER_CA_CERTS_VOLUME_MOUNT)) .withLifecycle(new LifecycleBuilder().withNewPreStop().withNewExec().withCommand("/opt/stunnel/stunnel_pre_stop.sh", String.valueOf(templateTerminationGracePeriodSeconds)).endExec().endPreStop().build()) .build();
public ContainerBuilder( Container instance ){ this.fluent = this; this.withArgs(instance.getArgs()); this.withCommand(instance.getCommand()); this.withEnv(instance.getEnv()); this.withImage(instance.getImage()); this.withImagePullPolicy(instance.getImagePullPolicy()); this.withLifecycle(instance.getLifecycle()); this.withLivenessProbe(instance.getLivenessProbe()); this.withName(instance.getName()); this.withPorts(instance.getPorts()); this.withReadinessProbe(instance.getReadinessProbe()); this.withResources(instance.getResources()); this.withSecurityContext(instance.getSecurityContext()); this.withTerminationMessagePath(instance.getTerminationMessagePath()); this.withVolumeMounts(instance.getVolumeMounts()); this.withWorkingDir(instance.getWorkingDir()); }
public ContainerBuilder( Container instance ){ this.fluent = this; this.withArgs(instance.getArgs()); this.withCapabilities(instance.getCapabilities()); this.withCommand(instance.getCommand()); this.withEnv(instance.getEnv()); this.withImage(instance.getImage()); this.withImagePullPolicy(instance.getImagePullPolicy()); this.withLifecycle(instance.getLifecycle()); this.withLivenessProbe(instance.getLivenessProbe()); this.withName(instance.getName()); this.withPorts(instance.getPorts()); this.withPrivileged(instance.getPrivileged()); this.withReadinessProbe(instance.getReadinessProbe()); this.withResources(instance.getResources()); this.withSecurityContext(instance.getSecurityContext()); this.withTerminationMessagePath(instance.getTerminationMessagePath()); this.withVolumeMounts(instance.getVolumeMounts()); this.withWorkingDir(instance.getWorkingDir()); }
public ContainerBuilder(Container instance,Boolean validationEnabled){ this.fluent = this; this.withArgs(instance.getArgs()); this.withCommand(instance.getCommand()); this.withEnv(instance.getEnv()); this.withImage(instance.getImage()); this.withImagePullPolicy(instance.getImagePullPolicy()); this.withLifecycle(instance.getLifecycle()); this.withLivenessProbe(instance.getLivenessProbe()); this.withName(instance.getName()); this.withPorts(instance.getPorts()); this.withReadinessProbe(instance.getReadinessProbe()); this.withResources(instance.getResources()); this.withSecurityContext(instance.getSecurityContext()); this.withStdin(instance.getStdin()); this.withStdinOnce(instance.getStdinOnce()); this.withTerminationMessagePath(instance.getTerminationMessagePath()); this.withTty(instance.getTty()); this.withVolumeMounts(instance.getVolumeMounts()); this.withWorkingDir(instance.getWorkingDir()); this.validationEnabled = validationEnabled; }