Skip to content

Commit

Permalink
feat: kuma mesh name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter Thompson committed Dec 17, 2021
1 parent 2926d8d commit 1c2c68d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
13 changes: 13 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -31823,6 +31823,19 @@ Enable Kuma Service Mesh Dataplane injection.

---

##### `kumaMeshName`<sup>Optional</sup> <a name="cdk8s-redis-cluster.RedisOptions.property.kumaMeshName"></a>

```typescript
public readonly kumaMeshName: string;
```

- *Type:* `string`
- *Default:* undefined

The Kuma Mesh name.

---

##### `namespace`<sup>Optional</sup> <a name="cdk8s-redis-cluster.RedisOptions.property.namespace"></a>

```typescript
Expand Down
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ export interface RedisOptions {
* @default false
*/
readonly kumaMesh?: boolean;
/**
* The Kuma Mesh name
* @default undefined
*
*/
readonly kumaMeshName?: string;
}

export class Redis extends Construct {
Expand Down Expand Up @@ -276,9 +282,10 @@ export class Redis extends Construct {
podManagementPolicy: 'Parallel',
template: {
metadata: {
labels: opts?.kumaMesh ? {
labels: opts?.kumaMesh && opts?.kumaMeshName ? {
'kuma.io/sidecar-injection': 'enabled',
'app.kubernetes.io/name': name,
'kuma.io/mesh': opts?.kumaMeshName,
} : {
'app.kubernetes.io/name': name,
},
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/hello.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/hello.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test('with values', () => {
volumeIopsPerGb: '100',
redisImage: 'test-image',
redisPassword: 'test2',
kumaMeshName: 'test-mesh',
enableAof: 'no',
announceIps: [
'8.8.8.8',
Expand Down

0 comments on commit 1c2c68d

Please sign in to comment.