Docs: update and polish "Kubernetes on AWS" example
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
41
examples/kubernetes-aws/infrastructure.cue
Normal file
41
examples/kubernetes-aws/infrastructure.cue
Normal file
@@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/cloudformation"
|
||||
)
|
||||
|
||||
#Infrastructure: {
|
||||
awsConfig: aws.#Config
|
||||
namePrefix: *"" | string
|
||||
workerNodeCapacity: *3 | >=1
|
||||
workerNodeInstanceType: *"t3.medium" | string
|
||||
|
||||
clusterName: "\(namePrefix)eks-cluster"
|
||||
|
||||
eksControlPlane: cloudformation.#Stack & {
|
||||
config: awsConfig
|
||||
source: json.Marshal(#CFNTemplate.eksControlPlane)
|
||||
stackName: "\(namePrefix)eks-controlplane"
|
||||
neverUpdate: true
|
||||
timeout: 30
|
||||
parameters: ClusterName: clusterName
|
||||
}
|
||||
|
||||
eksNodeGroup: cloudformation.#Stack & {
|
||||
config: awsConfig
|
||||
source: json.Marshal(#CFNTemplate.eksNodeGroup)
|
||||
stackName: "\(namePrefix)eks-nodegroup"
|
||||
neverUpdate: true
|
||||
timeout: 30
|
||||
parameters: {
|
||||
ClusterName: clusterName
|
||||
NodeAutoScalingGroupDesiredCapacity: 1
|
||||
NodeAutoScalingGroupMaxSize: NodeAutoScalingGroupDesiredCapacity + 1
|
||||
NodeInstanceType: workerNodeInstanceType
|
||||
Subnets: eksControlPlane.outputs.SubnetIds
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user