KubectlProviderOptions Struct
Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.
Example
import { KubectlV37Layer } from '@aws-cdk/lambda-layer-kubectl-v37';
const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_37,
kubectlProviderOptions: {
kubectlLayer: new KubectlV37Layer(this, 'kubectl'),
environment: {
'http_proxy': 'http://proxy.myproxy.com',
},
}
});
from aws_cdk.lambda_layer_kubectl_v37 import KubectlV37Layer
cluster = eks.Cluster(self, "hello-eks",
version=eks.KubernetesVersion.V1_37,
kubectl_provider_options=eks.KubectlProviderOptions(
kubectl_layer=KubectlV37Layer(self, "kubectl"),
environment={
"http_proxy": "http://proxy.myproxy.com"
}
)
)
import software.amazon.awscdk.cdk.lambdalayer.kubectl.v37.KubectlV37Layer;
Cluster cluster = Cluster.Builder.create(this, "hello-eks")
.version(KubernetesVersion.V1_37)
.kubectlProviderOptions(KubectlProviderOptions.builder()
.kubectlLayer(new KubectlV37Layer(this, "kubectl"))
.environment(Map.of(
"http_proxy", "http://proxy.myproxy.com"))
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.LambdaLayer.KubectlV37;
var cluster = new Cluster(this, "hello-eks", new ClusterProps {
Version = KubernetesVersion.V1_37,
KubectlProviderOptions = new KubectlProviderOptions {
KubectlLayer = new KubectlV37Layer(this, "kubectl"),
Environment = new Dictionary<string, string> {
{ "http_proxy", "http://proxy.myproxy.com" }
}
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/cdklabs/awscdk-kubectl-go/kubectlv37"
cluster := eks.NewCluster(this, jsii.String("hello-eks"), &ClusterProps{
Version: eks.KubernetesVersion_V1_37(),
KubectlProviderOptions: &KubectlProviderOptions{
KubectlLayer: kubectlv37.NewKubectlV37Layer(this, jsii.String("kubectl")),
Environment: map[string]*string{
"http_proxy": jsii.String("http://proxy.myproxy.com"),
},
},
})
Properties
awscliLayeroptionalILayerVersionawscli_layeroptionalILayerVersionawscliLayeroptionalILayerVersionAwscliLayeroptionalILayerVersionAwscliLayeroptionalILayerVersion#Default: If not defined, a default layer will be used containing the AWS CLI 2.x.
environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string#Default: No custom environment variables
kubectlLayerILayerVersionkubectl_layerILayerVersionkubectlLayerILayerVersionKubectlLayerILayerVersionKubectlLayerILayerVersionrequired#privateSubnetsoptionalISubnet[]private_subnetsoptionaltyping.List[ISubnet]privateSubnetsoptionalList<ISubnet>PrivateSubnetsoptionalISubnet[]PrivateSubnetsoptional*[]ISubnet#Default: the k8s is accessible publicly
If not specified, the k8s endpoint is expected to be accessible publicly.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#notes
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it
- A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
- The stack is deleted, so CloudFormation stops managing all resources in it
Default: if not specified, the default role created by a lambda function will be used.
The role should be mapped to the system:masters Kubernetes RBAC role.
This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.
securityGroupoptionalISecurityGroupsecurity_groupoptionalISecurityGroupsecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupdeprecated#Default: If not specified, the k8s endpoint is expected to be accessible publicly.
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#Default: If not specified, the k8s endpoint is expected to be accessible publicly.