npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@grucloud/module-k8s-aws-load-balancer-controller

v13.2.5

Published

GruCloud module for the AWS Load Balancer Controller running on K8s

Downloads

133

Readme

GruCloud Module for the AWS Load Balancer Controller on Kubernetes

Integrate the Aws Load Balancer Controller with GruCloud.

How to use this module

See a simple example.

This module is also used to deploy a full starter kit

Dependecencies

This module depends on the cert-manager which install Custom Resource Definition, aka CRD

Update manifest version

Eventually edit the manifest version in the package.json at the field .scripts.download-manifest.

Download the manifest file locally

npm run download-manifest

Code Generation

The load balancer controler manifest is transformed into javascript code using the k8s-manifest2code tool:

npm run gen-code

This commands creates the resource.js file containing all the resources.

Post Edit: Cluster name

Modify the generated resource.js in 2 places:

  • Specify the cluster name for the LoadBalancerController Deployment
  • Add the AWS Load Balancer Role as a dependencies of LoadBalancerController ServiceAccount. This will link the k8s Serive Account to the Load Balancer AWS IAM Role.
git diff
diff --git a/packages/modules/k8s/aws-load-balancer/resources.js b/packages/modules/k8s/aws-load-balancer/resources.js
index d149bd7c..ae273988 100644
--- a/packages/modules/k8s/aws-load-balancer/resources.js
+++ b/packages/modules/k8s/aws-load-balancer/resources.js
@@ -558,6 +558,9 @@ exports.createResources = async ({ provider, resources }) => {
       }),
     }
   );
+  assert(provider.dependencies.aws.config.eks);
+  const clusterName = provider.dependencies.aws.config.eks.cluster.name;
+  assert(clusterName);

   const kubeSystemawsLoadBalancerControllerDeployment = provider.makeDeployment(
     {
@@ -591,7 +594,7 @@ exports.createResources = async ({ provider, resources }) => {
               containers: [
                 {
                   args: [
-                    "--cluster-name=your-cluster-name",
+                    `--cluster-name=${clusterName}`,
                     "--ingress-class=alb",
                   ],
                   image: "amazon/aws-alb-ingress-controller:v2.1.2",
diff --git a/packages/modules/k8s/aws-load-balancer/resources.js b/packages/modules/k8s/aws-load-balancer/resources.js
index ae273988..76cc1aa9 100644
--- a/packages/modules/k8s/aws-load-balancer/resources.js
+++ b/packages/modules/k8s/aws-load-balancer/resources.js
@@ -323,12 +323,17 @@ exports.createResources = async ({ provider, resources }) => {
     }
   );

+  assert(resources.lbc.roleLoadBalancer);
   const kubeSystemawsLoadBalancerControllerServiceAccount = provider.makeServiceAccount(
     {
       name: "kube-system-aws-load-balancer-controller",
-      properties: () => ({
+      dependencies: { role: resources.lbc.roleLoadBalancer },
+      properties: ({ dependencies: { role } }) => ({
         apiVersion: "v1",
         metadata: {
+          annotations: {
+            "eks.amazonaws.com/role-arn": role?.live?.Arn,
+          },
           labels: {
             "app.kubernetes.io/component": "controller",
             "app.kubernetes.io/name": "aws-load-balancer-controller",