Docs: update and polish "Kubernetes on AWS" example

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-04-01 22:37:14 +00:00
parent e701de01c1
commit 48e8b200ae
5 changed files with 48 additions and 15 deletions

View 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
}