Docs: update and polish "Kubernetes on AWS" example
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
29
examples/kubernetes-aws/main.cue
Normal file
29
examples/kubernetes-aws/main.cue
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/eks"
|
||||
)
|
||||
|
||||
// AWS account: credentials and region
|
||||
awsConfig: aws.#Config & {
|
||||
region: *"us-east-2" | string
|
||||
}
|
||||
|
||||
// Auto-provision an EKS cluster:
|
||||
// - VPC, Nat Gateways, Subnets, Security Group
|
||||
// - EKS Cluster
|
||||
// - Instance Node Group: auto-scaling-group, ec2 instances, etc...
|
||||
// base config can be changed (number of EC2 instances, types, etc...)
|
||||
infra: #Infrastructure & {
|
||||
"awsConfig": awsConfig
|
||||
namePrefix: "dagger-example-"
|
||||
workerNodeCapacity: int | *1
|
||||
workerNodeInstanceType: "t3.small"
|
||||
}
|
||||
|
||||
// Client configuration for kubectl
|
||||
kubeconfig: eks.#KubeConfig & {
|
||||
config: awsConfig
|
||||
clusterName: infra.clusterName
|
||||
}
|
Reference in New Issue
Block a user