API Object for AWS Load Balancer Controller, powered by the cdk8s project and aws-load-balancer-controller 🚀
import { Construct } from 'constructs';
import { App, Chart, ChartProps } from 'cdk8s';
import { AWSLoadBalancerControllerObject } from '@opencdk8s/cdk8s-aws-lb-controller-api-object'
export class MyChart extends Chart {
constructor(scope: Construct, id: string, props: ChartProps = { }) {
super(scope, id, props);
new AWSLoadBalancerControllerObject(this, 'example', {
metadata: {
annotations: {
'kubernetes.io/ingress.class': 'alb',
}
},
spec: {
rules: [{
host: "example.com",
http: {
paths: [{
path: '/*',
backend: {
serviceName: 'helloworld-svc',
servicePort: 80
}
}]
}
}]
}
})
}
}
const app = new App();
new MyChart(app, 'example1');
app.synth();Example cdk8s synth manifest as follows.
manifest.k8s.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: alb
name: example-c89c1904
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: helloworld-svc
servicePort: 80
path: /*
Use yarn or npm to install.
$ npm install @opencdk8s/cdk8s-aws-lb-controller-api-objects$ yarn add @opencdk8s/cdk8s-aws-lb-controller-api-objects$ pip install cdk8s-aws-lb-controller-api-objects-
Fork (link)
-
Bootstrap the repo:
yarn install # installs dependencies yarn projen -
Development scripts:
Command Description yarn compileCompiles typescript => javascript yarn watchWatch & compile yarn testRun unit test & linter through jest yarn test -uUpdate jest snapshots yarn run packageCreates a distwith packages for all languages.yarn buildCompile + test + package yarn bumpBump version (with changelog) based on [conventional commits] yarn releaseBump + push to master -
Create a feature branch
-
Commit your changes
-
Rebase your local changes against the master branch
-
Create a new Pull Request (use conventional commits for the title please)