@grucloud/module-aws-load-balancer-controller
v8.0.0
Published
AWS resources to support the Load Balancer Controller running on Kubernetes
Downloads
138
Maintainers
Readme
The AWS Load Balancer Controller GruCLoud Module
The purpose of the module-aws-load-balancer-controller is to create the AWS resources require to run the AWS Load Balancer Controller.
Resources
- IamOpenIDConnectProvider: The Open ID Connect Provider, depends on EKS Cluster
- IamPolicy: The load balancer policy from load-balancer-policy.json
- IamRole: An IAM role attaching the load-balancer-policy, assuming role from the IamOpenIDConnectProvider
How to use this module
Install this module and its dependencies in your GruCloud project:
npm i @grucloud/module-aws-load-balancer-controller @grucloud/module-aws-vpc @grucloud/module-aws-eks @grucloud/provider-aws
In your iac.js, create a EKS Cluster module and pass the resource to ModuleAwsLoadBalancerController.createResources
// iac.js
const { AwsProvider } = require("@grucloud/provider-aws");
const ModuleAwsVpc = require("@grucloud/module-aws-vpc");
const ModuleAwsEks = require("@grucloud/module-aws-eks");
const ModuleAwsLoadBalancerController = require("@grucloud/module-aws-load-balancer-controller");
exports.createStack = async ({ createProvider }) => {
const provider = createProvider(AwsProvider, {
configs: [
ModuleAwsEks.config,
ModuleAwsVpc.config,
ModuleAwsLoadBalancerController.config,
],
});
const resourceVpc = await ModuleAwsVpc.createResources({ provider });
const resourceEks = await ModuleAwsEks.createResources({
provider,
resources: resourceVpc,
});
const resourceLbc = await ModuleAwsLoadBalancerController.createResources({
provider,
resources: resourceEks,
});
return {
provider,
resources: { vpb: resourceVpc, resourceEks, lbc: resourceLbc },
};
};
The role balancer role is now available to the Kubernetes Service Account resource