Search in sources :

Example 1 with LocalObjectReference

use of io.fabric8.kubernetes.api.model.LocalObjectReference in project shinyproxy by openanalytics.

the class KubernetesBackend method doStartProxy.

@Override
protected void doStartProxy(KubernetesContainerProxy proxy) throws Exception {
    String kubeNamespace = getProperty(PROPERTY_NAMESPACE, proxy.getApp(), DEFAULT_NAMESPACE);
    String apiVersion = getProperty(PROPERTY_API_VERSION, proxy.getApp(), DEFAULT_API_VERSION);
    String[] volumeStrings = Optional.ofNullable(proxy.getApp().getDockerVolumes()).orElse(new String[] {});
    Volume[] volumes = new Volume[volumeStrings.length];
    VolumeMount[] volumeMounts = new VolumeMount[volumeStrings.length];
    for (int i = 0; i < volumeStrings.length; i++) {
        String[] volume = volumeStrings[i].split(":");
        String hostSource = volume[0];
        String containerDest = volume[1];
        String name = "shinyproxy-volume-" + i;
        volumes[i] = new VolumeBuilder().withNewHostPath(hostSource).withName(name).build();
        volumeMounts[i] = new VolumeMountBuilder().withMountPath(containerDest).withName(name).build();
    }
    List<EnvVar> envVars = new ArrayList<>();
    for (String envString : buildEnv(proxy.getUserId(), proxy.getApp())) {
        int idx = envString.indexOf('=');
        if (idx == -1)
            log.warn("Invalid environment variable: " + envString);
        envVars.add(new EnvVar(envString.substring(0, idx), envString.substring(idx + 1), null));
    }
    SecurityContext security = new SecurityContextBuilder().withPrivileged(Boolean.valueOf(getProperty(PROPERTY_PRIVILEGED, proxy.getApp(), DEFAULT_PRIVILEGED))).build();
    ContainerBuilder containerBuilder = new ContainerBuilder().withImage(proxy.getApp().getDockerImage()).withName("shiny-container").withPorts(new ContainerPortBuilder().withContainerPort(getAppPort(proxy)).build()).withVolumeMounts(volumeMounts).withSecurityContext(security).withEnv(envVars);
    String imagePullPolicy = getProperty(PROPERTY_IMG_PULL_POLICY, proxy.getApp(), null);
    if (imagePullPolicy != null)
        containerBuilder.withImagePullPolicy(imagePullPolicy);
    if (proxy.getApp().getDockerCmd() != null)
        containerBuilder.withCommand(proxy.getApp().getDockerCmd());
    String[] imagePullSecrets = getProperty(PROPERTY_IMG_PULL_SECRETS, proxy.getApp(), String[].class, null);
    if (imagePullSecrets == null) {
        String imagePullSecret = getProperty(PROPERTY_IMG_PULL_SECRET, proxy.getApp(), null);
        if (imagePullSecret != null) {
            imagePullSecrets = new String[] { imagePullSecret };
        } else {
            imagePullSecrets = new String[0];
        }
    }
    Pod pod = kubeClient.pods().inNamespace(kubeNamespace).createNew().withApiVersion(apiVersion).withKind("Pod").withNewMetadata().withName(proxy.getName()).addToLabels("app", proxy.getName()).endMetadata().withNewSpec().withContainers(Collections.singletonList(containerBuilder.build())).withVolumes(volumes).withImagePullSecrets(Arrays.asList(imagePullSecrets).stream().map(LocalObjectReference::new).collect(Collectors.toList())).endSpec().done();
    proxy.setPod(kubeClient.resource(pod).waitUntilReady(600, TimeUnit.SECONDS));
    if (!isUseInternalNetwork()) {
        // If SP runs outside the cluster, a NodePort service is needed to access the pod externally.
        Service service = kubeClient.services().inNamespace(kubeNamespace).createNew().withApiVersion(apiVersion).withKind("Service").withNewMetadata().withName(proxy.getName() + "service").endMetadata().withNewSpec().addToSelector("app", proxy.getName()).withType("NodePort").withPorts(new ServicePortBuilder().withPort(getAppPort(proxy)).build()).endSpec().done();
        // Retry, because if this is done too fast, an 'endpoint not found' exception will be thrown.
        Utils.retry(i -> {
            try {
                proxy.setService(kubeClient.resource(service).waitUntilReady(600, TimeUnit.SECONDS));
            } catch (Exception e) {
                return false;
            }
            return true;
        }, 5, 1000);
        releasePort(proxy.getPort());
        proxy.setPort(proxy.getService().getSpec().getPorts().get(0).getNodePort());
    }
}
Also used : Pod(io.fabric8.kubernetes.api.model.Pod) ArrayList(java.util.ArrayList) Service(io.fabric8.kubernetes.api.model.Service) VolumeBuilder(io.fabric8.kubernetes.api.model.VolumeBuilder) VolumeMountBuilder(io.fabric8.kubernetes.api.model.VolumeMountBuilder) IOException(java.io.IOException) ShinyProxyException(eu.openanalytics.shinyproxy.ShinyProxyException) SecurityContextBuilder(io.fabric8.kubernetes.api.model.SecurityContextBuilder) ContainerBuilder(io.fabric8.kubernetes.api.model.ContainerBuilder) Volume(io.fabric8.kubernetes.api.model.Volume) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) ContainerPortBuilder(io.fabric8.kubernetes.api.model.ContainerPortBuilder) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) SecurityContext(io.fabric8.kubernetes.api.model.SecurityContext) VolumeMount(io.fabric8.kubernetes.api.model.VolumeMount) EnvVar(io.fabric8.kubernetes.api.model.EnvVar)

