Skip to content

Commit

Permalink
Merge pull request #831 from aws-quickstart/task/fix-extensibility-co…
Browse files Browse the repository at this point in the history
…de-snippets

fixed code snippets to create helm and non-helm addons
  • Loading branch information
shapirov103 authored Aug 28, 2023
2 parents d03b06d + bf6d804 commit b73c74d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,15 @@ Deployment of arbitrary kubernetes manifests can leverage the following construc

```typescript
import { KubernetesManifest } from "aws-cdk-lib/aws-eks";
import { ClusterAddOn, ClusterInfo } from "../../spi";
import { loadYaml, readYamlDocument } from "../../utils/yaml-utils";
import * as blueprints from "@aws-quickstart/eks-blueprints";

export class MyNonHelmAddOn implements ClusterAddOn {
deploy(clusterInfo: ClusterInfo): void {
export class MyNonHelmAddOn implements blueprints.ClusterAddOn {
deploy(clusterInfo: blueprints.ClusterInfo): void {
const cluster = clusterInfo.cluster;
// Apply manifest
const doc = readYamlDocument(__dirname + '/my-product.yaml');
const doc = blueprints.utils.readYamlDocument(__dirname + '/my-product.yaml');
// ... apply any substitutions for dynamic values
const manifest = docArray.split("---").map(e => loadYaml(e));
const manifest = doc.split("---").map(e => blueprints.utils.loadYaml(e));
new KubernetesManifest(cluster.stack, "myproduct-manifest", {
cluster,
manifest,
Expand All @@ -92,17 +91,15 @@ Example:

```typescript
import { Construct } from "constructs";
import { ClusterInfo } from "../../spi";
import { dependable } from "../../utils";
import { HelmAddOn, HelmAddOnUserProps } from "../helm-addon";
import * as blueprints from "@aws-quickstart/eks-blueprints";

export class MyProductAddOn extends HelmAddOn {
export class MyProductAddOn extends blueprints.HelmAddOn {

readonly options: MyProductAddOnProps; // extends HelmAddOnUserProps

...

@dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController
@@blueprints.utils.dependable('AwsLoadBalancerControllerAddOn') // depends on AwsLoadBalancerController
deploy(clusterInfo: ClusterInfo): Promise<Construct> {
...
}
Expand Down

0 comments on commit b73c74d

Please sign in to comment.