use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class ApacheSpinnakerProfileFactory method getBindings.
@Override
protected Map<String, Object> getBindings(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
TemplatedResource resource = new StringResource(SSL_TEMPLATE);
Map<String, Object> bindings = new HashMap<>();
UiSecurity uiSecurity = deploymentConfiguration.getSecurity().getUiSecurity();
ApacheSsl apacheSsl = uiSecurity.getSsl();
bindings.put("cert-file", apacheSsl.getSslCertificateFile());
bindings.put("key-file", apacheSsl.getSslCertificateKeyFile());
String ssl = resource.setBindings(bindings).toString();
bindings.clear();
bindings.put("ssl", ssl);
bindings.put("deck-host", endpoints.getServices().getDeck().getHost());
bindings.put("deck-port", endpoints.getServices().getDeck().getPort() + "");
return bindings;
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration 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 "## ";
}
};
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class RoscoProfileFactory method setProfile.
@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
super.setProfile(profile, deploymentConfiguration, endpoints);
Providers providers = deploymentConfiguration.getProviders();
Providers otherProviders = getImageProviders(profile.getVersion());
NodeIterator iterator = providers.getChildren();
Provider child = (Provider) iterator.getNext();
while (child != null) {
if (child instanceof HasImageProvider) {
NodeIterator otherIterator = otherProviders.getChildren();
NodeFilter providerFilter = new NodeFilter().setProvider(child.getNodeName());
HasImageProvider otherChild = (HasImageProvider) otherIterator.getNext(providerFilter);
if (otherChild == null) {
log.warn("images.yml has no images stored for " + child.getNodeName());
} else {
log.info("Adding default images for " + child.getNodeName());
((HasImageProvider) child).getBakeryDefaults().addDefaultImages(otherChild.getBakeryDefaults().getBaseImages());
}
}
child = (Provider) iterator.getNext();
}
List<String> files = backupRequiredFiles(providers, deploymentConfiguration.getName());
profile.appendContents(yamlToString(providers)).appendContents(profile.getBaseContents()).setRequiredFiles(files);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class ApachePassphraseProfileFactory method getBindings.
@Override
protected Map<String, Object> getBindings(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
Map<String, Object> bindings = new HashMap<>();
ApacheSsl ssl = deploymentConfiguration.getSecurity().getUiSecurity().getSsl();
bindings.put("passphrase", ssl.getSslCertificatePassphrase());
return bindings;
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class SpinnakerMonitoringDaemonProfileFactory method setProfile.
@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
SpinnakerRuntimeSettings.Services services = endpoints.getServices();
ServiceSettings monitoringService = services.getMonitoringDaemon();
MetricStores metricStores = deploymentConfiguration.getMetricStores();
List<String> enabledMetricStores = new ArrayList<>();
List<String> files = new ArrayList<>();
DatadogStore datadogStore = metricStores.getDatadog();
if (datadogStore.isEnabled()) {
enabledMetricStores.add("datadog");
}
PrometheusStore prometheusStore = metricStores.getPrometheus();
if (prometheusStore.isEnabled()) {
enabledMetricStores.add("prometheus");
}
StackdriverStore stackdriverStore = metricStores.getStackdriver();
if (stackdriverStore.isEnabled()) {
enabledMetricStores.add("stackdriver");
files.addAll(backupRequiredFiles(stackdriverStore, deploymentConfiguration.getName()));
}
profile.appendContents(yamlToString(metricStores));
Server server = new Server().setHost(monitoringService.getHost()).setPort(monitoringService.getPort());
ServerConfig serverConfig = new ServerConfig();
serverConfig.setServer(server);
profile.appendContents(yamlToString(serverConfig));
Monitor monitor = new Monitor().setPeriod(metricStores.getPeriod()).setMetricStore(enabledMetricStores);
MonitorConfig monitorConfig = new MonitorConfig();
monitorConfig.setMonitor(monitor);
profile.appendContents(yamlToString(monitorConfig));
profile.appendContents(profile.getBaseContents());
profile.setRequiredFiles(files);
}
Aggregations