Example 2 with LocalObjectReference

use of io.fabric8.kubernetes.api.model.LocalObjectReference in project fabric8 by fabric8io.

the class DevOpsConnector method execute.

/**
 * For a given project this operation will try to update the associated DevOps resources
 *
 * @throws Exception
 */
public void execute() throws Exception {
    loadConfigFile();
    KubernetesClient kubernetes = getKubernetes();
    String name = projectName;
    if (Strings.isNullOrBlank(name)) {
        if (projectConfig != null) {
            name = projectConfig.getBuildName();
        }
        if (Strings.isNullOrBlank(name)) {
            name = jenkinsJob;
        }
        if (Strings.isNullOrBlank(name)) {
            name = ProjectRepositories.createBuildName(username, repoName);
            if (projectConfig != null) {
                projectConfig.setBuildName(name);
            }
        }
    }
    if (Strings.isNullOrBlank(projectName)) {
        projectName = name;
    }
    Map<String, String> labels = new HashMap<>();
    labels.put("user", username);
    labels.put("repo", repoName);
    getLog().info("build name " + name);
    taiga = null;
    taigaProject = null;
    try {
        taiga = createTaiga();
        taigaProject = createTaigaProject(taiga);
    } catch (Exception e) {
        getLog().error("Failed to load or lazily create the Taiga project: " + e, e);
    }
    getLog().info("taiga " + taiga);
    LetsChatClient letschat = null;
    try {
        letschat = createLetsChat();
    } catch (Exception e) {
        getLog().error("Failed to load or lazily create the LetsChat client: " + e, e);
    }
    getLog().info("letschat " + letschat);
    /*
         * Create Gerrit Git to if isGerritReview is enabled
         */
    if (projectConfig != null && projectConfig.hasCodeReview()) {
        try {
            createGerritRepo(repoName, gerritUser, gerritPwd, gerritGitInitialCommit, gerritGitRepoDesription);
        } catch (Exception e) {
            getLog().error("Failed to create GerritGit repo : " + e, e);
        }
    }
    Map<String, String> annotations = new HashMap<>();
    jenkinsJobUrl = null;
    String jenkinsUrl = null;
    try {
        jenkinsUrl = getJenkinsServiceUrl(true);
        if (Strings.isNotBlank(jenkinsUrl)) {
            if (Strings.isNotBlank(jenkinsMonitorView)) {
                String url = URLUtils.pathJoin(jenkinsUrl, "/view", jenkinsMonitorView);
                annotationLink(annotations, "fabric8.link.jenkins.monitor/", url, "Monitor");
            }
            if (Strings.isNotBlank(jenkinsPipelineView)) {
                String url = URLUtils.pathJoin(jenkinsUrl, "/view", jenkinsPipelineView);
                annotationLink(annotations, "fabric8.link.jenkins.pipeline/", url, "Pipeline");
            }
            if (Strings.isNotBlank(name)) {
                jenkinsJobUrl = URLUtils.pathJoin(jenkinsUrl, "/job", name);
                annotationLink(annotations, "fabric8.link.jenkins.job/", jenkinsJobUrl, "Job");
            }
        }
    } catch (Exception e) {
        getLog().warn("Could not find the Jenkins URL!: " + e, e);
    }
    getLog().info("jenkins " + jenkinsUrl);
    if (!annotationLink(annotations, "fabric8.link.issues/", issueTrackerUrl, issueTrackerLabel)) {
        String taigaLink = getProjectPageLink(taiga, taigaProject, this.taigaProjectLinkPage);
        annotationLink(annotations, "fabric8.link.taiga/", taigaLink, taigaProjectLinkLabel);
    }
    if (!annotationLink(annotations, "fabric8.link.team/", teamUrl, teamLabel)) {
        String taigaTeamLink = getProjectPageLink(taiga, taigaProject, this.taigaTeamLinkPage);
        annotationLink(annotations, "fabric8.link.taiga.team/", taigaTeamLink, taigaTeamLinkLabel);
    }
    annotationLink(annotations, "fabric8.link.releases/", releasesUrl, releasesLabel);
    String chatRoomLink = getChatRoomLink(letschat);
    annotationLink(annotations, "fabric8.link.letschat.room/", chatRoomLink, letschatRoomLinkLabel);
    annotationLink(annotations, "fabric8.link.repository.browse/", repositoryBrowseLink, repositoryBrowseLabel);
    ProjectConfigs.defaultEnvironments(projectConfig, namespace);
    String consoleUrl = getServiceUrl(ServiceNames.FABRIC8_CONSOLE, namespace, fabric8ConsoleNamespace);
    if (projectConfig != null) {
        Map<String, String> environments = projectConfig.getEnvironments();
        updateEnvironmentConfigMap(environments, kubernetes, annotations, consoleUrl);
    }
    addLink("Git", getGitUrl());
    Controller controller = createController();
    OpenShiftClient openShiftClient = controller.getOpenShiftClientOrJenkinshift();
    BuildConfig buildConfig = null;
    if (openShiftClient != null) {
        try {
            buildConfig = openShiftClient.buildConfigs().withName(projectName).get();
        } catch (Exception e) {
            log.error("Failed to load build config for " + namespace + "/" + projectName + ". " + e, e);
        }
        log.info("Loaded build config for " + namespace + "/" + projectName + " " + buildConfig);
    }
    // if we have loaded a build config then lets assume its correct!
    boolean foundExistingGitUrl = false;
    if (buildConfig != null) {
        BuildConfigSpec spec = buildConfig.getSpec();
        if (spec != null) {
            BuildSource source = spec.getSource();
            if (source != null) {
                GitBuildSource git = source.getGit();
                if (git != null) {
                    gitUrl = git.getUri();
                    log.info("Loaded existing BuildConfig git url: " + gitUrl);
                    foundExistingGitUrl = true;
                }
                LocalObjectReference sourceSecret = source.getSourceSecret();
                if (sourceSecret != null) {
                    gitSourceSecretName = sourceSecret.getName();
                }
            }
        }
        if (!foundExistingGitUrl) {
            log.warn("Could not find a git url in the loaded BuildConfig: " + buildConfig);
        }
        log.info("Loaded gitSourceSecretName: " + gitSourceSecretName);
    }
    log.info("gitUrl is: " + gitUrl);
    if (buildConfig == null) {
        buildConfig = new BuildConfig();
    }
    ObjectMeta metadata = getOrCreateMetadata(buildConfig);
    metadata.setName(projectName);
    metadata.setLabels(labels);
    putAnnotations(metadata, annotations);
    Map<String, String> currentAnnotations = metadata.getAnnotations();
    if (!currentAnnotations.containsKey(Annotations.Builds.GIT_CLONE_URL)) {
        currentAnnotations.put(Annotations.Builds.GIT_CLONE_URL, gitUrl);
    }
    String localGitUrl = getLocalGitUrl();
    if (!currentAnnotations.containsKey(Annotations.Builds.LOCAL_GIT_CLONE_URL) && Strings.isNotBlank(localGitUrl)) {
        currentAnnotations.put(Annotations.Builds.LOCAL_GIT_CLONE_URL, localGitUrl);
    }
    // lets switch to the local git URL to avoid DNS issues in forge or jenkins
    if (Strings.isNotBlank(localGitUrl)) {
        gitUrl = localGitUrl;
    }
    Builds.configureDefaultBuildConfig(buildConfig, name, gitUrl, foundExistingGitUrl, buildImageStream, buildImageTag, s2iCustomBuilderImage, secret, jenkinsUrl);
    try {
        getLog().info("About to apply build config: " + new JSONObject(KubernetesHelper.toJson(buildConfig)).toString(4));
        controller.applyBuildConfig(buildConfig, "maven");
        getLog().info("Created build configuration for " + name + " in namespace: " + controller.getNamespace() + " at " + kubernetes.getMasterUrl());
    } catch (Exception e) {
        getLog().error("Failed to create BuildConfig for " + KubernetesHelper.toJson(buildConfig) + ". " + e, e);
    }
    this.jenkinsJobName = name;
    if (isRegisterWebHooks()) {
        registerWebHooks();
        getLog().info("webhooks done");
    }
    if (modifiedConfig) {
        if (basedir == null) {
            getLog().error("Could not save updated " + ProjectConfigs.FILE_NAME + " due to missing basedir");
        } else {
            try {
                ProjectConfigs.saveToFolder(basedir, projectConfig, true);
                getLog().info("Updated " + ProjectConfigs.FILE_NAME);
            } catch (IOException e) {
                getLog().error("Could not save updated " + ProjectConfigs.FILE_NAME + ": " + e, e);
            }
        }
    }
}
Also used : ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) HashMap(java.util.HashMap) IOException(java.io.IOException) Controller(io.fabric8.kubernetes.api.Controller) GitBuildSource(io.fabric8.openshift.api.model.GitBuildSource) SAXException(org.xml.sax.SAXException) WebApplicationException(javax.ws.rs.WebApplicationException) AuthenticationException(org.apache.http.auth.AuthenticationException) ConnectException(java.net.ConnectException) MalformedChallengeException(org.apache.http.auth.MalformedChallengeException) HttpResponseException(org.apache.http.client.HttpResponseException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) BuildSource(io.fabric8.openshift.api.model.BuildSource) GitBuildSource(io.fabric8.openshift.api.model.GitBuildSource) JSONObject(org.json.JSONObject) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) BuildConfig(io.fabric8.openshift.api.model.BuildConfig) LetsChatClient(io.fabric8.letschat.LetsChatClient) BuildConfigSpec(io.fabric8.openshift.api.model.BuildConfigSpec)

