diff --git a/archon.alpha.1/cloud/aws/centos/archon.libsonnet b/archon.alpha.1/cloud/aws/centos/archon.libsonnet new file mode 100644 index 00000000..7b07ba15 --- /dev/null +++ b/archon.alpha.1/cloud/aws/centos/archon.libsonnet @@ -0,0 +1,9 @@ +local archon = import "archon.alpha.1/a.libsonnet"; +local centos = import "archon.alpha.1/os/centos/mixins.libsonnet"; +local aws = import "archon.alpha.1/cloud/aws/mixins.libsonnet"; +local mixins = import "archon.alpha.1/cloud/aws/centos/mixins.libsonnet"; + +archon + { + v1:: archon.v1 + aws + centos + mixins, +} + diff --git a/archon.alpha.1/cloud/aws/centos/mixins.libsonnet b/archon.alpha.1/cloud/aws/centos/mixins.libsonnet new file mode 100644 index 00000000..8a79dd1b --- /dev/null +++ b/archon.alpha.1/cloud/aws/centos/mixins.libsonnet @@ -0,0 +1,7 @@ +{ + instanceGroup+:: { + config+:: { + image:: "ami-af4333cf", + } + } +} diff --git a/archon.alpha.1/cloud/aws/mixins.libsonnet b/archon.alpha.1/cloud/aws/mixins.libsonnet new file mode 100644 index 00000000..7a0587d3 --- /dev/null +++ b/archon.alpha.1/cloud/aws/mixins.libsonnet @@ -0,0 +1,45 @@ +{ + instanceGroup+:: { + new(name):: + local spec = self.mixin.spec.template.spec; + local metadata = self.mixin.spec.template.metadata; + local secretType = self.mixin.spec.template.spec.secretsType; + local initializers = self.config.initializers; + super.new(name) + + spec.instanceType(self.config.instanceType) + + spec.networkName(self.config.networkName) + + spec.image(self.config.image), + config+:: { + instanceType:: "t2.small", + }, + }, + master+:: { + new(name):: + local metadata = self.mixin.spec.template.metadata; + local instanceProfile = self.config.instanceProfile; + local annotations = { + "aws.archon.kubeup.com/instance-profile": instanceProfile, + }; + super.new(name) + + metadata.annotations(annotations), + }, + network+:: { + new(name):: + local nameServers = self.config.nameServers; + local domainName = self.config.region + ".compute.internal"; + local annotations = { + "aws.archon.kubeup.com/name-servers": nameServers, + "aws.archon.kubeup.com/domain-name": domainName, + }; + local labels = { + "KubernetesCluster": "kubernetes", + }; + super.new(name) + + self.mixin.metadata.annotations(annotations) + + self.mixin.metadata.labels(labels) + + self.mixin.status.phase("Pending"), + config+:: { + nameServers:: "169.254.169.253", + }, + }, +}