public static Deployment getDeployment()

in karavan-web/karavan-cli/src/main/java/org/apache/camel/karavan/cli/resources/Nexus.java [53:109]


    public static Deployment getDeployment (KaravanCommand config) {
        return new DeploymentBuilder()
                .withNewMetadata()
                .withName(NEXUS_NAME)
                .withNamespace(config.getNamespace())
                .endMetadata()

                .withNewSpec()
                .withNewSelector()
                .addToMatchLabels(Map.of("app", NEXUS_NAME))
                .endSelector()

                .withNewTemplate()
                .withNewMetadata()
                .addToLabels(Map.of("app", NEXUS_NAME))
                .endMetadata()

                .withNewSpec()
                    .addNewContainer()
                        .withName(NEXUS_NAME)
                        .withImage(NEXUS_IMAGE)
                        .withImagePullPolicy("Always")
                        .addNewPort()
                            .withContainerPort(NEXUS_PORT)
                            .withName("8081-tcp")
                        .endPort()
                        .withVolumeMounts(
                                new VolumeMountBuilder().withName(NEXUS_DATA).withMountPath("/" + NEXUS_DATA).build()
                        )
                    .withLivenessProbe(
                            new ProbeBuilder()
                                    .withHttpGet(new HTTPGetActionBuilder()
                                            .withPath("/service/rest/v1/status")
                                            .withPort(new IntOrString(NEXUS_PORT))
                                            .build())
                                    .withInitialDelaySeconds(90)
                                    .withPeriodSeconds(3)
                                    .build())
                    .withReadinessProbe(
                            new ProbeBuilder()
                                    .withHttpGet(new HTTPGetActionBuilder()
                                            .withPath("/service/rest/v1/status")
                                            .withPort(new IntOrString(NEXUS_PORT))
                                            .build())
                                    .withInitialDelaySeconds(90)
                                    .withPeriodSeconds(3)
                                    .build())
                    .endContainer()
                .withServiceAccount(Constants.NAME)
                .withVolumes(
                        new VolumeBuilder().withName(NEXUS_DATA).withEmptyDir(new EmptyDirVolumeSource()).build()
                )
                .endSpec()
                .endTemplate()
                .endSpec()
                .build();
    }