interface KubernetesResourceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EKS.Legacy.KubernetesResourceProps |
Java | software.amazon.awscdk.services.eks.legacy.KubernetesResourceProps |
Python | aws_cdk.aws_eks_legacy.KubernetesResourceProps |
TypeScript (source) | @aws-cdk/aws-eks-legacy » KubernetesResourceProps |
⚠️ Deprecated: undefined
Example
const appLabel = { app: "hello-kubernetes" };
const deployment = {
apiVersion: "apps/v1",
kind: "Deployment",
metadata: { name: "hello-kubernetes" },
spec: {
replicas: 3,
selector: { matchLabels: appLabel },
template: {
metadata: { labels: appLabel },
spec: {
containers: [
{
name: "hello-kubernetes",
image: "paulbouwer/hello-kubernetes:1.5",
ports: [ { containerPort: 8080 } ],
},
],
},
},
},
};
const service = {
apiVersion: "v1",
kind: "Service",
metadata: { name: "hello-kubernetes" },
spec: {
type: "LoadBalancer",
ports: [ { port: 80, targetPort: 8080 } ],
selector: appLabel,
},
};
declare const cluster: eks.Cluster;
// option 1: use a construct
new eks.KubernetesResource(this, 'hello-kub', {
cluster,
manifest: [ deployment, service ],
});
// or, option2: use `addResource`
cluster.addResource('hello-kub', service, deployment);
Properties
Name | Type | Description |
---|---|---|
cluster | Cluster | The EKS cluster to apply this configuration to. |
manifest | any[] | The resource manifest. |
cluster
⚠️ Deprecated: undefined
Type:
Cluster
The EKS cluster to apply this configuration to.
[disable-awslint:ref-via-interface]
manifest
⚠️ Deprecated: undefined
Type:
any[]
The resource manifest.
Consists of any number of child resources.
When the resource is created/updated, this manifest will be applied to the
cluster through kubectl apply
and when the resource or the stack is
deleted, the manifest will be deleted through kubectl delete
.
const manifest = {
apiVersion: 'v1',
kind: 'Pod',
metadata: { name: 'mypod' },
spec: {
containers: [ { name: 'hello', image: 'paulbouwer/hello-kubernetes:1.5', ports: [ { containerPort: 8080 } ] } ]
}
}