Skip to content

Commit

Permalink
Add jsonnet definition for centos servers in aws.
Browse files Browse the repository at this point in the history
  • Loading branch information
adieu committed Aug 18, 2017
1 parent 4f9011f commit 1eb6e69
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
9 changes: 9 additions & 0 deletions archon.alpha.1/cloud/aws/centos/archon.libsonnet
Original file line number Diff line number Diff line change
@@ -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,
}

7 changes: 7 additions & 0 deletions archon.alpha.1/cloud/aws/centos/mixins.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
instanceGroup+:: {
config+:: {
image:: "ami-af4333cf",
}
}
}
45 changes: 45 additions & 0 deletions archon.alpha.1/cloud/aws/mixins.libsonnet
Original file line number Diff line number Diff line change
@@ -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",
},
},
}

0 comments on commit 1eb6e69

Please sign in to comment.