cdk8s-external-dns
v0.0.3
Published
cdk8s-external-dns is an CDK8S construct library that provides External Dns Configure.
Downloads
7
Readme
cdk8s-external-dns
cdk8s external dns constructs for cdk8s
Basic implementation of a external dns construct for cdk8s. Contributions are welcome!
Usage
CDK External Dns
import { App, Chart } from 'cdk8s';
import { Construct } from 'constructs';
import { AwsExternalDns, AwsZoneTypeOptions } from 'cdk8s-external-dns';
// default will deploy to default namespace.
export class MyChart extends Chart {
constructor(scope: Construct, name: string) {
super(scope, name);
new AwsExternalDns(this, 'cdk8sAwsExternalDns', {
domainFilter: 'exmaple.com',
awsZoneType: AwsZoneTypeOptions.PUBLIC,
});
}
}
const app = new App();
new MyChart(app, 'testcdk8s');
app.synth();
Featrue For Add IAM Policy.
- For IRSA add IAM Policy.
// CDK APP like eks_cluster.ts
import { AwsExternalDnsPolicyHelper } from 'cdk8s-external-dns';
import * as eks from '@aws-cdk/aws-eks';
const cluster = new eks.Cluster(this, 'MyK8SCluster', {
defaultCapacity: 0,
mastersRole: clusterAdmin,
version: eks.KubernetesVersion.V1_18,
});
const externalDnsServiceAccount = cluster.addServiceAccount('external-dns', {
name: 'external-dns',
});
// will help you add policy to IAM Role .
AwsExternalDnsPolicyHelper.addPolicy(externalDnsServiceAccount);
Also can see example repo
License
Distributed under the Apache 2.0 license.