Skip to content

Commit

Permalink
add helm wait comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomourar committed Jun 23, 2020
1 parent 438e3d5 commit a609ab9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class ClusterResourceProvider extends NestedStack {
isCompleteHandler: isComplete,
totalTimeout: Duration.hours(1),
queryInterval: Duration.minutes(1),
isValueEncoded: true,
});

this.roles = [ onEvent.role!, isComplete.role! ];
Expand Down
20 changes: 19 additions & 1 deletion packages/@aws-cdk/aws-eks/lib/cluster-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ import { CLUSTER_RESOURCE_TYPE } from './cluster-resource-handler/consts';
import { ClusterResourceProvider } from './cluster-resource-provider';
import { CfnClusterProps } from './eks.generated';
import { ControlPlaneLogging } from './logging';
import { encodeValues } from './utils';

/**
* Encodes values (specially boolean) as special strings
*
* Because CloudFormation converts every input as string for custom resources,
* we will use these encoded values to cast them into proper types.
*/
function encodeValues(object: object) {
return JSON.parse(JSON.stringify(object), (_k, v) => {
switch (v) {
case true:
return 'TRUE:BOOLEAN';
case false:
return 'FALSE:BOOLEAN';
default:
return v;
}
});
}

/**
* The available cluster control plane log types.
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-eks/lib/helm-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export class HelmChart extends Construct {
Release: props.release ?? this.node.uniqueId.slice(-53).toLowerCase(), // Helm has a 53 character limit for the name
Chart: props.chart,
Version: props.version,
// We will only pass down to the custom resource an explicit value
// if wait is set to true. Falsy values will not because
// that is the default behavior.
Wait: props.wait || undefined,
Timeout: timeout,
Values: (props.values ? stack.toJsonString(props.values) : undefined),
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-eks/lib/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface ControlPlaneLogging {
* Kubernetes API server component logs – Your cluster's API server is the
* control plane component that exposes the Kubernetes API.
*
* @default false
* @see https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
*/
readonly api?: boolean;
Expand All @@ -14,6 +15,7 @@ export interface ControlPlaneLogging {
* Audit (audit) – Kubernetes audit logs provide a record of the individual
* users, administrators, or system components that have affected your cluster.
*
* @default false
* @see https://kubernetes.io/docs/tasks/debug-application-cluster/audit/
*/
readonly audit?: boolean;
Expand All @@ -23,6 +25,7 @@ export interface ControlPlaneLogging {
* represent the control plane component that Amazon EKS uses for Kubernetes
* Role Based Access Control (RBAC) authentication using IAM credentials.
*
* @default false
* @see https://kubernetes.io/docs/admin/authorization/rbac/
*/
readonly authenticator?: boolean;
Expand All @@ -31,6 +34,7 @@ export interface ControlPlaneLogging {
* Controller manager – The controller manager manages the core control
* loops that are shipped with Kubernetes.
*
* @default false
* @see https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
*/
readonly controllerManager?: boolean;
Expand All @@ -39,6 +43,7 @@ export interface ControlPlaneLogging {
* Scheduler – The scheduler component manages when and where to run
* pods in your cluster.
*
* @default false
* @see https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/
*/
readonly scheduler?: boolean;
Expand Down
18 changes: 0 additions & 18 deletions packages/@aws-cdk/aws-eks/lib/utils.ts

This file was deleted.

0 comments on commit a609ab9

Please sign in to comment.