Skip to content

Commit

Permalink
Fully deployed; not 100% functional.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmanners committed Nov 27, 2023
1 parent 099add1 commit 249d0e1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion iac/cloud/pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ for (let k of config.compute.control_plane_nodes) {
config.amis,
vpc.privSubnets[k.subnet_name].id,
[sg_talos_configuration.id],
iam_role.iamInstanceProfile.arn,
iam_role.iamInstanceProfile.name,
null,
config.tags
);
Expand Down
6 changes: 6 additions & 0 deletions iac/cloud/pulumi/modules/bastion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ export function createBastion(
// Cloud-Init - SSH Load
userData: user_data,

// Instance Metadata
metadataOptions: {
httpPutResponseHopLimit: 4,
httpEndpoint: "enabled",
},

// Tags
tags: Object.assign({}, tags, {
Name: nodeConfig.name,
Expand Down
64 changes: 31 additions & 33 deletions iac/cloud/pulumi/modules/kube-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,42 @@ export function createInstance(
tags?: any
) {
// Create the talos Control Plane & associate the role
const kubeControlPlane = new aws.ec2.Instance(
`${nodeConfig.name}`,
{
ami: amis[region][`masters_${nodeConfig.arch}`],
instanceType: nodeConfig.instance_size,
const kubeControlPlane = new aws.ec2.Instance(`${nodeConfig.name}`, {
ami: amis[region][`masters_${nodeConfig.arch}`],
instanceType: nodeConfig.instance_size,

// Networking
subnetId: subnet,
sourceDestCheck: false,
privateIp: nodeConfig.privateIp,
vpcSecurityGroupIds: security_group_ids,
privateDnsNameOptions: {
enableResourceNameDnsARecord: true,
hostnameType: "resource-name",
},
// Networking
subnetId: subnet,
sourceDestCheck: false,
privateIp: nodeConfig.privateIp,
vpcSecurityGroupIds: security_group_ids,
privateDnsNameOptions: {
enableResourceNameDnsARecord: true,
hostnameType: "resource-name",
},

// Storage
rootBlockDevice: {
deleteOnTermination: true,
volumeType: nodeConfig.root_volume_type,
volumeSize: nodeConfig.root_volume_size,
},
// Storage
rootBlockDevice: {
deleteOnTermination: true,
volumeType: nodeConfig.root_volume_type,
volumeSize: nodeConfig.root_volume_size,
},

// IAM Instance Profile
iamInstanceProfile: iamInstanceProfile,
// Instance Metadata Options
metadataOptions: {
httpPutResponseHopLimit: 4,
},
// IAM Instance Profile
iamInstanceProfile: iamInstanceProfile,
// Instance Metadata Options
metadataOptions: {
httpPutResponseHopLimit: 4,
httpEndpoint: "enabled",
},

// Tags
tags: Object.assign({}, tags, { Name: nodeConfig.name }),
volumeTags: Object.assign({}, tags, { Name: nodeConfig.name }),
// Tags
tags: Object.assign({}, tags, { Name: nodeConfig.name }),
volumeTags: Object.assign({}, tags, { Name: nodeConfig.name }),

// Cloud-Init - SSH Load
userData: userDataEval(nodeConfig, user_data),
}
);
// Cloud-Init - SSH Load
userData: userDataEval(nodeConfig, user_data),
});

return {
privateIp: kubeControlPlane.privateIp,
Expand Down
7 changes: 4 additions & 3 deletions iac/cloud/pulumi/vars/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const network = {
// VPC Cidr Block Definition
vpc: {
name: "homelab-vpc",
cidr_block: "172.29.0.0/20",
cidr_block: "172.29.0.0/19",
},
// Subnet Definitions
subnets: {
Expand Down Expand Up @@ -101,13 +101,14 @@ export const compute: {
worker_nodes: [],
bastion: [
{
name: "kube-worker-2",
name: "bastion",
// name: "kube-worker-2",
instance_size: "t3.micro",
arch: "amd64",
subnet_name: "public1a",
root_volume_size: 40,
root_volume_type: "gp3",
privateIp: "172.29.8.101",
privateIp: "172.29.0.101",
},
],
};
Expand Down

0 comments on commit 249d0e1

Please sign in to comment.