Example 3 with LocalObjectReference

use of io.fabric8.kubernetes.api.model.LocalObjectReference in project halyard by spinnaker.

the class KubernetesV1DistributedService method ensureRunning.

default void ensureRunning(AccountDeploymentDetails<KubernetesAccount> details, GenerateService.ResolvedConfiguration resolvedConfiguration, List<ConfigSource> configSources, boolean recreate) {
    ServiceSettings settings = resolvedConfiguration.getServiceSettings(getService());
    SpinnakerRuntimeSettings runtimeSettings = resolvedConfiguration.getRuntimeSettings();
    String namespace = getNamespace(settings);
    String serviceName = getServiceName();
    String replicaSetName = serviceName + "-v000";
    int port = settings.getPort();
    SpinnakerMonitoringDaemonService monitoringService = getMonitoringDaemonService();
    ServiceSettings monitoringSettings = runtimeSettings.getServiceSettings(monitoringService);
    KubernetesClient client = KubernetesV1ProviderUtils.getClient(details);
    KubernetesV1ProviderUtils.createNamespace(details, namespace);
    Map<String, String> serviceSelector = new HashMap<>();
    serviceSelector.put("load-balancer-" + serviceName, "true");
    Map<String, String> replicaSetSelector = new HashMap<>();
    replicaSetSelector.put("replication-controller", replicaSetName);
    Map<String, String> podLabels = new HashMap<>();
    podLabels.putAll(replicaSetSelector);
    podLabels.putAll(serviceSelector);
    Map<String, String> serviceLabels = new HashMap<>();
    serviceLabels.put("app", "spin");
    serviceLabels.put("stack", getCanonicalName());
    ServiceBuilder serviceBuilder = new ServiceBuilder();
    serviceBuilder = serviceBuilder.withNewMetadata().withName(serviceName).withNamespace(namespace).withLabels(serviceLabels).endMetadata().withNewSpec().withSelector(serviceSelector).withPorts(new ServicePortBuilder().withPort(port).withName("http").build(), new ServicePortBuilder().withPort(monitoringSettings.getPort()).withName("monitoring").build()).endSpec();
    boolean create = true;
    if (client.services().inNamespace(namespace).withName(serviceName).get() != null) {
        if (recreate) {
            client.services().inNamespace(namespace).withName(serviceName).delete();
        } else {
            create = false;
        }
    }
    if (create) {
        client.services().inNamespace(namespace).create(serviceBuilder.build());
    }
    List<Container> containers = new ArrayList<>();
    DeploymentEnvironment deploymentEnvironment = details.getDeploymentConfiguration().getDeploymentEnvironment();
    containers.add(ResourceBuilder.buildContainer(serviceName, settings, configSources, deploymentEnvironment));
    for (SidecarService sidecarService : getSidecars(runtimeSettings)) {
        String sidecarName = sidecarService.getService().getServiceName();
        ServiceSettings sidecarSettings = resolvedConfiguration.getServiceSettings(sidecarService.getService());
        containers.add(ResourceBuilder.buildContainer(sidecarName, sidecarSettings, configSources, deploymentEnvironment));
    }
    List<Volume> volumes = configSources.stream().map(c -> {
        return new VolumeBuilder().withName(c.getId()).withSecret(new SecretVolumeSourceBuilder().withSecretName(c.getId()).build()).build();
    }).collect(Collectors.toList());
    ReplicaSetBuilder replicaSetBuilder = new ReplicaSetBuilder();
    List<LocalObjectReference> imagePullSecrets = getImagePullSecrets(settings);
    Map componentSizing = deploymentEnvironment.getCustomSizing().get(serviceName);
    replicaSetBuilder = replicaSetBuilder.withNewMetadata().withName(replicaSetName).withNamespace(namespace).endMetadata().withNewSpec().withReplicas(retrieveKubernetesTargetSize(componentSizing)).withNewSelector().withMatchLabels(replicaSetSelector).endSelector().withNewTemplate().withNewMetadata().withAnnotations(settings.getKubernetes().getPodAnnotations()).withLabels(podLabels).endMetadata().withNewSpec().withContainers(containers).withTerminationGracePeriodSeconds(5L).withVolumes(volumes).withImagePullSecrets(imagePullSecrets).endSpec().endTemplate().endSpec();
    create = true;
    if (client.extensions().replicaSets().inNamespace(namespace).withName(replicaSetName).get() != null) {
        if (recreate) {
            client.extensions().replicaSets().inNamespace(namespace).withName(replicaSetName).delete();
            RunningServiceDetails runningServiceDetails = getRunningServiceDetails(details, runtimeSettings);
            while (runningServiceDetails.getLatestEnabledVersion() != null) {
                DaemonTaskHandler.safeSleep(TimeUnit.SECONDS.toMillis(5));
                runningServiceDetails = getRunningServiceDetails(details, runtimeSettings);
            }
        } else {
            create = false;
        }
    }
    if (create) {
        client.extensions().replicaSets().inNamespace(namespace).create(replicaSetBuilder.build());
    }
    RunningServiceDetails runningServiceDetails = getRunningServiceDetails(details, runtimeSettings);
    Integer version = runningServiceDetails.getLatestEnabledVersion();
    while (version == null || runningServiceDetails.getInstances().get(version).stream().anyMatch(i -> !(i.isHealthy() && i.isRunning()))) {
        DaemonTaskHandler.safeSleep(TimeUnit.SECONDS.toMillis(5));
        runningServiceDetails = getRunningServiceDetails(details, runtimeSettings);
        version = runningServiceDetails.getLatestEnabledVersion();
    }
}
Also used : KubernetesResourceDescription(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesResourceDescription) KubernetesUtil(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.KubernetesUtil) SpinnakerMonitoringDaemonService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerMonitoringDaemonService) KubernetesAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount) LogCollector(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.LogCollector) HalException(com.netflix.spinnaker.halyard.core.error.v1.HalException) DaemonTaskHandler(com.netflix.spinnaker.halyard.core.tasks.v1.DaemonTaskHandler) SidecarService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.SidecarService) Pair(org.apache.commons.lang3.tuple.Pair) Names(com.netflix.frigga.Names) Map(java.util.Map) ContainerStatus(io.fabric8.kubernetes.api.model.ContainerStatus) Provider(com.netflix.spinnaker.halyard.config.model.v1.node.Provider) TypeReference(com.fasterxml.jackson.core.type.TypeReference) SpinnakerService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService) ServiceBuilder(io.fabric8.kubernetes.api.model.ServiceBuilder) Strings(io.fabric8.utils.Strings) DeploymentEnvironment(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment) SecretVolumeSourceBuilder(io.fabric8.kubernetes.api.model.SecretVolumeSourceBuilder) ServiceInterfaceFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceInterfaceFactory) KubernetesVolumeMount(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesVolumeMount) Set(java.util.Set) KubernetesProbe(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesProbe) GenerateService(com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService) VolumeBuilder(io.fabric8.kubernetes.api.model.VolumeBuilder) Collectors(java.util.stream.Collectors) List(java.util.List) KubernetesVolumeSource(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesVolumeSource) SocketUtils(org.springframework.util.SocketUtils) Problem(com.netflix.spinnaker.halyard.core.problem.v1.Problem) KubernetesContainerDescription(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesContainerDescription) ServiceSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings) JobStatus(com.netflix.spinnaker.halyard.core.job.v1.JobStatus) Container(io.fabric8.kubernetes.api.model.Container) DeployKubernetesAtomicOperationDescription(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.DeployKubernetesAtomicOperationDescription) CustomSizing(com.netflix.spinnaker.halyard.config.model.v1.node.CustomSizing) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) HashMap(java.util.HashMap) ArtifactService(com.netflix.spinnaker.halyard.deploy.services.v1.ArtifactService) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) RunningServiceDetails(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) KubernetesHandler(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHandler) AccountDeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails) ReplicaSet(io.fabric8.kubernetes.api.model.extensions.ReplicaSet) JobExecutor(com.netflix.spinnaker.halyard.core.job.v1.JobExecutor) KubernetesImageDescription(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesImageDescription) KubernetesContainerPort(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesContainerPort) Instance(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails.Instance) KubernetesNamedServicePort(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.loadbalancer.KubernetesNamedServicePort) Volume(io.fabric8.kubernetes.api.model.Volume) ReplicaSetBuilder(io.fabric8.kubernetes.api.model.extensions.ReplicaSetBuilder) KubernetesLoadBalancerDescription(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.loadbalancer.KubernetesLoadBalancerDescription) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) KubernetesEnvVar(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesEnvVar) KubernetesSecretVolumeSource(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesSecretVolumeSource) JobRequest(com.netflix.spinnaker.halyard.core.job.v1.JobRequest) Pod(io.fabric8.kubernetes.api.model.Pod) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile) Paths(java.nio.file.Paths) KubernetesHttpGetAction(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHttpGetAction) KubernetesVolumeSourceType(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesVolumeSourceType) KubernetesTcpSocketAction(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesTcpSocketAction) DistributedService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.DistributedService) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) ConfigSource(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ConfigSource) Collections(java.util.Collections) KubernetesHandlerType(com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHandlerType) DeploymentEnvironment(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) VolumeBuilder(io.fabric8.kubernetes.api.model.VolumeBuilder) ServiceBuilder(io.fabric8.kubernetes.api.model.ServiceBuilder) Container(io.fabric8.kubernetes.api.model.Container) RunningServiceDetails(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails) ReplicaSetBuilder(io.fabric8.kubernetes.api.model.extensions.ReplicaSetBuilder) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) SecretVolumeSourceBuilder(io.fabric8.kubernetes.api.model.SecretVolumeSourceBuilder) SidecarService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.SidecarService) ServiceSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) Volume(io.fabric8.kubernetes.api.model.Volume) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) SpinnakerMonitoringDaemonService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerMonitoringDaemonService) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

LocalObjectReference (io.fabric8.kubernetes.api.model.LocalObjectReference)2 IOException (java.io.IOException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Names (com.netflix.frigga.Names)1 KubernetesUtil (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.KubernetesUtil)1 KubernetesLoadBalancerDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.loadbalancer.KubernetesLoadBalancerDescription)1 KubernetesNamedServicePort (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.loadbalancer.KubernetesNamedServicePort)1 DeployKubernetesAtomicOperationDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.DeployKubernetesAtomicOperationDescription)1 KubernetesContainerDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesContainerDescription)1 KubernetesContainerPort (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesContainerPort)1 KubernetesEnvVar (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesEnvVar)1 KubernetesHandler (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHandler)1 KubernetesHandlerType (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHandlerType)1 KubernetesHttpGetAction (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesHttpGetAction)1 KubernetesImageDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesImageDescription)1 KubernetesProbe (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesProbe)1 KubernetesResourceDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesResourceDescription)1 KubernetesSecretVolumeSource (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesSecretVolumeSource)1 KubernetesTcpSocketAction (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesTcpSocketAction)1