Search in sources :

Example 21 with Profile

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.

the class ConsulClientService method getProfiles.

@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    List<Profile> result = new ArrayList<>();
    for (Map.Entry<Type, ServiceSettings> entry : endpoints.getAllServiceSettings().entrySet()) {
        ServiceSettings settings = entry.getValue();
        Type type = entry.getKey();
        if (!settings.getSidecar() && settings.getEnabled()) {
            String serviceName = type.getCanonicalName();
            String profileName = consulClientService(serviceName);
            String profilePath = Paths.get(CLIENT_OUTPUT_PATH, serviceName + ".json").toString();
            ProfileFactory factory = consulServiceProfileFactoryBuilder.build(type, settings);
            result.add(factory.getProfile(profileName, profilePath, deploymentConfiguration, endpoints));
        }
    }
    String profileName = clientProfileName;
    String profilePath = Paths.get(CLIENT_OUTPUT_PATH, profileName.split("/")[1]).toString();
    result.add(consulClientProfileFactory.getProfile(profileName, profilePath, deploymentConfiguration, endpoints));
    return result;
}
Also used : ProfileFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.ProfileFactory) ConsulClientProfileFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.consul.ConsulClientProfileFactory) Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)

Example 22 with Profile

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.

the class MetricRegistryProfileFactoryBuilder method build.

public ProfileFactory build(ServiceSettings settings) {
    return new ProfileFactory() {

        @Override
        protected ArtifactService getArtifactService() {
            return artifactService;
        }

        @Override
        protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
            URI uri;
            try {
                String baseUrl;
                if (settings.getBasicAuthEnabled() != null && settings.getBasicAuthEnabled()) {
                    baseUrl = settings.getAuthBaseUrl();
                } else {
                    baseUrl = settings.getBaseUrl();
                }
                uri = new URIBuilder(baseUrl).setHost("localhost").setPath("/spectator/metrics").build();
            } catch (URISyntaxException e) {
                throw new HalException(Problem.Severity.FATAL, "Unable to build service URL: " + e.getMessage());
            }
            profile.appendContents("metrics_url: " + uri.toString());
        }

        @Override
        protected Profile getBaseProfile(String name, String version, String outputFile) {
            return new Profile(name, version, outputFile, "");
        }

        @Override
        public SpinnakerArtifact getArtifact() {
            return SpinnakerArtifact.SPINNAKER_MONITORING_DAEMON;
        }

        @Override
        protected String commentPrefix() {
            return "## ";
        }
    };
}
Also used : HalException(com.netflix.spinnaker.halyard.core.error.v1.HalException) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration) URIBuilder(org.apache.http.client.utils.URIBuilder)

Example 23 with Profile

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.

the class SpinnakerMonitoringDaemonService method getSidecarProfiles.

@Override
public List<Profile> getSidecarProfiles(GenerateService.ResolvedConfiguration resolvedConfiguration, SpinnakerService service) {
    List<Profile> result = new ArrayList<>();
    Map<String, Profile> monitoringProfiles = resolvedConfiguration.getProfilesForService(getType());
    String profileName = serviceRegistryProfileName(service.getCanonicalName());
    Profile profile = monitoringProfiles.get(profileName);
    result.add(profile);
    profile = monitoringProfiles.get(monitoringProfileName());
    result.add(profile);
    return result;
}
Also used : Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)

Example 24 with Profile

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.

the class FiatService method getProfiles.

@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    List<Profile> profiles = super.getProfiles(deploymentConfiguration, endpoints);
    String filename = "fiat.yml";
    String path = Paths.get(getConfigOutputPath(), filename).toString();
    Profile profile = fiatProfileFactory.getProfile(filename, path, deploymentConfiguration, endpoints);
    profiles.add(profile);
    return profiles;
}
Also used : Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)

Example 25 with Profile

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.

the class GateService method getProfiles.

@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    List<Profile> profiles = super.getProfiles(deploymentConfiguration, endpoints);
    String filename = "gate.yml";
    String path = Paths.get(getConfigOutputPath(), filename).toString();
    GateProfileFactory gateProfileFactory = getGateProfileFactory(deploymentConfiguration.getName());
    Profile profile = gateProfileFactory.getProfile(filename, path, deploymentConfiguration, endpoints);
    profiles.add(profile);
    return profiles;
}
Also used : Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile) GateProfileFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.GateProfileFactory)

Aggregations

Profile (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)23 ArrayList (java.util.ArrayList)9 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)8 Map (java.util.Map)8 ServiceSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)6 HashMap (java.util.HashMap)6 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)5 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)5 Collections (java.util.Collections)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 ArtifactService (com.netflix.spinnaker.halyard.deploy.services.v1.ArtifactService)3 ConfigSource (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ConfigSource)3 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)3 File (java.io.File)3 Paths (java.nio.file.Paths)3 HashSet (java.util.HashSet)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 KubernetesUtil (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.KubernetesUtil)2 KubernetesImageDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesImageDescription)2