use of org.platformlayer.ops.networks.PublicEndpoint in project platformlayer by platformlayer.
the class UserAuthServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
String dnsName = model.dnsName;
InstanceBuilder vm;
{
vm = InstanceBuilder.build(dnsName, this, model.getTags());
// vm.publicPorts.add(port);
vm.hostPolicy.configureCluster(template.getPlacementKey());
// TODO: This needs to be configurable (?)
vm.minimumMemoryMb = 2048;
addChild(vm);
}
{
UserAuthInstall install = vm.addChild(UserAuthInstall.class);
}
{
UserAuthInstance service = vm.addChild(UserAuthInstance.class);
}
{
PublicEndpoint endpoint = vm.addChild(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = BACKEND_PORT;
endpoint.backendPort = BACKEND_PORT;
// endpoint.dnsName = dnsName;
endpoint.transport = Transport.Ipv6;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
}
loadBalancing.addHttpSite(this, model, model.dnsName, template.getSslKeyPath(), SslMode.Terminate);
}
use of org.platformlayer.ops.networks.PublicEndpoint in project platformlayer by platformlayer.
the class PlatformLayerServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
int port = PORT;
String dnsName = model.dnsName;
InstanceBuilder vm;
{
vm = InstanceBuilder.build(dnsName, this, model.getTags());
vm.publicPorts.add(port);
vm.hostPolicy.configureCluster(template.getPlacementKey());
// TODO: This needs to be configurable (?)
vm.minimumMemoryMb = 2048;
addChild(vm);
}
{
PlatformLayerInstall install = injected(PlatformLayerInstall.class);
vm.addChild(install);
}
{
PlatformLayerInstance service = injected(PlatformLayerInstance.class);
vm.addChild(service);
}
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = port;
endpoint.backendPort = port;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
if (model.transport != null) {
endpoint.transport = EnumUtils.valueOfCaseInsensitive(Transport.class, model.transport);
} else {
endpoint.transport = Transport.Ipv6;
}
vm.addChild(endpoint);
}
if (model.dnsName != null) {
loadBalancing.addHttpSite(this, model, model.dnsName, template.getSslKeyPath(), SslMode.Terminate);
}
}
use of org.platformlayer.ops.networks.PublicEndpoint in project platformlayer by platformlayer.
the class AptCacheServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
AptCacheService model = OpsContext.get().getInstance(AptCacheService.class);
// TODO: Create endpoint with default port; maybe default to closed?
// model.dnsName
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
instance.hostPolicy.allowRunInContainer = true;
addChild(instance);
instance.addChild(PackageDependency.build("squid3"));
instance.addChild(SimpleFile.build(getClass(), new File("/etc/squid3/squid.conf")));
instance.addChild(ManagedService.build("squid3"));
// instance.addChild(CollectdCollector.build());
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
endpoint.publicPort = PORT;
endpoint.backendPort = PORT;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
instance.addChild(endpoint);
}
}
use of org.platformlayer.ops.networks.PublicEndpoint in project platformlayer by platformlayer.
the class GitServerController method addChildren.
@Override
protected void addChildren() throws OpsException {
GitService model = OpsContext.get().getInstance(GitService.class);
InstanceBuilder vm = InstanceBuilder.build(model.dnsName, this, model.getTags());
addChild(vm);
vm.addChild(PackageDependency.build("apache2"));
// Provides /usr/lib/git-core/git-http-backend
vm.addChild(PackageDependency.build("git"));
vm.addChild(ManagedDirectory.build(new File("/var/git"), "0755"));
vm.addChild(ApacheModule.build("authnz_ldap"));
vm.addChild(ApacheModule.build("ldap"));
File apache2ConfDir = new File("/etc/apache2");
vm.addChild(TemplatedFile.build(this, new File(apache2ConfDir, "conf.d/git")));
vm.addChild(ManagedService.build("apache2"));
vm.addChild(MetricsInstance.class);
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = PORT;
endpoint.backendPort = PORT;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
vm.addChild(endpoint);
}
}
use of org.platformlayer.ops.networks.PublicEndpoint in project platformlayer by platformlayer.
the class GerritServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
// GerritInstanceModel template = injected(GerritInstanceModel.class);
// GerritService model = template.getModel();
String dnsName = model.dnsName;
List<Integer> ports = getPorts();
InstanceBuilder vm;
{
vm = InstanceBuilder.build(dnsName, this, model.getTags());
vm.publicPorts.addAll(ports);
vm.hostPolicy.configureCluster(template.getPlacementKey());
// TODO: This needs to be configurable (?)
vm.minimumMemoryMb = 2048;
addChild(vm);
}
{
GerritInstall install = vm.addChild(GerritInstall.class);
}
// Bootstrap depends on configuration file
vm.addChild(ManagedDirectory.build(template.getDataDir(), "700").setOwner(template.getUser()).setGroup(template.getGroup()));
vm.addChild(ManagedDirectory.build(new File(template.getDataDir(), "etc"), "700").setOwner(template.getUser()).setGroup(template.getGroup()));
vm.addChild(GerritConfigurationFile.class);
vm.addChild(GerritBootstrap.class);
vm.addChild(GerritInstance.class);
for (int port : ports) {
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = port;
endpoint.backendPort = port;
endpoint.dnsName = dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
vm.addChild(endpoint);
}
vm.addChild(MetricsInstance.class);
}
Aggregations